Prevent chrome://net-internals/#export from flickering
[chromium-blink-merge.git] / chrome / browser / media / chrome_webrtc_simulcast_browsertest.cc
blob80d13e90ff4f412d369503a047b5bdcbe5191f69
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.
5 #include "base/command_line.h"
6 #include "base/files/file_path.h"
7 #include "base/path_service.h"
8 #include "chrome/browser/media/webrtc_browsertest_base.h"
9 #include "chrome/browser/media/webrtc_browsertest_common.h"
10 #include "chrome/browser/ui/browser.h"
11 #include "chrome/browser/ui/browser_tabstrip.h"
12 #include "chrome/browser/ui/tabs/tab_strip_model.h"
13 #include "chrome/common/chrome_switches.h"
14 #include "chrome/test/base/in_process_browser_test.h"
15 #include "chrome/test/base/ui_test_utils.h"
16 #include "content/public/browser/notification_service.h"
17 #include "content/public/browser/render_process_host.h"
18 #include "content/public/test/browser_test_utils.h"
19 #include "media/base/media_switches.h"
20 #include "net/test/embedded_test_server/embedded_test_server.h"
21 #include "testing/perf/perf_test.h"
22 #include "ui/gl/gl_switches.h"
24 static const char kSimulcastTestPage[] = "/webrtc/webrtc-simulcast.html";
26 // Simulcast integration test. This test ensures 'a=x-google-flag:conference'
27 // is working and that Chrome is capable of sending simulcast streams.
28 class WebRtcSimulcastBrowserTest : public WebRtcTestBase {
29 public:
30 // TODO(phoglund): Make it possible to enable DetectErrorsInJavaScript() here.
32 void SetUpCommandLine(base::CommandLine* command_line) override {
33 // Just answer 'allow' to GetUserMedia invocations.
34 command_line->AppendSwitch(switches::kUseFakeUIForMediaStream);
36 // The video playback will not work without a GPU, so force its use here.
37 command_line->AppendSwitch(switches::kUseGpuInTests);
39 // Use fake devices in order to run on VMs.
40 command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream);
44 // Fails/times out on Windows and Chrome OS. http://crbug.com/452623
45 // MSan reports errors. http://crbug.com/452892
46 #if defined(OS_WIN) || defined(OS_CHROMEOS) || defined(MEMORY_SANITIZER)
47 #define MAYBE_TestVgaReturnsTwoSimulcastStreams DISABLED_TestVgaReturnsTwoSimulcastStreams
48 #else
49 #define MAYBE_TestVgaReturnsTwoSimulcastStreams TestVgaReturnsTwoSimulcastStreams
50 #endif
51 IN_PROC_BROWSER_TEST_F(WebRtcSimulcastBrowserTest,
52 MAYBE_TestVgaReturnsTwoSimulcastStreams) {
53 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
55 ui_test_utils::NavigateToURL(
56 browser(), embedded_test_server()->GetURL(kSimulcastTestPage));
58 content::WebContents* tab_contents =
59 browser()->tab_strip_model()->GetActiveWebContents();
61 ASSERT_EQ("OK", ExecuteJavascript("testVgaReturnsTwoSimulcastStreams()",
62 tab_contents));