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 11 matching lines...) Expand all Loading... |
22 #include "chrome/test/base/in_process_browser_test.h" | 22 #include "chrome/test/base/in_process_browser_test.h" |
23 #include "chrome/test/base/ui_test_utils.h" | 23 #include "chrome/test/base/ui_test_utils.h" |
24 #include "content/public/common/content_switches.h" | 24 #include "content/public/common/content_switches.h" |
25 #include "content/public/common/feature_h264_with_openh264_ffmpeg.h" | 25 #include "content/public/common/feature_h264_with_openh264_ffmpeg.h" |
26 #include "content/public/common/features.h" | 26 #include "content/public/common/features.h" |
27 #include "content/public/test/browser_test_utils.h" | 27 #include "content/public/test/browser_test_utils.h" |
28 #include "media/base/media_switches.h" | 28 #include "media/base/media_switches.h" |
29 #include "net/test/embedded_test_server/embedded_test_server.h" | 29 #include "net/test/embedded_test_server/embedded_test_server.h" |
30 #include "testing/perf/perf_test.h" | 30 #include "testing/perf/perf_test.h" |
31 | 31 |
| 32 #if defined(OS_MACOSX) |
| 33 #include "base/threading/thread_restrictions.h" |
| 34 #endif // defined(OS_MACOSX) |
| 35 |
32 static const char kMainWebrtcTestHtmlPage[] = | 36 static const char kMainWebrtcTestHtmlPage[] = |
33 "/webrtc/webrtc_jsep01_test.html"; | 37 "/webrtc/webrtc_jsep01_test.html"; |
34 | 38 |
35 std::string MakePerfTestLabel(std::string base, bool opus_dtx) { | 39 std::string MakePerfTestLabel(std::string base, bool opus_dtx) { |
36 if (opus_dtx) { | 40 if (opus_dtx) { |
37 return base + "_with_opus_dtx"; | 41 return base + "_with_opus_dtx"; |
38 } | 42 } |
39 return base; | 43 return base; |
40 } | 44 } |
41 | 45 |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 HangUp(left_tab); | 223 HangUp(left_tab); |
220 HangUp(right_tab); | 224 HangUp(right_tab); |
221 } | 225 } |
222 }; | 226 }; |
223 | 227 |
224 // This is manual for its long execution time. | 228 // This is manual for its long execution time. |
225 | 229 |
226 IN_PROC_BROWSER_TEST_F( | 230 IN_PROC_BROWSER_TEST_F( |
227 WebRtcInternalsPerfBrowserTest, | 231 WebRtcInternalsPerfBrowserTest, |
228 MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetricsVp8) { | 232 MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetricsVp8) { |
| 233 // crbug.com/684680 |
| 234 #if defined(OS_MACOSX) |
| 235 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 236 #endif // defined(OS_MACOSX) |
229 RunsAudioVideoCall60SecsAndLogsInternalMetrics("VP8"); | 237 RunsAudioVideoCall60SecsAndLogsInternalMetrics("VP8"); |
230 } | 238 } |
231 | 239 |
232 IN_PROC_BROWSER_TEST_F( | 240 IN_PROC_BROWSER_TEST_F( |
233 WebRtcInternalsPerfBrowserTest, | 241 WebRtcInternalsPerfBrowserTest, |
234 MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetricsVp9) { | 242 MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetricsVp9) { |
| 243 // crbug.com/684680 |
| 244 #if defined(OS_MACOSX) |
| 245 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 246 #endif // defined(OS_MACOSX) |
235 RunsAudioVideoCall60SecsAndLogsInternalMetrics("VP9"); | 247 RunsAudioVideoCall60SecsAndLogsInternalMetrics("VP9"); |
236 } | 248 } |
237 | 249 |
238 #if BUILDFLAG(RTC_USE_H264) | 250 #if BUILDFLAG(RTC_USE_H264) |
239 | 251 |
240 // Flaky on Windows, crbug.com/703579. | 252 // Flaky on Windows, crbug.com/703579. |
241 #if defined(OS_WIN) | 253 #if defined(OS_WIN) |
242 #define MAYBE_MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetricsH264 \ | 254 #define MAYBE_MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetricsH264 \ |
243 DISABLED_MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetricsH264 | 255 DISABLED_MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetricsH264 |
244 #else | 256 #else |
245 #define MAYBE_MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetricsH264 \ | 257 #define MAYBE_MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetricsH264 \ |
246 MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetricsH264 | 258 MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetricsH264 |
247 #endif | 259 #endif |
248 IN_PROC_BROWSER_TEST_F( | 260 IN_PROC_BROWSER_TEST_F( |
249 WebRtcInternalsPerfBrowserTest, | 261 WebRtcInternalsPerfBrowserTest, |
250 MAYBE_MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetricsH264) { | 262 MAYBE_MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetricsH264) { |
| 263 // crbug.com/684680 |
| 264 #if defined(OS_MACOSX) |
| 265 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 266 #endif // defined(OS_MACOSX) |
251 // Only run test if run-time feature corresponding to |rtc_use_h264| is on. | 267 // Only run test if run-time feature corresponding to |rtc_use_h264| is on. |
252 if (!base::FeatureList::IsEnabled(content::kWebRtcH264WithOpenH264FFmpeg)) { | 268 if (!base::FeatureList::IsEnabled(content::kWebRtcH264WithOpenH264FFmpeg)) { |
253 LOG(WARNING) << "Run-time feature WebRTC-H264WithOpenH264FFmpeg disabled. " | 269 LOG(WARNING) << "Run-time feature WebRTC-H264WithOpenH264FFmpeg disabled. " |
254 "Skipping WebRtcInternalsPerfBrowserTest." | 270 "Skipping WebRtcInternalsPerfBrowserTest." |
255 "MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetricsH264 (test " | 271 "MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetricsH264 (test " |
256 "\"OK\")"; | 272 "\"OK\")"; |
257 return; | 273 return; |
258 } | 274 } |
259 RunsAudioVideoCall60SecsAndLogsInternalMetrics("H264"); | 275 RunsAudioVideoCall60SecsAndLogsInternalMetrics("H264"); |
260 } | 276 } |
261 | 277 |
262 #endif // BUILDFLAG(RTC_USE_H264) | 278 #endif // BUILDFLAG(RTC_USE_H264) |
263 | 279 |
264 IN_PROC_BROWSER_TEST_F( | 280 IN_PROC_BROWSER_TEST_F( |
265 WebRtcInternalsPerfBrowserTest, | 281 WebRtcInternalsPerfBrowserTest, |
266 MANUAL_RunsOneWayCall60SecsAndLogsInternalMetricsDefault) { | 282 MANUAL_RunsOneWayCall60SecsAndLogsInternalMetricsDefault) { |
| 283 // crbug.com/684680 |
| 284 #if defined(OS_MACOSX) |
| 285 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 286 #endif // defined(OS_MACOSX) |
267 RunsOneWayCall60SecsAndLogsInternalMetrics("", false); | 287 RunsOneWayCall60SecsAndLogsInternalMetrics("", false); |
268 } | 288 } |
269 | 289 |
270 IN_PROC_BROWSER_TEST_F( | 290 IN_PROC_BROWSER_TEST_F( |
271 WebRtcInternalsPerfBrowserTest, | 291 WebRtcInternalsPerfBrowserTest, |
272 MANUAL_RunsOneWayCall60SecsAndLogsInternalMetricsWithOpusDtx) { | 292 MANUAL_RunsOneWayCall60SecsAndLogsInternalMetricsWithOpusDtx) { |
| 293 // crbug.com/684680 |
| 294 #if defined(OS_MACOSX) |
| 295 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 296 #endif // defined(OS_MACOSX) |
273 RunsOneWayCall60SecsAndLogsInternalMetrics("", true); | 297 RunsOneWayCall60SecsAndLogsInternalMetrics("", true); |
274 } | 298 } |
OLD | NEW |