OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/test/trace_event_analyzer.h" | 6 #include "base/test/trace_event_analyzer.h" |
7 #include "testing/gmock/include/gmock/gmock.h" | 7 #include "testing/gmock/include/gmock/gmock.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace trace_analyzer { | 10 namespace trace_analyzer { |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
194 EXPECT_FALSE(event_category.Evaluate(other)); | 194 EXPECT_FALSE(event_category.Evaluate(other)); |
195 EXPECT_FALSE(event_name.Evaluate(other)); | 195 EXPECT_FALSE(event_name.Evaluate(other)); |
196 EXPECT_FALSE(event_id.Evaluate(other)); | 196 EXPECT_FALSE(event_id.Evaluate(other)); |
197 EXPECT_FALSE(event_has_arg1.Evaluate(other)); | 197 EXPECT_FALSE(event_has_arg1.Evaluate(other)); |
198 EXPECT_FALSE(event_has_arg2.Evaluate(other)); | 198 EXPECT_FALSE(event_has_arg2.Evaluate(other)); |
199 EXPECT_FALSE(event_arg1.Evaluate(other)); | 199 EXPECT_FALSE(event_arg1.Evaluate(other)); |
200 EXPECT_FALSE(event_arg2.Evaluate(other)); | 200 EXPECT_FALSE(event_arg2.Evaluate(other)); |
201 EXPECT_FALSE(event_has_other.Evaluate(other)); | 201 EXPECT_FALSE(event_has_other.Evaluate(other)); |
202 } | 202 } |
203 | 203 |
204 #if defined(OS_IOS) | |
stuartmorgan
2012/07/12 09:36:31
Let's pull this file out of the CL; it's not conce
| |
205 #define BooleanOperators DISABLED_BooleanOperators | |
206 #endif | |
204 TEST_F(TraceEventAnalyzerTest, BooleanOperators) { | 207 TEST_F(TraceEventAnalyzerTest, BooleanOperators) { |
205 ManualSetUp(); | 208 ManualSetUp(); |
206 | 209 |
207 BeginTracing(); | 210 BeginTracing(); |
208 { | 211 { |
209 TRACE_EVENT_INSTANT1("cat1", "name1", "num", 1); | 212 TRACE_EVENT_INSTANT1("cat1", "name1", "num", 1); |
210 TRACE_EVENT_INSTANT1("cat1", "name2", "num", 2); | 213 TRACE_EVENT_INSTANT1("cat1", "name2", "num", 2); |
211 TRACE_EVENT_INSTANT1("cat2", "name3", "num", 3); | 214 TRACE_EVENT_INSTANT1("cat2", "name3", "num", 3); |
212 TRACE_EVENT_INSTANT1("cat2", "name4", "num", 4); | 215 TRACE_EVENT_INSTANT1("cat2", "name4", "num", 4); |
213 } | 216 } |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
335 analyzer->FindEvents(Query::EventArg("a") % Query::EventArg("b") == | 338 analyzer->FindEvents(Query::EventArg("a") % Query::EventArg("b") == |
336 Query::Int(0), &found); | 339 Query::Int(0), &found); |
337 EXPECT_EQ(2u, found.size()); | 340 EXPECT_EQ(2u, found.size()); |
338 | 341 |
339 // - (negate) | 342 // - (negate) |
340 analyzer->FindEvents(-Query::EventArg("b") == Query::Int(-10), &found); | 343 analyzer->FindEvents(-Query::EventArg("b") == Query::Int(-10), &found); |
341 EXPECT_EQ(1u, found.size()); | 344 EXPECT_EQ(1u, found.size()); |
342 EXPECT_STREQ("math2", found.front()->name.c_str()); | 345 EXPECT_STREQ("math2", found.front()->name.c_str()); |
343 } | 346 } |
344 | 347 |
348 #if defined(OS_IOS) | |
349 #define StringPattern DISABLED_StringPattern | |
350 #endif | |
345 TEST_F(TraceEventAnalyzerTest, StringPattern) { | 351 TEST_F(TraceEventAnalyzerTest, StringPattern) { |
346 ManualSetUp(); | 352 ManualSetUp(); |
347 | 353 |
348 BeginTracing(); | 354 BeginTracing(); |
349 { | 355 { |
350 TRACE_EVENT_INSTANT0("cat1", "name1"); | 356 TRACE_EVENT_INSTANT0("cat1", "name1"); |
351 TRACE_EVENT_INSTANT0("cat1", "name2"); | 357 TRACE_EVENT_INSTANT0("cat1", "name2"); |
352 TRACE_EVENT_INSTANT0("cat1", "no match"); | 358 TRACE_EVENT_INSTANT0("cat1", "no match"); |
353 TRACE_EVENT_INSTANT0("cat1", "name3x"); | 359 TRACE_EVENT_INSTANT0("cat1", "name3x"); |
354 } | 360 } |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
818 EXPECT_EQ(num_events, CountMatches(event_ptrs, Query::Bool(true))); | 824 EXPECT_EQ(num_events, CountMatches(event_ptrs, Query::Bool(true))); |
819 EXPECT_EQ(num_events - 1, CountMatches(event_ptrs, Query::Bool(true), | 825 EXPECT_EQ(num_events - 1, CountMatches(event_ptrs, Query::Bool(true), |
820 1, num_events)); | 826 1, num_events)); |
821 EXPECT_EQ(1u, CountMatches(event_ptrs, query_one)); | 827 EXPECT_EQ(1u, CountMatches(event_ptrs, query_one)); |
822 EXPECT_EQ(num_events - 1, CountMatches(event_ptrs, !query_one)); | 828 EXPECT_EQ(num_events - 1, CountMatches(event_ptrs, !query_one)); |
823 EXPECT_EQ(num_named, CountMatches(event_ptrs, query_named)); | 829 EXPECT_EQ(num_named, CountMatches(event_ptrs, query_named)); |
824 } | 830 } |
825 | 831 |
826 | 832 |
827 } // namespace trace_analyzer | 833 } // namespace trace_analyzer |
OLD | NEW |