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

Unified Diff: base/trace_event/trace_config_unittest.cc

Issue 1814043002: Revert of Update DevTools Tracing.Start to accept trace config as a parameter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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_config.cc ('k') | components/tracing/trace_config_file.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/trace_config_unittest.cc
diff --git a/base/trace_event/trace_config_unittest.cc b/base/trace_event/trace_config_unittest.cc
index 273adaceae019e75afb6dceeacb4ab59c999c1b1..bd3788032924167caa7cbdf29ed88b50f7c49f9f 100644
--- a/base/trace_event/trace_config_unittest.cc
+++ b/base/trace_event/trace_config_unittest.cc
@@ -4,7 +4,6 @@
#include <stddef.h>
-#include "base/json/json_reader.h"
#include "base/macros.h"
#include "base/trace_event/memory_dump_manager.h"
#include "base/trace_event/trace_config.h"
@@ -24,27 +23,6 @@
"\"excluded_categories\":[\"*Debug\",\"*Test\"],"
"\"record_mode\":\"record-until-full\""
"}";
-
-const char kCustomTraceConfigString[] =
- "{"
- "\"enable_argument_filter\":true,"
- "\"enable_sampling\":true,"
- "\"enable_systrace\":true,"
- "\"excluded_categories\":[\"excluded\",\"exc_pattern*\"],"
- "\"included_categories\":[\"included\","
- "\"inc_pattern*\","
- "\"disabled-by-default-cc\","
- "\"disabled-by-default-memory-infra\"],"
- "\"memory_dump_config\":{"
- "\"triggers\":["
- "{\"mode\":\"light\",\"periodic_interval_ms\":50},"
- "{\"mode\":\"detailed\",\"periodic_interval_ms\":1000}"
- "]"
- "},"
- "\"record_mode\":\"record-continuously\","
- "\"synthetic_delays\":[\"test.Delay1;16\",\"test.Delay2;32\"]"
- "}";
-
} // namespace
TEST(TraceConfigTest, TraceConfigFromValidLegacyFormat) {
@@ -279,47 +257,6 @@
EXPECT_TRUE(tc.IsCategoryGroupEnabled("CategoryDebug,Category1"));
EXPECT_TRUE(tc.IsCategoryGroupEnabled("CategoryTest,not-excluded-category"));
EXPECT_FALSE(tc.IsCategoryGroupEnabled("CategoryDebug,CategoryTest"));
-}
-
-TEST(TraceConfigTest, TraceConfigFromDict) {
- // Passing in empty dictionary will not result in default trace config.
- DictionaryValue dict;
- TraceConfig tc(dict);
- EXPECT_STRNE(kDefaultTraceConfigString, tc.ToString().c_str());
- EXPECT_EQ(RECORD_UNTIL_FULL, tc.GetTraceRecordMode());
- EXPECT_FALSE(tc.IsSamplingEnabled());
- EXPECT_FALSE(tc.IsSystraceEnabled());
- EXPECT_FALSE(tc.IsArgumentFilterEnabled());
- EXPECT_STREQ("", tc.ToCategoryFilterString().c_str());
-
- scoped_ptr<Value> default_value(JSONReader::Read(kDefaultTraceConfigString));
- DCHECK(default_value);
- const DictionaryValue* default_dict = nullptr;
- bool is_dict = default_value->GetAsDictionary(&default_dict);
- DCHECK(is_dict);
- TraceConfig default_tc(*default_dict);
- EXPECT_STREQ(kDefaultTraceConfigString, default_tc.ToString().c_str());
- EXPECT_EQ(RECORD_UNTIL_FULL, default_tc.GetTraceRecordMode());
- EXPECT_FALSE(default_tc.IsSamplingEnabled());
- EXPECT_FALSE(default_tc.IsSystraceEnabled());
- EXPECT_FALSE(default_tc.IsArgumentFilterEnabled());
- EXPECT_STREQ("-*Debug,-*Test", default_tc.ToCategoryFilterString().c_str());
-
- scoped_ptr<Value> custom_value(JSONReader::Read(kCustomTraceConfigString));
- DCHECK(custom_value);
- const DictionaryValue* custom_dict = nullptr;
- DCHECK(custom_value->GetAsDictionary(&custom_dict));
- TraceConfig custom_tc(*custom_dict);
- EXPECT_STREQ(kCustomTraceConfigString, custom_tc.ToString().c_str());
- EXPECT_EQ(RECORD_CONTINUOUSLY, custom_tc.GetTraceRecordMode());
- EXPECT_TRUE(custom_tc.IsSamplingEnabled());
- EXPECT_TRUE(custom_tc.IsSystraceEnabled());
- EXPECT_TRUE(custom_tc.IsArgumentFilterEnabled());
- EXPECT_STREQ("included,inc_pattern*,"
- "disabled-by-default-cc,disabled-by-default-memory-infra,"
- "-excluded,-exc_pattern*,"
- "DELAY(test.Delay1;16),DELAY(test.Delay2;32)",
- custom_tc.ToCategoryFilterString().c_str());
}
TEST(TraceConfigTest, TraceConfigFromValidString) {
« no previous file with comments | « base/trace_event/trace_config.cc ('k') | components/tracing/trace_config_file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698