| 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 "chrome/browser/media/webrtc_browsertest_base.h" | 7 #include "chrome/browser/media/webrtc_browsertest_base.h" |
| 8 #include "chrome/browser/media/webrtc_browsertest_common.h" | 8 #include "chrome/browser/media/webrtc_browsertest_common.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/browser_tabstrip.h" | 10 #include "chrome/browser/ui/browser_tabstrip.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 // Top-level integration test for WebRTC. It always uses fake devices; see | 22 // Top-level integration test for WebRTC. It always uses fake devices; see |
| 23 // WebRtcWebcamBrowserTest for a test that acquires any real webcam on the | 23 // WebRtcWebcamBrowserTest for a test that acquires any real webcam on the |
| 24 // system. | 24 // system. |
| 25 class WebRtcBrowserTest : public WebRtcTestBase { | 25 class WebRtcBrowserTest : public WebRtcTestBase { |
| 26 public: | 26 public: |
| 27 void SetUpInProcessBrowserTestFixture() override { | 27 void SetUpInProcessBrowserTestFixture() override { |
| 28 DetectErrorsInJavaScript(); // Look for errors in our rather complex js. | 28 DetectErrorsInJavaScript(); // Look for errors in our rather complex js. |
| 29 } | 29 } |
| 30 | 30 |
| 31 void SetUpCommandLine(CommandLine* command_line) override { | 31 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 32 // Ensure the infobar is enabled, since we expect that in this test. | 32 // Ensure the infobar is enabled, since we expect that in this test. |
| 33 EXPECT_FALSE(command_line->HasSwitch(switches::kUseFakeUIForMediaStream)); | 33 EXPECT_FALSE(command_line->HasSwitch(switches::kUseFakeUIForMediaStream)); |
| 34 | 34 |
| 35 // Always use fake devices. | 35 // Always use fake devices. |
| 36 command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream); | 36 command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream); |
| 37 | 37 |
| 38 // Flag used by TestWebAudioMediaStream to force garbage collection. | 38 // Flag used by TestWebAudioMediaStream to force garbage collection. |
| 39 command_line->AppendSwitchASCII(switches::kJavaScriptFlags, "--expose-gc"); | 39 command_line->AppendSwitchASCII(switches::kJavaScriptFlags, "--expose-gc"); |
| 40 } | 40 } |
| 41 }; | 41 }; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 GURL url(embedded_test_server()->GetURL("/webrtc/webaudio_crash.html")); | 83 GURL url(embedded_test_server()->GetURL("/webrtc/webaudio_crash.html")); |
| 84 ui_test_utils::NavigateToURL(browser(), url); | 84 ui_test_utils::NavigateToURL(browser(), url); |
| 85 content::WebContents* tab = | 85 content::WebContents* tab = |
| 86 browser()->tab_strip_model()->GetActiveWebContents(); | 86 browser()->tab_strip_model()->GetActiveWebContents(); |
| 87 | 87 |
| 88 // A sleep is necessary to be able to detect the crash. | 88 // A sleep is necessary to be able to detect the crash. |
| 89 test::SleepInJavascript(tab, 1000); | 89 test::SleepInJavascript(tab, 1000); |
| 90 | 90 |
| 91 ASSERT_FALSE(tab->IsCrashed()); | 91 ASSERT_FALSE(tab->IsCrashed()); |
| 92 } | 92 } |
| OLD | NEW |