OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/debug/trace_event_unittest.h" | 5 #include "base/debug/trace_event_unittest.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 #include <cstdlib> | 8 #include <cstdlib> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 2421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2432 | 2432 |
2433 ASSERT_EQ(6u, collected_events_names_.size()); | 2433 ASSERT_EQ(6u, collected_events_names_.size()); |
2434 VerifyCollectedEvent(0, TRACE_EVENT_PHASE_BEGIN, "callback", "duration1"); | 2434 VerifyCollectedEvent(0, TRACE_EVENT_PHASE_BEGIN, "callback", "duration1"); |
2435 VerifyCollectedEvent(1, TRACE_EVENT_PHASE_BEGIN, "callback", "duration2"); | 2435 VerifyCollectedEvent(1, TRACE_EVENT_PHASE_BEGIN, "callback", "duration2"); |
2436 VerifyCollectedEvent(2, TRACE_EVENT_PHASE_BEGIN, "callback", "duration3"); | 2436 VerifyCollectedEvent(2, TRACE_EVENT_PHASE_BEGIN, "callback", "duration3"); |
2437 VerifyCollectedEvent(3, TRACE_EVENT_PHASE_END, "callback", "duration3"); | 2437 VerifyCollectedEvent(3, TRACE_EVENT_PHASE_END, "callback", "duration3"); |
2438 VerifyCollectedEvent(4, TRACE_EVENT_PHASE_END, "callback", "duration2"); | 2438 VerifyCollectedEvent(4, TRACE_EVENT_PHASE_END, "callback", "duration2"); |
2439 VerifyCollectedEvent(5, TRACE_EVENT_PHASE_END, "callback", "duration1"); | 2439 VerifyCollectedEvent(5, TRACE_EVENT_PHASE_END, "callback", "duration1"); |
2440 } | 2440 } |
2441 | 2441 |
2442 #if defined(OS_WIN) | 2442 TEST_F(TraceEventTestFixture, TraceBufferVectorReportFull) { |
2443 // http://crbug.com/396403 | |
2444 #define MAYBE_TraceBufferVectorReportFull DISABLED_TraceBufferVectorReportFull | |
2445 #else | |
2446 #define MAYBE_TraceBufferVectorReportFull TraceBufferVectorReportFull | |
2447 #endif | |
2448 TEST_F(TraceEventTestFixture, MAYBE_TraceBufferVectorReportFull) { | |
2449 TraceLog* trace_log = TraceLog::GetInstance(); | 2443 TraceLog* trace_log = TraceLog::GetInstance(); |
2450 trace_log->SetEnabled(CategoryFilter("*"), | 2444 trace_log->SetEnabled(CategoryFilter("*"), |
2451 TraceLog::RECORDING_MODE, | 2445 TraceLog::RECORDING_MODE, |
2452 TraceOptions()); | 2446 TraceOptions()); |
2453 trace_log->logged_events_.reset( | 2447 trace_log->logged_events_.reset( |
2454 trace_log->CreateTraceBufferVectorOfSize(100)); | 2448 trace_log->CreateTraceBufferVectorOfSize(100)); |
2455 do { | 2449 do { |
2456 TRACE_EVENT_BEGIN_WITH_ID_TID_AND_TIMESTAMP0( | 2450 TRACE_EVENT_BEGIN_WITH_ID_TID_AND_TIMESTAMP0( |
2457 "all", "with_timestamp", 0, 0, | 2451 "all", "with_timestamp", 0, 0, |
2458 TimeTicks::NowFromSystemTraceTime().ToInternalValue()); | 2452 TimeTicks::NowFromSystemTraceTime().ToInternalValue()); |
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3061 EXPECT_EQ(original_option.enable_sampling, new_options.enable_sampling); | 3055 EXPECT_EQ(original_option.enable_sampling, new_options.enable_sampling); |
3062 EXPECT_EQ(original_option.enable_systrace, new_options.enable_systrace); | 3056 EXPECT_EQ(original_option.enable_systrace, new_options.enable_systrace); |
3063 } | 3057 } |
3064 } | 3058 } |
3065 } | 3059 } |
3066 } | 3060 } |
3067 | 3061 |
3068 | 3062 |
3069 } // namespace debug | 3063 } // namespace debug |
3070 } // namespace base | 3064 } // namespace base |
OLD | NEW |