| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/test/webrtc_content_browsertest_base.h" | 5 #include "content/test/webrtc_content_browsertest_base.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "content/public/common/content_switches.h" | 10 #include "content/public/common/content_switches.h" |
| 11 #include "content/public/test/browser_test_utils.h" | 11 #include "content/public/test/browser_test_utils.h" |
| 12 #include "content/public/test/content_browser_test_utils.h" | 12 #include "content/public/test/content_browser_test_utils.h" |
| 13 #include "content/shell/browser/shell.h" | 13 #include "content/shell/browser/shell.h" |
| 14 #include "media/base/media_switches.h" | 14 #include "media/base/media_switches.h" |
| 15 | 15 |
| 16 #if defined(OS_CHROMEOS) | 16 #if defined(OS_CHROMEOS) |
| 17 #include "chromeos/audio/cras_audio_handler.h" | 17 #include "chromeos/audio/cras_audio_handler.h" |
| 18 #endif | 18 #endif |
| 19 | 19 |
| 20 namespace content { | 20 namespace content { |
| 21 | 21 |
| 22 void WebRtcContentBrowserTest::SetUpCommandLine(CommandLine* command_line) { | 22 void WebRtcContentBrowserTest::SetUpCommandLine(CommandLine* command_line) { |
| 23 // We need fake devices in this test since we want to run on naked VMs. We | 23 // Assume this is set by the content test launcher. |
| 24 // assume these switches are set by default in content_browsertests. | 24 ASSERT_TRUE(CommandLine::ForCurrentProcess()->HasSwitch( |
| 25 switches::kUseFakeUIForMediaStream)); |
| 25 ASSERT_TRUE(CommandLine::ForCurrentProcess()->HasSwitch( | 26 ASSERT_TRUE(CommandLine::ForCurrentProcess()->HasSwitch( |
| 26 switches::kUseFakeDeviceForMediaStream)); | 27 switches::kUseFakeDeviceForMediaStream)); |
| 27 ASSERT_TRUE(CommandLine::ForCurrentProcess()->HasSwitch( | |
| 28 switches::kUseFakeUIForMediaStream)); | |
| 29 | 28 |
| 30 // Always include loopback interface in network list, in case the test device | 29 // Always include loopback interface in network list, in case the test device |
| 31 // doesn't have other interfaces available. | 30 // doesn't have other interfaces available. |
| 32 CommandLine::ForCurrentProcess()->AppendSwitch( | 31 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 33 switches::kAllowLoopbackInPeerConnection); | 32 switches::kAllowLoopbackInPeerConnection); |
| 34 } | 33 } |
| 35 | 34 |
| 36 void WebRtcContentBrowserTest::SetUp() { | 35 void WebRtcContentBrowserTest::SetUp() { |
| 36 // We need pixel output when we dig pixels out of video tags for verification. |
| 37 EnablePixelOutput(); | 37 EnablePixelOutput(); |
| 38 #if defined(OS_CHROMEOS) | 38 #if defined(OS_CHROMEOS) |
| 39 chromeos::CrasAudioHandler::InitializeForTesting(); | 39 chromeos::CrasAudioHandler::InitializeForTesting(); |
| 40 #endif | 40 #endif |
| 41 ContentBrowserTest::SetUp(); | 41 ContentBrowserTest::SetUp(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 void WebRtcContentBrowserTest::TearDown() { | 44 void WebRtcContentBrowserTest::TearDown() { |
| 45 ContentBrowserTest::TearDown(); | 45 ContentBrowserTest::TearDown(); |
| 46 #if defined(OS_CHROMEOS) | 46 #if defined(OS_CHROMEOS) |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 91 |
| 92 void WebRtcContentBrowserTest::DisableOpusIfOnAndroid() { | 92 void WebRtcContentBrowserTest::DisableOpusIfOnAndroid() { |
| 93 #if defined(OS_ANDROID) | 93 #if defined(OS_ANDROID) |
| 94 // Always force iSAC 16K on Android for now (Opus is broken). | 94 // Always force iSAC 16K on Android for now (Opus is broken). |
| 95 EXPECT_EQ("isac-forced", | 95 EXPECT_EQ("isac-forced", |
| 96 ExecuteJavascriptAndReturnResult("forceIsac16KInSdp();")); | 96 ExecuteJavascriptAndReturnResult("forceIsac16KInSdp();")); |
| 97 #endif | 97 #endif |
| 98 } | 98 } |
| 99 | 99 |
| 100 } // namespace content | 100 } // namespace content |
| OLD | NEW |