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

Side by Side Diff: content/browser/tracing/background_tracing_config_unittest.cc

Issue 1981823003: Add deep report for BENCHMARK_MEMORY (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: limit to 5sec Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <memory> 5 #include <memory>
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "content/browser/tracing/background_tracing_config_impl.h" 10 #include "content/browser/tracing/background_tracing_config_impl.h"
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 "\"BENCHMARK\",\"configs\": [{\"rule\": " 276 "\"BENCHMARK\",\"configs\": [{\"rule\": "
277 "\"MONITOR_AND_DUMP_WHEN_TRIGGER_NAMED\", \"trigger_name\":\"foo\"}]}"); 277 "\"MONITOR_AND_DUMP_WHEN_TRIGGER_NAMED\", \"trigger_name\":\"foo\"}]}");
278 278
279 BackgroundTracingConfigImpl::CategoryPreset categories[] = { 279 BackgroundTracingConfigImpl::CategoryPreset categories[] = {
280 BackgroundTracingConfigImpl::BENCHMARK, 280 BackgroundTracingConfigImpl::BENCHMARK,
281 BackgroundTracingConfigImpl::BENCHMARK_DEEP, 281 BackgroundTracingConfigImpl::BENCHMARK_DEEP,
282 BackgroundTracingConfigImpl::BENCHMARK_GPU, 282 BackgroundTracingConfigImpl::BENCHMARK_GPU,
283 BackgroundTracingConfigImpl::BENCHMARK_IPC, 283 BackgroundTracingConfigImpl::BENCHMARK_IPC,
284 BackgroundTracingConfigImpl::BENCHMARK_STARTUP, 284 BackgroundTracingConfigImpl::BENCHMARK_STARTUP,
285 BackgroundTracingConfigImpl::BENCHMARK_BLINK_GC, 285 BackgroundTracingConfigImpl::BENCHMARK_BLINK_GC,
286 BackgroundTracingConfigImpl::BENCHMARK_MEMORY,
286 BackgroundTracingConfigImpl::BENCHMARK_EXECUTION_METRIC, 287 BackgroundTracingConfigImpl::BENCHMARK_EXECUTION_METRIC,
287 BackgroundTracingConfigImpl::BLINK_STYLE, 288 BackgroundTracingConfigImpl::BLINK_STYLE,
288 }; 289 };
289 290
290 const char* category_strings[] = {"BENCHMARK", 291 const char* category_strings[] = {"BENCHMARK",
291 "BENCHMARK_DEEP", 292 "BENCHMARK_DEEP",
292 "BENCHMARK_GPU", 293 "BENCHMARK_GPU",
293 "BENCHMARK_IPC", 294 "BENCHMARK_IPC",
294 "BENCHMARK_STARTUP", 295 "BENCHMARK_STARTUP",
295 "BENCHMARK_BLINK_GC", 296 "BENCHMARK_BLINK_GC",
297 "BENCHMARK_MEMORY",
ssid 2016/05/27 01:08:10 ditto
keishi 2016/05/27 04:29:07 Done.
296 "BENCHMARK_EXECUTION_METRIC", 298 "BENCHMARK_EXECUTION_METRIC",
297 "BLINK_STYLE"}; 299 "BLINK_STYLE"};
298 for (size_t i = 0; 300 for (size_t i = 0;
299 i < 301 i <
300 sizeof(categories) / sizeof(BackgroundTracingConfigImpl::CategoryPreset); 302 sizeof(categories) / sizeof(BackgroundTracingConfigImpl::CategoryPreset);
301 i++) { 303 i++) {
302 config->set_category_preset(categories[i]); 304 config->set_category_preset(categories[i]);
303 std::string expected = 305 std::string expected =
304 std::string("{\"category\":\"") + category_strings[i] + 306 std::string("{\"category\":\"") + category_strings[i] +
305 std::string( 307 std::string(
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 ConfigToString(config.get()), 618 ConfigToString(config.get()),
617 "{\"configs\":[{\"category\":\"BENCHMARK_DEEP\",\"rule\":\"TRACE_" 619 "{\"configs\":[{\"category\":\"BENCHMARK_DEEP\",\"rule\":\"TRACE_"
618 "ON_NAVIGATION_UNTIL_TRIGGER_OR_FULL\",\"trigger_delay\":30," 620 "ON_NAVIGATION_UNTIL_TRIGGER_OR_FULL\",\"trigger_delay\":30,"
619 "\"trigger_name\":\"foo1\"},{\"category\":\"BENCHMARK_DEEP\",\"rule\":" 621 "\"trigger_name\":\"foo1\"},{\"category\":\"BENCHMARK_DEEP\",\"rule\":"
620 "\"TRACE_ON_NAVIGATION_UNTIL_TRIGGER_OR_FULL\",\"trigger_delay\":30," 622 "\"TRACE_ON_NAVIGATION_UNTIL_TRIGGER_OR_FULL\",\"trigger_delay\":30,"
621 "\"trigger_name\":\"foo2\"}],\"mode\":\"REACTIVE_TRACING_MODE\"}"); 623 "\"trigger_name\":\"foo2\"}],\"mode\":\"REACTIVE_TRACING_MODE\"}");
622 } 624 }
623 } 625 }
624 626
625 } // namspace content 627 } // namspace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698