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/json/json_reader.h" | 6 #include "base/json/json_reader.h" |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "base/test/trace_event_analyzer.h" | 8 #include "base/test/trace_event_analyzer.h" |
9 #include "base/trace_event/trace_event_impl.h" | 9 #include "base/trace_event/trace_event_impl.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 ~WebRtcGetUserMediaBrowserTest() override {} | 81 ~WebRtcGetUserMediaBrowserTest() override {} |
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::trace_event::TraceLog::GetInstance(); | 85 trace_log_ = base::trace_event::TraceLog::GetInstance(); |
86 base::trace_event::TraceOptions trace_options( | 86 base::trace_event::TraceConfig trace_config( |
87 base::trace_event::RECORD_UNTIL_FULL); | 87 "video", base::trace_event::RECORD_UNTIL_FULL); |
88 trace_options.enable_sampling = true; | 88 trace_config.EnableSampling(); |
89 trace_log_->SetEnabled(base::trace_event::CategoryFilter("video"), | 89 trace_log_->SetEnabled(trace_config, |
90 base::trace_event::TraceLog::RECORDING_MODE, | 90 base::trace_event::TraceLog::RECORDING_MODE); |
91 trace_options); | |
92 // Check that we are indeed recording. | 91 // Check that we are indeed recording. |
93 EXPECT_EQ(trace_log_->GetNumTracesRecorded(), 1); | 92 EXPECT_EQ(trace_log_->GetNumTracesRecorded(), 1); |
94 } | 93 } |
95 | 94 |
96 void StopTracing() { | 95 void StopTracing() { |
97 CHECK(message_loop_runner_.get() == NULL) | 96 CHECK(message_loop_runner_.get() == NULL) |
98 << "Calling StopTracing more than once"; | 97 << "Calling StopTracing more than once"; |
99 trace_log_->SetDisabled(); | 98 trace_log_->SetDisabled(); |
100 message_loop_runner_ = new MessageLoopRunner; | 99 message_loop_runner_ = new MessageLoopRunner; |
101 trace_log_->Flush(base::Bind( | 100 trace_log_->Flush(base::Bind( |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 {640, 640, 360, 360, 10, 30}, | 780 {640, 640, 360, 360, 10, 30}, |
782 {640, 640, 480, 480, 10, 30}, | 781 {640, 640, 480, 480, 10, 30}, |
783 {960, 960, 720, 720, 10, 30}, | 782 {960, 960, 720, 720, 10, 30}, |
784 {1280, 1280, 720, 720, 10, 30}}; | 783 {1280, 1280, 720, 720, 10, 30}}; |
785 | 784 |
786 INSTANTIATE_TEST_CASE_P(UserMedia, | 785 INSTANTIATE_TEST_CASE_P(UserMedia, |
787 WebRtcConstraintsBrowserTest, | 786 WebRtcConstraintsBrowserTest, |
788 testing::ValuesIn(kAllUserMediaSizes)); | 787 testing::ValuesIn(kAllUserMediaSizes)); |
789 | 788 |
790 } // namespace content | 789 } // namespace content |
OLD | NEW |