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

Unified Diff: content/browser/tracing/background_tracing_config_unittest.cc

Issue 1789673002: [bulk-reports] - Add BENCHMARK_BLINK_GC. (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
Index: content/browser/tracing/background_tracing_config_unittest.cc
diff --git a/content/browser/tracing/background_tracing_config_unittest.cc b/content/browser/tracing/background_tracing_config_unittest.cc
index 2b95069a401eefb460480ea9da30c750175be1ba..901e865e60bd9487a602dca0a2e7ade0b3e0696d 100644
--- a/content/browser/tracing/background_tracing_config_unittest.cc
+++ b/content/browser/tracing/background_tracing_config_unittest.cc
@@ -269,6 +269,44 @@ TEST_F(BackgroundTracingConfigTest, PreemptiveConfigFromValidString) {
EXPECT_EQ(config->scenario_name(), "my_awesome_experiment");
}
+TEST_F(BackgroundTracingConfigTest, ValidPreemptiveCategoryToString) {
+ scoped_ptr<BackgroundTracingConfigImpl> config = ReadFromJSONString(
+ "{\"mode\":\"PREEMPTIVE_TRACING_MODE\", \"category\": "
+ "\"BENCHMARK\",\"configs\": [{\"rule\": "
+ "\"MONITOR_AND_DUMP_WHEN_TRIGGER_NAMED\", \"trigger_name\":\"foo\"}]}");
+
+ BackgroundTracingConfigImpl::CategoryPreset categories[] = {
+ BackgroundTracingConfigImpl::BENCHMARK,
+ BackgroundTracingConfigImpl::BENCHMARK_DEEP,
+ BackgroundTracingConfigImpl::BENCHMARK_GPU,
+ BackgroundTracingConfigImpl::BENCHMARK_IPC,
+ BackgroundTracingConfigImpl::BENCHMARK_STARTUP,
+ BackgroundTracingConfigImpl::BENCHMARK_BLINK_GC,
+ BackgroundTracingConfigImpl::BLINK_STYLE,
+ };
+
+ const char* category_strings[] = {"BENCHMARK", "BENCHMARK_DEEP",
+ "BENCHMARK_GPU", "BENCHMARK_IPC",
+ "BENCHMARK_STARTUP", "BENCHMARK_BLINK_GC",
+ "BLINK_STYLE"};
+ for (size_t i = 0;
+ i <
+ sizeof(categories) / sizeof(BackgroundTracingConfigImpl::CategoryPreset);
+ i++) {
+ config->set_category_preset(categories[i]);
+ std::string expected =
+ std::string("{\"category\":\"") + category_strings[i] +
+ std::string(
+ "\",\"configs\":[{\"rule\":"
+ "\"MONITOR_AND_DUMP_WHEN_TRIGGER_NAMED\",\"trigger_name\":"
+ "\"foo\"}],\"mode\":\"PREEMPTIVE_TRACING_MODE\"}");
+ EXPECT_EQ(ConfigToString(config.get()), expected.c_str());
+ scoped_ptr<BackgroundTracingConfigImpl> config2 =
+ ReadFromJSONString(expected);
+ EXPECT_EQ(config->category_preset(), config2->category_preset());
+ }
+}
+
TEST_F(BackgroundTracingConfigTest, ReactiveConfigFromValidString) {
scoped_ptr<BackgroundTracingConfigImpl> config;
« no previous file with comments | « content/browser/tracing/background_tracing_config_impl.cc ('k') | content/browser/tracing/background_tracing_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698