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_MACOSX) |
| 21 #include "media/base/mac/avfoundation_glue.h" |
| 22 #endif |
| 23 |
20 #if defined(OS_WIN) | 24 #if defined(OS_WIN) |
21 #include "base/win/windows_version.h" | 25 #include "base/win/windows_version.h" |
22 #endif | 26 #endif |
23 | 27 |
24 namespace content { | 28 namespace content { |
25 | 29 |
26 void WebRtcContentBrowserTest::SetUpCommandLine( | 30 void WebRtcContentBrowserTest::SetUpCommandLine( |
27 base::CommandLine* command_line) { | 31 base::CommandLine* command_line) { |
28 // Assume this is set by the content test launcher. | 32 // Assume this is set by the content test launcher. |
29 ASSERT_TRUE(base::CommandLine::ForCurrentProcess()->HasSwitch( | 33 ASSERT_TRUE(base::CommandLine::ForCurrentProcess()->HasSwitch( |
30 switches::kUseFakeUIForMediaStream)); | 34 switches::kUseFakeUIForMediaStream)); |
31 ASSERT_TRUE(base::CommandLine::ForCurrentProcess()->HasSwitch( | 35 ASSERT_TRUE(base::CommandLine::ForCurrentProcess()->HasSwitch( |
32 switches::kUseFakeDeviceForMediaStream)); | 36 switches::kUseFakeDeviceForMediaStream)); |
33 | 37 |
34 // Always include loopback interface in network list, in case the test device | 38 // Always include loopback interface in network list, in case the test device |
35 // doesn't have other interfaces available. | 39 // doesn't have other interfaces available. |
36 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 40 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
37 switches::kAllowLoopbackInPeerConnection); | 41 switches::kAllowLoopbackInPeerConnection); |
38 } | 42 } |
39 | 43 |
40 void WebRtcContentBrowserTest::SetUp() { | 44 void WebRtcContentBrowserTest::SetUp() { |
41 // We need pixel output when we dig pixels out of video tags for verification. | 45 // We need pixel output when we dig pixels out of video tags for verification. |
42 EnablePixelOutput(); | 46 EnablePixelOutput(); |
43 #if defined(OS_CHROMEOS) | 47 #if defined(OS_CHROMEOS) |
44 chromeos::CrasAudioHandler::InitializeForTesting(); | 48 chromeos::CrasAudioHandler::InitializeForTesting(); |
| 49 #elif defined(OS_MACOSX) |
| 50 AVFoundationGlue::InitializeAVFoundation(); |
45 #endif | 51 #endif |
46 ContentBrowserTest::SetUp(); | 52 ContentBrowserTest::SetUp(); |
47 } | 53 } |
48 | 54 |
49 void WebRtcContentBrowserTest::TearDown() { | 55 void WebRtcContentBrowserTest::TearDown() { |
50 ContentBrowserTest::TearDown(); | 56 ContentBrowserTest::TearDown(); |
51 #if defined(OS_CHROMEOS) | 57 #if defined(OS_CHROMEOS) |
52 chromeos::CrasAudioHandler::Shutdown(); | 58 chromeos::CrasAudioHandler::Shutdown(); |
53 #endif | 59 #endif |
54 } | 60 } |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 105 |
100 bool WebRtcContentBrowserTest::OnWinXp() const { | 106 bool WebRtcContentBrowserTest::OnWinXp() const { |
101 #if defined(OS_WIN) | 107 #if defined(OS_WIN) |
102 return base::win::GetVersion() <= base::win::VERSION_XP; | 108 return base::win::GetVersion() <= base::win::VERSION_XP; |
103 #else | 109 #else |
104 return false; | 110 return false; |
105 #endif | 111 #endif |
106 } | 112 } |
107 | 113 |
108 } // namespace content | 114 } // namespace content |
OLD | NEW |