| 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 #if defined(OS_WIN) | 20 #if defined(OS_WIN) |
| 21 #include "base/win/windows_version.h" | 21 #include "base/win/windows_version.h" |
| 22 #endif | 22 #endif |
| 23 | 23 |
| 24 namespace content { | 24 namespace content { |
| 25 | 25 |
| 26 void WebRtcContentBrowserTest::SetUpCommandLine(CommandLine* command_line) { | 26 void WebRtcContentBrowserTest::SetUpCommandLine(CommandLine* command_line) { |
| 27 // We need fake devices in this test since we want to run on naked VMs. We | 27 // Assume this is set by the content test launcher. |
| 28 // assume these switches are set by default in content_browsertests. | 28 ASSERT_TRUE(CommandLine::ForCurrentProcess()->HasSwitch( |
| 29 switches::kUseFakeUIForMediaStream)); |
| 29 ASSERT_TRUE(CommandLine::ForCurrentProcess()->HasSwitch( | 30 ASSERT_TRUE(CommandLine::ForCurrentProcess()->HasSwitch( |
| 30 switches::kUseFakeDeviceForMediaStream)); | 31 switches::kUseFakeDeviceForMediaStream)); |
| 31 ASSERT_TRUE(CommandLine::ForCurrentProcess()->HasSwitch( | |
| 32 switches::kUseFakeUIForMediaStream)); | |
| 33 | 32 |
| 34 // Always include loopback interface in network list, in case the test device | 33 // Always include loopback interface in network list, in case the test device |
| 35 // doesn't have other interfaces available. | 34 // doesn't have other interfaces available. |
| 36 CommandLine::ForCurrentProcess()->AppendSwitch( | 35 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 37 switches::kAllowLoopbackInPeerConnection); | 36 switches::kAllowLoopbackInPeerConnection); |
| 38 } | 37 } |
| 39 | 38 |
| 40 void WebRtcContentBrowserTest::SetUp() { | 39 void WebRtcContentBrowserTest::SetUp() { |
| 40 // We need pixel output when we dig pixels out of video tags for verification. |
| 41 EnablePixelOutput(); | 41 EnablePixelOutput(); |
| 42 #if defined(OS_CHROMEOS) | 42 #if defined(OS_CHROMEOS) |
| 43 chromeos::CrasAudioHandler::InitializeForTesting(); | 43 chromeos::CrasAudioHandler::InitializeForTesting(); |
| 44 #endif | 44 #endif |
| 45 ContentBrowserTest::SetUp(); | 45 ContentBrowserTest::SetUp(); |
| 46 } | 46 } |
| 47 | 47 |
| 48 void WebRtcContentBrowserTest::TearDown() { | 48 void WebRtcContentBrowserTest::TearDown() { |
| 49 ContentBrowserTest::TearDown(); | 49 ContentBrowserTest::TearDown(); |
| 50 #if defined(OS_CHROMEOS) | 50 #if defined(OS_CHROMEOS) |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 103 |
| 104 bool WebRtcContentBrowserTest::OnWinXp() const { | 104 bool WebRtcContentBrowserTest::OnWinXp() const { |
| 105 #if defined(OS_WIN) | 105 #if defined(OS_WIN) |
| 106 return base::win::GetVersion() <= base::win::VERSION_XP; | 106 return base::win::GetVersion() <= base::win::VERSION_XP; |
| 107 #else | 107 #else |
| 108 return false; | 108 return false; |
| 109 #endif | 109 #endif |
| 110 } | 110 } |
| 111 | 111 |
| 112 } // namespace content | 112 } // namespace content |
| OLD | NEW |