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

Side by Side Diff: content/browser/devtools/protocol/tracing_handler_unittest.cc

Issue 2406703002: tracing: remove sampling state profiler (Closed)
Patch Set: . Created 4 years, 2 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/json/json_reader.h" 5 #include "base/json/json_reader.h"
6 #include "base/trace_event/trace_config.h" 6 #include "base/trace_event/trace_config.h"
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "content/browser/devtools/protocol/tracing_handler.h" 8 #include "content/browser/devtools/protocol/tracing_handler.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace content { 11 namespace content {
12 namespace devtools { 12 namespace devtools {
13 namespace tracing { 13 namespace tracing {
14 14
15 namespace { 15 namespace {
16 16
17 const char kCustomTraceConfigString[] = 17 const char kCustomTraceConfigString[] =
18 "{" 18 "{"
19 "\"enable_argument_filter\":true," 19 "\"enable_argument_filter\":true,"
20 "\"enable_sampling\":true,"
21 "\"enable_systrace\":true," 20 "\"enable_systrace\":true,"
22 "\"excluded_categories\":[\"excluded\",\"exc_pattern*\"]," 21 "\"excluded_categories\":[\"excluded\",\"exc_pattern*\"],"
23 "\"included_categories\":[\"included\"," 22 "\"included_categories\":[\"included\","
24 "\"inc_pattern*\"," 23 "\"inc_pattern*\","
25 "\"disabled-by-default-cc\"," 24 "\"disabled-by-default-cc\","
26 "\"disabled-by-default-memory-infra\"]," 25 "\"disabled-by-default-memory-infra\"],"
27 "\"memory_dump_config\":{" 26 "\"memory_dump_config\":{"
28 "\"allowed_dump_modes\":[\"background\",\"light\",\"detailed\"]," 27 "\"allowed_dump_modes\":[\"background\",\"light\",\"detailed\"],"
29 "\"triggers\":[" 28 "\"triggers\":["
30 "{\"mode\":\"light\",\"periodic_interval_ms\":50}," 29 "{\"mode\":\"light\",\"periodic_interval_ms\":50},"
31 "{\"mode\":\"detailed\",\"periodic_interval_ms\":1000}" 30 "{\"mode\":\"detailed\",\"periodic_interval_ms\":1000}"
32 "]" 31 "]"
33 "}," 32 "},"
34 "\"record_mode\":\"record-continuously\"," 33 "\"record_mode\":\"record-continuously\","
35 "\"synthetic_delays\":[\"test.Delay1;16\",\"test.Delay2;32\"]" 34 "\"synthetic_delays\":[\"test.Delay1;16\",\"test.Delay2;32\"]"
36 "}"; 35 "}";
37 36
38 const char kCustomTraceConfigStringDevToolsStyle[] = 37 const char kCustomTraceConfigStringDevToolsStyle[] =
39 "{" 38 "{"
40 "\"enableArgumentFilter\":true," 39 "\"enableArgumentFilter\":true,"
41 "\"enableSampling\":true,"
42 "\"enableSystrace\":true," 40 "\"enableSystrace\":true,"
43 "\"excludedCategories\":[\"excluded\",\"exc_pattern*\"]," 41 "\"excludedCategories\":[\"excluded\",\"exc_pattern*\"],"
44 "\"includedCategories\":[\"included\"," 42 "\"includedCategories\":[\"included\","
45 "\"inc_pattern*\"," 43 "\"inc_pattern*\","
46 "\"disabled-by-default-cc\"," 44 "\"disabled-by-default-cc\","
47 "\"disabled-by-default-memory-infra\"]," 45 "\"disabled-by-default-memory-infra\"],"
48 "\"memoryDumpConfig\":{" 46 "\"memoryDumpConfig\":{"
49 "\"allowed_dump_modes\":[\"background\",\"light\",\"detailed\"]," 47 "\"allowed_dump_modes\":[\"background\",\"light\",\"detailed\"],"
50 "\"triggers\":[" 48 "\"triggers\":["
51 "{\"mode\":\"light\",\"periodicIntervalMs\":50}," 49 "{\"mode\":\"light\",\"periodicIntervalMs\":50},"
(...skipping 14 matching lines...) Expand all
66 64
67 base::trace_event::TraceConfig trace_config = 65 base::trace_event::TraceConfig trace_config =
68 TracingHandler::GetTraceConfigFromDevToolsConfig(*devtools_style_dict); 66 TracingHandler::GetTraceConfigFromDevToolsConfig(*devtools_style_dict);
69 67
70 EXPECT_STREQ(kCustomTraceConfigString, trace_config.ToString().c_str()); 68 EXPECT_STREQ(kCustomTraceConfigString, trace_config.ToString().c_str());
71 } 69 }
72 70
73 } // namespace tracing 71 } // namespace tracing
74 } // namespace devtools 72 } // namespace devtools
75 } // namespace content 73 } // namespace content
OLDNEW
« no previous file with comments | « components/tracing/browser/trace_config_file_unittest.cc ('k') | content/browser/tracing/tracing_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698