OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/strings/stringprintf.h" | 6 #include "base/strings/stringprintf.h" |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "chrome/browser/media/webrtc_browsertest_base.h" | 8 #include "chrome/browser/media/webrtc_browsertest_base.h" |
9 #include "chrome/browser/media/webrtc_browsertest_common.h" | 9 #include "chrome/browser/media/webrtc_browsertest_common.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
11 #include "chrome/browser/ui/browser_tabstrip.h" | 11 #include "chrome/browser/ui/browser_tabstrip.h" |
12 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 12 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
13 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
14 #include "chrome/test/base/in_process_browser_test.h" | 14 #include "chrome/test/base/in_process_browser_test.h" |
15 #include "chrome/test/base/ui_test_utils.h" | 15 #include "chrome/test/base/ui_test_utils.h" |
16 #include "content/public/common/content_switches.h" | 16 #include "content/public/common/content_switches.h" |
| 17 #include "content/public/common/feature_h264_with_openh264_ffmpeg.h" |
17 #include "content/public/test/browser_test_utils.h" | 18 #include "content/public/test/browser_test_utils.h" |
18 #include "media/base/media_switches.h" | 19 #include "media/base/media_switches.h" |
19 #include "net/test/embedded_test_server/embedded_test_server.h" | 20 #include "net/test/embedded_test_server/embedded_test_server.h" |
20 | 21 |
21 static const char kMainWebrtcTestHtmlPage[] = | 22 static const char kMainWebrtcTestHtmlPage[] = |
22 "/webrtc/webrtc_jsep01_test.html"; | 23 "/webrtc/webrtc_jsep01_test.html"; |
23 | 24 |
24 // Top-level integration test for WebRTC. It always uses fake devices; see | 25 // Top-level integration test for WebRTC. It always uses fake devices; see |
25 // WebRtcWebcamBrowserTest for a test that acquires any real webcam on the | 26 // WebRtcWebcamBrowserTest for a test that acquires any real webcam on the |
26 // system. | 27 // system. |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, | 74 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, |
74 RunsAudioVideoWebRTCCallInTwoTabsVP8) { | 75 RunsAudioVideoWebRTCCallInTwoTabsVP8) { |
75 RunsAudioVideoWebRTCCallInTwoTabs("VP8"); | 76 RunsAudioVideoWebRTCCallInTwoTabs("VP8"); |
76 } | 77 } |
77 | 78 |
78 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, | 79 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, |
79 RunsAudioVideoWebRTCCallInTwoTabsVP9) { | 80 RunsAudioVideoWebRTCCallInTwoTabsVP9) { |
80 RunsAudioVideoWebRTCCallInTwoTabs("VP9"); | 81 RunsAudioVideoWebRTCCallInTwoTabs("VP9"); |
81 } | 82 } |
82 | 83 |
| 84 #if defined(BUILDFLAG_RTC_USE_H264) |
| 85 |
| 86 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, |
| 87 RunsAudioVideoWebRTCCallInTwoTabsH264) { |
| 88 // Only run test if run-time feature corresponding to |rtc_use_h264| is on. |
| 89 if (!base::FeatureList::IsEnabled(content::kWebRtcH264WithOpenH264FFmpeg)) { |
| 90 LOG(WARNING) << "Run-time feature WebRtcH264WithOpenH264FFmpeg disabled. " |
| 91 "Skipping WebRtcBrowserTest.RunsAudioVideoWebRTCCallInTwoTabsH264 " |
| 92 "(test \"OK\")"; |
| 93 return; |
| 94 } |
| 95 RunsAudioVideoWebRTCCallInTwoTabs("H264"); |
| 96 } |
| 97 |
| 98 #endif // defined(BUILDFLAG_RTC_USE_H264) |
| 99 |
83 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, TestWebAudioMediaStream) { | 100 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, TestWebAudioMediaStream) { |
84 // This tests against crash regressions for the WebAudio-MediaStream | 101 // This tests against crash regressions for the WebAudio-MediaStream |
85 // integration. | 102 // integration. |
86 if (OnWinXp()) return; | 103 if (OnWinXp()) return; |
87 | 104 |
88 ASSERT_TRUE(embedded_test_server()->Start()); | 105 ASSERT_TRUE(embedded_test_server()->Start()); |
89 GURL url(embedded_test_server()->GetURL("/webrtc/webaudio_crash.html")); | 106 GURL url(embedded_test_server()->GetURL("/webrtc/webaudio_crash.html")); |
90 ui_test_utils::NavigateToURL(browser(), url); | 107 ui_test_utils::NavigateToURL(browser(), url); |
91 content::WebContents* tab = | 108 content::WebContents* tab = |
92 browser()->tab_strip_model()->GetActiveWebContents(); | 109 browser()->tab_strip_model()->GetActiveWebContents(); |
93 | 110 |
94 // A sleep is necessary to be able to detect the crash. | 111 // A sleep is necessary to be able to detect the crash. |
95 test::SleepInJavascript(tab, 1000); | 112 test::SleepInJavascript(tab, 1000); |
96 | 113 |
97 ASSERT_FALSE(tab->IsCrashed()); | 114 ASSERT_FALSE(tab->IsCrashed()); |
98 } | 115 } |
OLD | NEW |