Chromium Code Reviews

Side by Side Diff: chrome/browser/media/webrtc/webrtc_internals_perf_browsertest.cc

Issue 2545553003: WebRtcStatsPerfBrowserTest added, a perf test using the new getStats (Closed)
Patch Set: Addressed nits, rebase, default initialize Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
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 <memory> 5 #include <memory>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 24 matching lines...)
35 std::string MakePerfTestLabel(std::string base, bool opus_dtx) { 35 std::string MakePerfTestLabel(std::string base, bool opus_dtx) {
36 if (opus_dtx) { 36 if (opus_dtx) {
37 return base + "_with_opus_dtx"; 37 return base + "_with_opus_dtx";
38 } 38 }
39 return base; 39 return base;
40 } 40 }
41 41
42 // Performance browsertest for WebRTC. This test is manual since it takes long 42 // Performance browsertest for WebRTC. This test is manual since it takes long
43 // to execute and requires the reference files provided by the webrtc.DEPS 43 // to execute and requires the reference files provided by the webrtc.DEPS
44 // solution (which is only available on WebRTC internal bots). 44 // solution (which is only available on WebRTC internal bots).
45 class WebRtcPerfBrowserTest : public WebRtcTestBase { 45 // Gets its metrics from "chrome://webrtc-internals".
46 class WebRtcInternalsPerfBrowserTest : public WebRtcTestBase {
46 public: 47 public:
47 void SetUpInProcessBrowserTestFixture() override { 48 void SetUpInProcessBrowserTestFixture() override {
48 DetectErrorsInJavaScript(); // Look for errors in our rather complex js. 49 DetectErrorsInJavaScript(); // Look for errors in our rather complex js.
49 } 50 }
50 51
51 void SetUpCommandLine(base::CommandLine* command_line) override { 52 void SetUpCommandLine(base::CommandLine* command_line) override {
52 // Ensure the infobar is enabled, since we expect that in this test. 53 // Ensure the infobar is enabled, since we expect that in this test.
53 EXPECT_FALSE(command_line->HasSwitch(switches::kUseFakeUIForMediaStream)); 54 EXPECT_FALSE(command_line->HasSwitch(switches::kUseFakeUIForMediaStream));
54 55
55 // Play a suitable, somewhat realistic video file. 56 // Play a suitable, somewhat realistic video file.
(...skipping 160 matching lines...)
216 *second_pc_dict, MakePerfTestLabel("_recvonly", opus_dtx), video_codec); 217 *second_pc_dict, MakePerfTestLabel("_recvonly", opus_dtx), video_codec);
217 218
218 HangUp(left_tab); 219 HangUp(left_tab);
219 HangUp(right_tab); 220 HangUp(right_tab);
220 } 221 }
221 }; 222 };
222 223
223 // This is manual for its long execution time. 224 // This is manual for its long execution time.
224 225
225 IN_PROC_BROWSER_TEST_F( 226 IN_PROC_BROWSER_TEST_F(
226 WebRtcPerfBrowserTest, 227 WebRtcInternalsPerfBrowserTest,
227 MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetricsVp8) { 228 MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetricsVp8) {
228 RunsAudioVideoCall60SecsAndLogsInternalMetrics("VP8"); 229 RunsAudioVideoCall60SecsAndLogsInternalMetrics("VP8");
229 } 230 }
230 231
231 IN_PROC_BROWSER_TEST_F( 232 IN_PROC_BROWSER_TEST_F(
232 WebRtcPerfBrowserTest, 233 WebRtcInternalsPerfBrowserTest,
233 MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetricsVp9) { 234 MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetricsVp9) {
234 RunsAudioVideoCall60SecsAndLogsInternalMetrics("VP9"); 235 RunsAudioVideoCall60SecsAndLogsInternalMetrics("VP9");
235 } 236 }
236 237
237 #if BUILDFLAG(RTC_USE_H264) 238 #if BUILDFLAG(RTC_USE_H264)
238 239
239 IN_PROC_BROWSER_TEST_F( 240 IN_PROC_BROWSER_TEST_F(
240 WebRtcPerfBrowserTest, 241 WebRtcInternalsPerfBrowserTest,
241 MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetricsH264) { 242 MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetricsH264) {
242 // Only run test if run-time feature corresponding to |rtc_use_h264| is on. 243 // Only run test if run-time feature corresponding to |rtc_use_h264| is on.
243 if (!base::FeatureList::IsEnabled(content::kWebRtcH264WithOpenH264FFmpeg)) { 244 if (!base::FeatureList::IsEnabled(content::kWebRtcH264WithOpenH264FFmpeg)) {
244 LOG(WARNING) << "Run-time feature WebRTC-H264WithOpenH264FFmpeg disabled. " 245 LOG(WARNING) << "Run-time feature WebRTC-H264WithOpenH264FFmpeg disabled. "
245 "Skipping WebRtcPerfBrowserTest.MANUAL_RunsAudioVideoCall60SecsAndLogs" 246 "Skipping WebRtcInternalsPerfBrowserTest."
246 "InternalMetricsH264 (test \"OK\")"; 247 "MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetricsH264 (test "
248 "\"OK\")";
247 return; 249 return;
248 } 250 }
249 RunsAudioVideoCall60SecsAndLogsInternalMetrics("H264"); 251 RunsAudioVideoCall60SecsAndLogsInternalMetrics("H264");
250 } 252 }
251 253
252 #endif // BUILDFLAG(RTC_USE_H264) 254 #endif // BUILDFLAG(RTC_USE_H264)
253 255
254 IN_PROC_BROWSER_TEST_F( 256 IN_PROC_BROWSER_TEST_F(
255 WebRtcPerfBrowserTest, 257 WebRtcInternalsPerfBrowserTest,
256 MANUAL_RunsOneWayCall60SecsAndLogsInternalMetricsDefault) { 258 MANUAL_RunsOneWayCall60SecsAndLogsInternalMetricsDefault) {
257 RunsOneWayCall60SecsAndLogsInternalMetrics("", false); 259 RunsOneWayCall60SecsAndLogsInternalMetrics("", false);
258 } 260 }
259 261
260 IN_PROC_BROWSER_TEST_F( 262 IN_PROC_BROWSER_TEST_F(
261 WebRtcPerfBrowserTest, 263 WebRtcInternalsPerfBrowserTest,
262 MANUAL_RunsOneWayCall60SecsAndLogsInternalMetricsWithOpusDtx) { 264 MANUAL_RunsOneWayCall60SecsAndLogsInternalMetricsWithOpusDtx) {
263 RunsOneWayCall60SecsAndLogsInternalMetrics("", true); 265 RunsOneWayCall60SecsAndLogsInternalMetrics("", true);
264 } 266 }
OLDNEW
« no previous file with comments | « chrome/browser/media/webrtc/webrtc_browsertest_base.cc ('k') | chrome/browser/media/webrtc/webrtc_perf_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine