| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/test/test_timeouts.h" | 8 #include "base/test/test_timeouts.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "chrome/browser/media/webrtc/test_stats_dictionary.h" | 10 #include "chrome/browser/media/webrtc/test_stats_dictionary.h" |
| 11 #include "chrome/browser/media/webrtc/webrtc_browsertest_base.h" | 11 #include "chrome/browser/media/webrtc/webrtc_browsertest_base.h" |
| 12 #include "chrome/browser/media/webrtc/webrtc_browsertest_common.h" | 12 #include "chrome/browser/media/webrtc/webrtc_browsertest_common.h" |
| 13 #include "content/public/common/content_switches.h" | 13 #include "content/public/common/content_switches.h" |
| 14 #include "content/public/common/feature_h264_with_openh264_ffmpeg.h" | 14 #include "content/public/common/feature_h264_with_openh264_ffmpeg.h" |
| 15 #include "media/base/media_switches.h" | 15 #include "media/base/media_switches.h" |
| 16 #include "testing/perf/perf_test.h" | 16 #include "testing/perf/perf_test.h" |
| 17 | 17 |
| 18 #if defined(OS_MACOSX) |
| 19 #include "base/threading/thread_restrictions.h" |
| 20 #endif // defined(OS_MACOSX) |
| 21 |
| 18 namespace content { | 22 namespace content { |
| 19 | 23 |
| 20 namespace { | 24 namespace { |
| 21 | 25 |
| 22 const char kMainWebrtcTestHtmlPage[] = "/webrtc/webrtc_jsep01_test.html"; | 26 const char kMainWebrtcTestHtmlPage[] = "/webrtc/webrtc_jsep01_test.html"; |
| 23 | 27 |
| 24 const char kInboundRtp[] = "inbound-rtp"; | 28 const char kInboundRtp[] = "inbound-rtp"; |
| 25 const char kOutboundRtp[] = "outbound-rtp"; | 29 const char kOutboundRtp[] = "outbound-rtp"; |
| 26 | 30 |
| 27 enum class GetStatsVariation { | 31 enum class GetStatsVariation { |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 } | 229 } |
| 226 | 230 |
| 227 private: | 231 private: |
| 228 content::WebContents* left_tab_ = nullptr; | 232 content::WebContents* left_tab_ = nullptr; |
| 229 content::WebContents* right_tab_ = nullptr; | 233 content::WebContents* right_tab_ = nullptr; |
| 230 }; | 234 }; |
| 231 | 235 |
| 232 IN_PROC_BROWSER_TEST_F( | 236 IN_PROC_BROWSER_TEST_F( |
| 233 WebRtcStatsPerfBrowserTest, | 237 WebRtcStatsPerfBrowserTest, |
| 234 MANUAL_RunsAudioAndVideoCallCollectingMetrics_AudioCodec_opus) { | 238 MANUAL_RunsAudioAndVideoCallCollectingMetrics_AudioCodec_opus) { |
| 239 // crbug.com/684680 |
| 240 #if defined(OS_MACOSX) |
| 241 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 242 #endif // defined(OS_MACOSX) |
| 235 RunsAudioAndVideoCallCollectingMetrics("opus", kUseDefaultVideoCodec); | 243 RunsAudioAndVideoCallCollectingMetrics("opus", kUseDefaultVideoCodec); |
| 236 } | 244 } |
| 237 | 245 |
| 238 IN_PROC_BROWSER_TEST_F( | 246 IN_PROC_BROWSER_TEST_F( |
| 239 WebRtcStatsPerfBrowserTest, | 247 WebRtcStatsPerfBrowserTest, |
| 240 MANUAL_RunsAudioAndVideoCallCollectingMetrics_AudioCodec_ISAC) { | 248 MANUAL_RunsAudioAndVideoCallCollectingMetrics_AudioCodec_ISAC) { |
| 249 // crbug.com/684680 |
| 250 #if defined(OS_MACOSX) |
| 251 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 252 #endif // defined(OS_MACOSX) |
| 241 RunsAudioAndVideoCallCollectingMetrics("ISAC", kUseDefaultVideoCodec); | 253 RunsAudioAndVideoCallCollectingMetrics("ISAC", kUseDefaultVideoCodec); |
| 242 } | 254 } |
| 243 | 255 |
| 244 IN_PROC_BROWSER_TEST_F( | 256 IN_PROC_BROWSER_TEST_F( |
| 245 WebRtcStatsPerfBrowserTest, | 257 WebRtcStatsPerfBrowserTest, |
| 246 MANUAL_RunsAudioAndVideoCallCollectingMetrics_AudioCodec_G722) { | 258 MANUAL_RunsAudioAndVideoCallCollectingMetrics_AudioCodec_G722) { |
| 259 // crbug.com/684680 |
| 260 #if defined(OS_MACOSX) |
| 261 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 262 #endif // defined(OS_MACOSX) |
| 247 RunsAudioAndVideoCallCollectingMetrics("G722", kUseDefaultVideoCodec); | 263 RunsAudioAndVideoCallCollectingMetrics("G722", kUseDefaultVideoCodec); |
| 248 } | 264 } |
| 249 | 265 |
| 250 IN_PROC_BROWSER_TEST_F( | 266 IN_PROC_BROWSER_TEST_F( |
| 251 WebRtcStatsPerfBrowserTest, | 267 WebRtcStatsPerfBrowserTest, |
| 252 MANUAL_RunsAudioAndVideoCallCollectingMetrics_AudioCodec_PCMU) { | 268 MANUAL_RunsAudioAndVideoCallCollectingMetrics_AudioCodec_PCMU) { |
| 269 // crbug.com/684680 |
| 270 #if defined(OS_MACOSX) |
| 271 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 272 #endif // defined(OS_MACOSX) |
| 253 RunsAudioAndVideoCallCollectingMetrics("PCMU", kUseDefaultVideoCodec); | 273 RunsAudioAndVideoCallCollectingMetrics("PCMU", kUseDefaultVideoCodec); |
| 254 } | 274 } |
| 255 | 275 |
| 256 IN_PROC_BROWSER_TEST_F( | 276 IN_PROC_BROWSER_TEST_F( |
| 257 WebRtcStatsPerfBrowserTest, | 277 WebRtcStatsPerfBrowserTest, |
| 258 MANUAL_RunsAudioAndVideoCallCollectingMetrics_AudioCodec_PCMA) { | 278 MANUAL_RunsAudioAndVideoCallCollectingMetrics_AudioCodec_PCMA) { |
| 279 // crbug.com/684680 |
| 280 #if defined(OS_MACOSX) |
| 281 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 282 #endif // defined(OS_MACOSX) |
| 259 RunsAudioAndVideoCallCollectingMetrics("PCMA", kUseDefaultVideoCodec); | 283 RunsAudioAndVideoCallCollectingMetrics("PCMA", kUseDefaultVideoCodec); |
| 260 } | 284 } |
| 261 | 285 |
| 262 IN_PROC_BROWSER_TEST_F( | 286 IN_PROC_BROWSER_TEST_F( |
| 263 WebRtcStatsPerfBrowserTest, | 287 WebRtcStatsPerfBrowserTest, |
| 264 MANUAL_RunsAudioAndVideoCallCollectingMetrics_VideoCodec_VP8) { | 288 MANUAL_RunsAudioAndVideoCallCollectingMetrics_VideoCodec_VP8) { |
| 289 // crbug.com/684680 |
| 290 #if defined(OS_MACOSX) |
| 291 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 292 #endif // defined(OS_MACOSX) |
| 265 RunsAudioAndVideoCallCollectingMetrics(kUseDefaultAudioCodec, "VP8"); | 293 RunsAudioAndVideoCallCollectingMetrics(kUseDefaultAudioCodec, "VP8"); |
| 266 } | 294 } |
| 267 | 295 |
| 268 IN_PROC_BROWSER_TEST_F( | 296 IN_PROC_BROWSER_TEST_F( |
| 269 WebRtcStatsPerfBrowserTest, | 297 WebRtcStatsPerfBrowserTest, |
| 270 MANUAL_RunsAudioAndVideoCallCollectingMetrics_VideoCodec_VP9) { | 298 MANUAL_RunsAudioAndVideoCallCollectingMetrics_VideoCodec_VP9) { |
| 299 // crbug.com/684680 |
| 300 #if defined(OS_MACOSX) |
| 301 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 302 #endif // defined(OS_MACOSX) |
| 271 RunsAudioAndVideoCallCollectingMetrics(kUseDefaultAudioCodec, "VP9"); | 303 RunsAudioAndVideoCallCollectingMetrics(kUseDefaultAudioCodec, "VP9"); |
| 272 } | 304 } |
| 273 | 305 |
| 274 #if BUILDFLAG(RTC_USE_H264) | 306 #if BUILDFLAG(RTC_USE_H264) |
| 275 | 307 |
| 276 IN_PROC_BROWSER_TEST_F( | 308 IN_PROC_BROWSER_TEST_F( |
| 277 WebRtcStatsPerfBrowserTest, | 309 WebRtcStatsPerfBrowserTest, |
| 278 MANUAL_RunsAudioAndVideoCallCollectingMetrics_VideoCodec_H264) { | 310 MANUAL_RunsAudioAndVideoCallCollectingMetrics_VideoCodec_H264) { |
| 311 // crbug.com/684680 |
| 312 #if defined(OS_MACOSX) |
| 313 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 314 #endif // defined(OS_MACOSX) |
| 279 // Only run test if run-time feature corresponding to |rtc_use_h264| is on. | 315 // Only run test if run-time feature corresponding to |rtc_use_h264| is on. |
| 280 if (!base::FeatureList::IsEnabled(content::kWebRtcH264WithOpenH264FFmpeg)) { | 316 if (!base::FeatureList::IsEnabled(content::kWebRtcH264WithOpenH264FFmpeg)) { |
| 281 LOG(WARNING) << "Run-time feature WebRTC-H264WithOpenH264FFmpeg disabled. " | 317 LOG(WARNING) << "Run-time feature WebRTC-H264WithOpenH264FFmpeg disabled. " |
| 282 "Skipping WebRtcPerfBrowserTest." | 318 "Skipping WebRtcPerfBrowserTest." |
| 283 "MANUAL_RunsAudioAndVideoCallCollectingMetrics_VideoCodec_H264 (test " | 319 "MANUAL_RunsAudioAndVideoCallCollectingMetrics_VideoCodec_H264 (test " |
| 284 "\"OK\")"; | 320 "\"OK\")"; |
| 285 return; | 321 return; |
| 286 } | 322 } |
| 287 RunsAudioAndVideoCallCollectingMetrics(kUseDefaultAudioCodec, "H264"); | 323 RunsAudioAndVideoCallCollectingMetrics(kUseDefaultAudioCodec, "H264"); |
| 288 } | 324 } |
| 289 | 325 |
| 290 #endif // BUILDFLAG(RTC_USE_H264) | 326 #endif // BUILDFLAG(RTC_USE_H264) |
| 291 | 327 |
| 292 IN_PROC_BROWSER_TEST_F( | 328 IN_PROC_BROWSER_TEST_F( |
| 293 WebRtcStatsPerfBrowserTest, | 329 WebRtcStatsPerfBrowserTest, |
| 294 MANUAL_RunsAudioAndVideoCallMeasuringGetStatsPerformance_Promise) { | 330 MANUAL_RunsAudioAndVideoCallMeasuringGetStatsPerformance_Promise) { |
| 331 // crbug.com/684680 |
| 332 #if defined(OS_MACOSX) |
| 333 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 334 #endif // defined(OS_MACOSX) |
| 295 RunsAudioAndVideoCallMeasuringGetStatsPerformance( | 335 RunsAudioAndVideoCallMeasuringGetStatsPerformance( |
| 296 GetStatsVariation::PROMISE_BASED); | 336 GetStatsVariation::PROMISE_BASED); |
| 297 } | 337 } |
| 298 | 338 |
| 299 IN_PROC_BROWSER_TEST_F( | 339 IN_PROC_BROWSER_TEST_F( |
| 300 WebRtcStatsPerfBrowserTest, | 340 WebRtcStatsPerfBrowserTest, |
| 301 MANUAL_RunsAudioAndVideoCallMeasuringGetStatsPerformance_Callback) { | 341 MANUAL_RunsAudioAndVideoCallMeasuringGetStatsPerformance_Callback) { |
| 342 // crbug.com/684680 |
| 343 #if defined(OS_MACOSX) |
| 344 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 345 #endif // defined(OS_MACOSX) |
| 302 RunsAudioAndVideoCallMeasuringGetStatsPerformance( | 346 RunsAudioAndVideoCallMeasuringGetStatsPerformance( |
| 303 GetStatsVariation::CALLBACK_BASED); | 347 GetStatsVariation::CALLBACK_BASED); |
| 304 } | 348 } |
| 305 | 349 |
| 306 } // namespace | 350 } // namespace |
| 307 | 351 |
| 308 } // namespace content | 352 } // namespace content |
| OLD | NEW |