OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project 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 #include <limits> | 4 #include <limits> |
5 | 5 |
6 #include "include/libplatform/v8-tracing.h" | 6 #include "include/libplatform/v8-tracing.h" |
7 #include "src/tracing/trace-event.h" | 7 #include "src/tracing/trace-event.h" |
8 #include "test/cctest/cctest.h" | 8 #include "test/cctest/cctest.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
11 namespace platform { | 11 namespace platform { |
12 namespace tracing { | 12 namespace tracing { |
13 | 13 |
14 TEST(TestTraceConfig) { | 14 TEST(TestTraceConfig) { |
15 LocalContext env; | 15 LocalContext env; |
16 TraceConfig* trace_config = new TraceConfig(); | 16 TraceConfig* trace_config = new TraceConfig(); |
17 trace_config->EnableSampling(); | |
18 trace_config->AddIncludedCategory("v8"); | 17 trace_config->AddIncludedCategory("v8"); |
19 trace_config->AddIncludedCategory(TRACE_DISABLED_BY_DEFAULT("v8.runtime")); | 18 trace_config->AddIncludedCategory(TRACE_DISABLED_BY_DEFAULT("v8.runtime")); |
20 trace_config->AddExcludedCategory("v8.cpu_profile"); | 19 trace_config->AddExcludedCategory("v8.cpu_profile"); |
21 | 20 |
22 CHECK_EQ(trace_config->IsSamplingEnabled(), true); | |
23 CHECK_EQ(trace_config->IsSystraceEnabled(), false); | 21 CHECK_EQ(trace_config->IsSystraceEnabled(), false); |
24 CHECK_EQ(trace_config->IsArgumentFilterEnabled(), false); | 22 CHECK_EQ(trace_config->IsArgumentFilterEnabled(), false); |
25 CHECK_EQ(trace_config->IsCategoryGroupEnabled("v8"), true); | 23 CHECK_EQ(trace_config->IsCategoryGroupEnabled("v8"), true); |
26 CHECK_EQ(trace_config->IsCategoryGroupEnabled("v8.cpu_profile"), false); | 24 CHECK_EQ(trace_config->IsCategoryGroupEnabled("v8.cpu_profile"), false); |
27 CHECK_EQ(trace_config->IsCategoryGroupEnabled("v8.cpu_profile.hires"), false); | 25 CHECK_EQ(trace_config->IsCategoryGroupEnabled("v8.cpu_profile.hires"), false); |
28 CHECK_EQ(trace_config->IsCategoryGroupEnabled( | 26 CHECK_EQ(trace_config->IsCategoryGroupEnabled( |
29 TRACE_DISABLED_BY_DEFAULT("v8.runtime")), | 27 TRACE_DISABLED_BY_DEFAULT("v8.runtime")), |
30 true); | 28 true); |
31 delete trace_config; | 29 delete trace_config; |
32 } | 30 } |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 | 399 |
402 CHECK_EQ(1, observer.enabled_count); | 400 CHECK_EQ(1, observer.enabled_count); |
403 CHECK_EQ(1, observer.disabled_count); | 401 CHECK_EQ(1, observer.disabled_count); |
404 | 402 |
405 i::V8::SetPlatformForTesting(old_platform); | 403 i::V8::SetPlatformForTesting(old_platform); |
406 } | 404 } |
407 | 405 |
408 } // namespace tracing | 406 } // namespace tracing |
409 } // namespace platform | 407 } // namespace platform |
410 } // namespace v8 | 408 } // namespace v8 |
OLD | NEW |