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