OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/debug/trace_event_impl.h" | 6 #include "base/debug/trace_event_impl.h" |
7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "base/test/trace_event_analyzer.h" | 9 #include "base/test/trace_event_analyzer.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 namespace content { | 76 namespace content { |
77 | 77 |
78 class WebRtcGetUserMediaBrowserTest: public WebRtcContentBrowserTest { | 78 class WebRtcGetUserMediaBrowserTest: public WebRtcContentBrowserTest { |
79 public: | 79 public: |
80 WebRtcGetUserMediaBrowserTest() : trace_log_(NULL) {} | 80 WebRtcGetUserMediaBrowserTest() : trace_log_(NULL) {} |
81 virtual ~WebRtcGetUserMediaBrowserTest() {} | 81 virtual ~WebRtcGetUserMediaBrowserTest() {} |
82 | 82 |
83 void StartTracing() { | 83 void StartTracing() { |
84 CHECK(trace_log_ == NULL) << "Can only can start tracing once"; | 84 CHECK(trace_log_ == NULL) << "Can only can start tracing once"; |
85 trace_log_ = base::debug::TraceLog::GetInstance(); | 85 trace_log_ = base::debug::TraceLog::GetInstance(); |
86 trace_log_->SetEnabled(base::debug::CategoryFilter("video"), | 86 trace_log_->SetEnabled( |
87 base::debug::TraceLog::RECORDING_MODE, | 87 base::debug::CategoryFilter("video"), |
88 base::debug::TraceLog::ENABLE_SAMPLING); | 88 base::debug::TraceLog::RECORDING_MODE, |
| 89 base::debug::TraceOptions( |
| 90 base::debug::TraceOptions( |
| 91 base::debug::RECORD_UNTIL_FULL) |
| 92 .EnableSampling(true))); |
89 // Check that we are indeed recording. | 93 // Check that we are indeed recording. |
90 EXPECT_EQ(trace_log_->GetNumTracesRecorded(), 1); | 94 EXPECT_EQ(trace_log_->GetNumTracesRecorded(), 1); |
91 } | 95 } |
92 | 96 |
93 void StopTracing() { | 97 void StopTracing() { |
94 CHECK(message_loop_runner_ == NULL) << "Calling StopTracing more than once"; | 98 CHECK(message_loop_runner_ == NULL) << "Calling StopTracing more than once"; |
95 trace_log_->SetDisabled(); | 99 trace_log_->SetDisabled(); |
96 message_loop_runner_ = new MessageLoopRunner; | 100 message_loop_runner_ = new MessageLoopRunner; |
97 trace_log_->Flush(base::Bind( | 101 trace_log_->Flush(base::Bind( |
98 &WebRtcGetUserMediaBrowserTest::OnTraceDataCollected, | 102 &WebRtcGetUserMediaBrowserTest::OnTraceDataCollected, |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 {640, 640, 360, 360, 10, 30}, | 615 {640, 640, 360, 360, 10, 30}, |
612 {640, 640, 480, 480, 10, 30}, | 616 {640, 640, 480, 480, 10, 30}, |
613 {960, 960, 720, 720, 10, 30}, | 617 {960, 960, 720, 720, 10, 30}, |
614 {1280, 1280, 720, 720, 10, 30}}; | 618 {1280, 1280, 720, 720, 10, 30}}; |
615 | 619 |
616 INSTANTIATE_TEST_CASE_P(UserMedia, | 620 INSTANTIATE_TEST_CASE_P(UserMedia, |
617 WebRtcConstraintsBrowserTest, | 621 WebRtcConstraintsBrowserTest, |
618 testing::ValuesIn(kAllUserMediaSizes)); | 622 testing::ValuesIn(kAllUserMediaSizes)); |
619 | 623 |
620 } // namespace content | 624 } // namespace content |
OLD | NEW |