| OLD | NEW |
| 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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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_HEAVY, | 286 BackgroundTracingConfigImpl::BENCHMARK_MEMORY_HEAVY, |
| 287 BackgroundTracingConfigImpl::BENCHMARK_MEMORY_LIGHT, |
| 287 BackgroundTracingConfigImpl::BENCHMARK_EXECUTION_METRIC, | 288 BackgroundTracingConfigImpl::BENCHMARK_EXECUTION_METRIC, |
| 288 BackgroundTracingConfigImpl::BLINK_STYLE, | 289 BackgroundTracingConfigImpl::BLINK_STYLE, |
| 289 }; | 290 }; |
| 290 | 291 |
| 291 const char* category_strings[] = {"BENCHMARK", | 292 const char* category_strings[] = {"BENCHMARK", |
| 292 "BENCHMARK_DEEP", | 293 "BENCHMARK_DEEP", |
| 293 "BENCHMARK_GPU", | 294 "BENCHMARK_GPU", |
| 294 "BENCHMARK_IPC", | 295 "BENCHMARK_IPC", |
| 295 "BENCHMARK_STARTUP", | 296 "BENCHMARK_STARTUP", |
| 296 "BENCHMARK_BLINK_GC", | 297 "BENCHMARK_BLINK_GC", |
| 297 "BENCHMARK_MEMORY_HEAVY", | 298 "BENCHMARK_MEMORY_HEAVY", |
| 299 "BENCHMARK_MEMORY_LIGHT", |
| 298 "BENCHMARK_EXECUTION_METRIC", | 300 "BENCHMARK_EXECUTION_METRIC", |
| 299 "BLINK_STYLE"}; | 301 "BLINK_STYLE"}; |
| 300 for (size_t i = 0; | 302 for (size_t i = 0; |
| 301 i < | 303 i < |
| 302 sizeof(categories) / sizeof(BackgroundTracingConfigImpl::CategoryPreset); | 304 sizeof(categories) / sizeof(BackgroundTracingConfigImpl::CategoryPreset); |
| 303 i++) { | 305 i++) { |
| 304 config->set_category_preset(categories[i]); | 306 config->set_category_preset(categories[i]); |
| 305 std::string expected = | 307 std::string expected = |
| 306 std::string("{\"category\":\"") + category_strings[i] + | 308 std::string("{\"category\":\"") + category_strings[i] + |
| 307 std::string( | 309 std::string( |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 ConfigToString(config.get()), | 620 ConfigToString(config.get()), |
| 619 "{\"configs\":[{\"category\":\"BENCHMARK_DEEP\",\"rule\":\"TRACE_" | 621 "{\"configs\":[{\"category\":\"BENCHMARK_DEEP\",\"rule\":\"TRACE_" |
| 620 "ON_NAVIGATION_UNTIL_TRIGGER_OR_FULL\",\"trigger_delay\":30," | 622 "ON_NAVIGATION_UNTIL_TRIGGER_OR_FULL\",\"trigger_delay\":30," |
| 621 "\"trigger_name\":\"foo1\"},{\"category\":\"BENCHMARK_DEEP\",\"rule\":" | 623 "\"trigger_name\":\"foo1\"},{\"category\":\"BENCHMARK_DEEP\",\"rule\":" |
| 622 "\"TRACE_ON_NAVIGATION_UNTIL_TRIGGER_OR_FULL\",\"trigger_delay\":30," | 624 "\"TRACE_ON_NAVIGATION_UNTIL_TRIGGER_OR_FULL\",\"trigger_delay\":30," |
| 623 "\"trigger_name\":\"foo2\"}],\"mode\":\"REACTIVE_TRACING_MODE\"}"); | 625 "\"trigger_name\":\"foo2\"}],\"mode\":\"REACTIVE_TRACING_MODE\"}"); |
| 624 } | 626 } |
| 625 } | 627 } |
| 626 | 628 |
| 627 } // namspace content | 629 } // namspace content |
| OLD | NEW |