| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "base/command_line.h" | |
| 6 #include "base/files/file_path.h" | |
| 7 #include "base/path_service.h" | |
| 8 #include "build/build_config.h" | |
| 9 #include "chrome/browser/media/webrtc_browsertest_base.h" | |
| 10 #include "chrome/browser/media/webrtc_browsertest_common.h" | |
| 11 #include "chrome/browser/ui/browser.h" | |
| 12 #include "chrome/browser/ui/browser_tabstrip.h" | |
| 13 #include "chrome/browser/ui/tabs/tab_strip_model.h" | |
| 14 #include "chrome/common/chrome_switches.h" | |
| 15 #include "chrome/test/base/in_process_browser_test.h" | |
| 16 #include "chrome/test/base/ui_test_utils.h" | |
| 17 #include "content/public/browser/notification_service.h" | |
| 18 #include "content/public/browser/render_process_host.h" | |
| 19 #include "content/public/common/content_switches.h" | |
| 20 #include "content/public/test/browser_test_utils.h" | |
| 21 #include "media/base/media_switches.h" | |
| 22 #include "net/test/embedded_test_server/embedded_test_server.h" | |
| 23 #include "testing/perf/perf_test.h" | |
| 24 #include "ui/gl/gl_switches.h" | |
| 25 | |
| 26 static const char kSimulcastTestPage[] = "/webrtc/webrtc-simulcast.html"; | |
| 27 | |
| 28 // Simulcast integration test. This test ensures 'a=x-google-flag:conference' | |
| 29 // is working and that Chrome is capable of sending simulcast streams. | |
| 30 class WebRtcSimulcastBrowserTest : public WebRtcTestBase { | |
| 31 public: | |
| 32 // TODO(phoglund): Make it possible to enable DetectErrorsInJavaScript() here. | |
| 33 | |
| 34 void SetUpCommandLine(base::CommandLine* command_line) override { | |
| 35 // Just answer 'allow' to GetUserMedia invocations. | |
| 36 command_line->AppendSwitch(switches::kUseFakeUIForMediaStream); | |
| 37 | |
| 38 // The video playback will not work without a GPU, so force its use here. | |
| 39 command_line->AppendSwitch(switches::kUseGpuInTests); | |
| 40 | |
| 41 // Use fake devices in order to run on VMs. | |
| 42 command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream); | |
| 43 } | |
| 44 }; | |
| 45 | |
| 46 // Fails/times out on Windows and Chrome OS. Flaky on Linux. | |
| 47 // http://crbug.com/452623 | |
| 48 // MSan reports errors. http://crbug.com/452892 | |
| 49 #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(MEMO
RY_SANITIZER) | |
| 50 #define MAYBE_TestVgaReturnsTwoSimulcastStreams DISABLED_TestVgaReturnsTwoSimulc
astStreams | |
| 51 #else | |
| 52 #define MAYBE_TestVgaReturnsTwoSimulcastStreams TestVgaReturnsTwoSimulcastStream
s | |
| 53 #endif | |
| 54 IN_PROC_BROWSER_TEST_F(WebRtcSimulcastBrowserTest, | |
| 55 MAYBE_TestVgaReturnsTwoSimulcastStreams) { | |
| 56 ASSERT_TRUE(embedded_test_server()->Start()); | |
| 57 | |
| 58 ui_test_utils::NavigateToURL( | |
| 59 browser(), embedded_test_server()->GetURL(kSimulcastTestPage)); | |
| 60 | |
| 61 content::WebContents* tab_contents = | |
| 62 browser()->tab_strip_model()->GetActiveWebContents(); | |
| 63 | |
| 64 ASSERT_EQ("OK", ExecuteJavascript("testVgaReturnsTwoSimulcastStreams()", | |
| 65 tab_contents)); | |
| 66 } | |
| OLD | NEW |