Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1124)

Unified Diff: base/trace_event/trace_event_unittest.cc

Issue 971673004: Enable trace with multiple categories with any one category ON (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch for landing! Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/trace_event/trace_event_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/trace_event_unittest.cc
diff --git a/base/trace_event/trace_event_unittest.cc b/base/trace_event/trace_event_unittest.cc
index a6bc0d4e7ced91adee3001aafab01a20ae0e7a0c..0d3b0912ae21a15deac99aaa02b3eaede25421b8 100644
--- a/base/trace_event/trace_event_unittest.cc
+++ b/base/trace_event/trace_event_unittest.cc
@@ -1205,8 +1205,8 @@ TEST_F(TraceEventTestFixture, Categories) {
EndTraceAndFlush();
EXPECT_TRUE(FindMatchingValue("cat", "inc2"));
EXPECT_FALSE(FindMatchingValue("cat", "inc"));
- EXPECT_FALSE(FindMatchingValue("cat", "inc2,inc"));
- EXPECT_FALSE(FindMatchingValue("cat", "inc,inc2"));
+ EXPECT_TRUE(FindMatchingValue("cat", "inc2,inc"));
+ EXPECT_TRUE(FindMatchingValue("cat", "inc,inc2"));
// Exclude existent wildcard -> all categories not matching wildcard
Clear();
@@ -2624,18 +2624,18 @@ TEST_F(TraceEventTestFixture, CategoryFilter) {
EXPECT_TRUE(default_cf.IsCategoryGroupEnabled("not-excluded-category"));
EXPECT_FALSE(
default_cf.IsCategoryGroupEnabled("disabled-by-default-category"));
- EXPECT_FALSE(default_cf.IsCategoryGroupEnabled("Category1,CategoryDebug"));
- EXPECT_FALSE(default_cf.IsCategoryGroupEnabled("CategoryDebug,Category1"));
- EXPECT_FALSE(default_cf.IsCategoryGroupEnabled("CategoryTest,Category2"));
+ EXPECT_TRUE(default_cf.IsCategoryGroupEnabled("Category1,CategoryDebug"));
+ EXPECT_TRUE(default_cf.IsCategoryGroupEnabled("CategoryDebug,Category1"));
+ EXPECT_TRUE(default_cf.IsCategoryGroupEnabled("CategoryTest,Category2"));
// Make sure that upon an empty string, we fall back to the default filter.
default_cf = CategoryFilter();
category_filter_str = default_cf.ToString();
EXPECT_STREQ("-*Debug,-*Test", category_filter_str.c_str());
EXPECT_TRUE(default_cf.IsCategoryGroupEnabled("not-excluded-category"));
- EXPECT_FALSE(default_cf.IsCategoryGroupEnabled("Category1,CategoryDebug"));
- EXPECT_FALSE(default_cf.IsCategoryGroupEnabled("CategoryDebug,Category1"));
- EXPECT_FALSE(default_cf.IsCategoryGroupEnabled("CategoryTest,Category2"));
+ EXPECT_TRUE(default_cf.IsCategoryGroupEnabled("Category1,CategoryDebug"));
+ EXPECT_TRUE(default_cf.IsCategoryGroupEnabled("CategoryDebug,Category1"));
+ EXPECT_TRUE(default_cf.IsCategoryGroupEnabled("CategoryTest,Category2"));
// Using an arbitrary non-empty filter.
CategoryFilter cf("included,-excluded,inc_pattern*,-exc_pattern*");
« no previous file with comments | « base/trace_event/trace_event_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698