| 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 <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...) Expand all Loading... |
| 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 class WebRtcInternalsPerfBrowserTest : public WebRtcTestBase { |
| 46 public: | 46 public: |
| 47 void SetUpInProcessBrowserTestFixture() override { | 47 void SetUpInProcessBrowserTestFixture() override { |
| 48 DetectErrorsInJavaScript(); // Look for errors in our rather complex js. | 48 DetectErrorsInJavaScript(); // Look for errors in our rather complex js. |
| 49 } | 49 } |
| 50 | 50 |
| 51 void SetUpCommandLine(base::CommandLine* command_line) override { | 51 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 52 // Ensure the infobar is enabled, since we expect that in this test. | 52 // Ensure the infobar is enabled, since we expect that in this test. |
| 53 EXPECT_FALSE(command_line->HasSwitch(switches::kUseFakeUIForMediaStream)); | 53 EXPECT_FALSE(command_line->HasSwitch(switches::kUseFakeUIForMediaStream)); |
| 54 | 54 |
| 55 // Play a suitable, somewhat realistic video file. | 55 // Play a suitable, somewhat realistic video file. |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 *second_pc_dict, MakePerfTestLabel("_recvonly", opus_dtx), video_codec); | 216 *second_pc_dict, MakePerfTestLabel("_recvonly", opus_dtx), video_codec); |
| 217 | 217 |
| 218 HangUp(left_tab); | 218 HangUp(left_tab); |
| 219 HangUp(right_tab); | 219 HangUp(right_tab); |
| 220 } | 220 } |
| 221 }; | 221 }; |
| 222 | 222 |
| 223 // This is manual for its long execution time. | 223 // This is manual for its long execution time. |
| 224 | 224 |
| 225 IN_PROC_BROWSER_TEST_F( | 225 IN_PROC_BROWSER_TEST_F( |
| 226 WebRtcPerfBrowserTest, | 226 WebRtcInternalsPerfBrowserTest, |
| 227 MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetricsVp8) { | 227 MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetricsVp8) { |
| 228 RunsAudioVideoCall60SecsAndLogsInternalMetrics("VP8"); | 228 RunsAudioVideoCall60SecsAndLogsInternalMetrics("VP8"); |
| 229 } | 229 } |
| 230 | 230 |
| 231 IN_PROC_BROWSER_TEST_F( | 231 IN_PROC_BROWSER_TEST_F( |
| 232 WebRtcPerfBrowserTest, | 232 WebRtcInternalsPerfBrowserTest, |
| 233 MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetricsVp9) { | 233 MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetricsVp9) { |
| 234 RunsAudioVideoCall60SecsAndLogsInternalMetrics("VP9"); | 234 RunsAudioVideoCall60SecsAndLogsInternalMetrics("VP9"); |
| 235 } | 235 } |
| 236 | 236 |
| 237 #if BUILDFLAG(RTC_USE_H264) | 237 #if BUILDFLAG(RTC_USE_H264) |
| 238 | 238 |
| 239 IN_PROC_BROWSER_TEST_F( | 239 IN_PROC_BROWSER_TEST_F( |
| 240 WebRtcPerfBrowserTest, | 240 WebRtcInternalsPerfBrowserTest, |
| 241 MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetricsH264) { | 241 MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetricsH264) { |
| 242 // Only run test if run-time feature corresponding to |rtc_use_h264| is on. | 242 // Only run test if run-time feature corresponding to |rtc_use_h264| is on. |
| 243 if (!base::FeatureList::IsEnabled(content::kWebRtcH264WithOpenH264FFmpeg)) { | 243 if (!base::FeatureList::IsEnabled(content::kWebRtcH264WithOpenH264FFmpeg)) { |
| 244 LOG(WARNING) << "Run-time feature WebRTC-H264WithOpenH264FFmpeg disabled. " | 244 LOG(WARNING) << "Run-time feature WebRTC-H264WithOpenH264FFmpeg disabled. " |
| 245 "Skipping WebRtcPerfBrowserTest.MANUAL_RunsAudioVideoCall60SecsAndLogs" | 245 "Skipping WebRtcInternalsPerfBrowserTest." |
| 246 "InternalMetricsH264 (test \"OK\")"; | 246 "MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetricsH264 (test " |
| 247 "\"OK\")"; |
| 247 return; | 248 return; |
| 248 } | 249 } |
| 249 RunsAudioVideoCall60SecsAndLogsInternalMetrics("H264"); | 250 RunsAudioVideoCall60SecsAndLogsInternalMetrics("H264"); |
| 250 } | 251 } |
| 251 | 252 |
| 252 #endif // BUILDFLAG(RTC_USE_H264) | 253 #endif // BUILDFLAG(RTC_USE_H264) |
| 253 | 254 |
| 254 IN_PROC_BROWSER_TEST_F( | 255 IN_PROC_BROWSER_TEST_F( |
| 255 WebRtcPerfBrowserTest, | 256 WebRtcInternalsPerfBrowserTest, |
| 256 MANUAL_RunsOneWayCall60SecsAndLogsInternalMetricsDefault) { | 257 MANUAL_RunsOneWayCall60SecsAndLogsInternalMetricsDefault) { |
| 257 RunsOneWayCall60SecsAndLogsInternalMetrics("", false); | 258 RunsOneWayCall60SecsAndLogsInternalMetrics("", false); |
| 258 } | 259 } |
| 259 | 260 |
| 260 IN_PROC_BROWSER_TEST_F( | 261 IN_PROC_BROWSER_TEST_F( |
| 261 WebRtcPerfBrowserTest, | 262 WebRtcInternalsPerfBrowserTest, |
| 262 MANUAL_RunsOneWayCall60SecsAndLogsInternalMetricsWithOpusDtx) { | 263 MANUAL_RunsOneWayCall60SecsAndLogsInternalMetricsWithOpusDtx) { |
| 263 RunsOneWayCall60SecsAndLogsInternalMetrics("", true); | 264 RunsOneWayCall60SecsAndLogsInternalMetrics("", true); |
| 264 } | 265 } |
| OLD | NEW |