| 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/test/browser_test_utils.h" | 17 #include "content/public/test/browser_test_utils.h" |
| 18 #include "content/renderer/renderer_features.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. |
| 27 class WebRtcBrowserTest : public WebRtcTestBase { | 28 class WebRtcBrowserTest : public WebRtcTestBase { |
| (...skipping 45 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 BUILDFLAG(RTC_USE_H264) |
| 85 |
| 86 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, |
| 87 RunsAudioVideoWebRTCCallInTwoTabsH264) { |
| 88 RunsAudioVideoWebRTCCallInTwoTabs("H264"); |
| 89 } |
| 90 |
| 91 #endif // BUILDFLAG(RTC_USE_H264) |
| 92 |
| 83 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, TestWebAudioMediaStream) { | 93 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, TestWebAudioMediaStream) { |
| 84 // This tests against crash regressions for the WebAudio-MediaStream | 94 // This tests against crash regressions for the WebAudio-MediaStream |
| 85 // integration. | 95 // integration. |
| 86 if (OnWinXp()) return; | 96 if (OnWinXp()) return; |
| 87 | 97 |
| 88 ASSERT_TRUE(embedded_test_server()->Start()); | 98 ASSERT_TRUE(embedded_test_server()->Start()); |
| 89 GURL url(embedded_test_server()->GetURL("/webrtc/webaudio_crash.html")); | 99 GURL url(embedded_test_server()->GetURL("/webrtc/webaudio_crash.html")); |
| 90 ui_test_utils::NavigateToURL(browser(), url); | 100 ui_test_utils::NavigateToURL(browser(), url); |
| 91 content::WebContents* tab = | 101 content::WebContents* tab = |
| 92 browser()->tab_strip_model()->GetActiveWebContents(); | 102 browser()->tab_strip_model()->GetActiveWebContents(); |
| 93 | 103 |
| 94 // A sleep is necessary to be able to detect the crash. | 104 // A sleep is necessary to be able to detect the crash. |
| 95 test::SleepInJavascript(tab, 1000); | 105 test::SleepInJavascript(tab, 1000); |
| 96 | 106 |
| 97 ASSERT_FALSE(tab->IsCrashed()); | 107 ASSERT_FALSE(tab->IsCrashed()); |
| 98 } | 108 } |
| OLD | NEW |