OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 5 #include <string> |
6 #include <queue> | 6 #include <queue> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
13 #include "content/browser/browser_thread_impl.h" | 13 #include "content/browser/browser_thread_impl.h" |
| 14 #include "content/browser/renderer_host/media/audio_input_device_manager.h" |
14 #include "content/browser/renderer_host/media/media_stream_dispatcher_host.h" | 15 #include "content/browser/renderer_host/media/media_stream_dispatcher_host.h" |
15 #include "content/browser/renderer_host/media/media_stream_manager.h" | 16 #include "content/browser/renderer_host/media/media_stream_manager.h" |
16 #include "content/browser/renderer_host/media/media_stream_ui_proxy.h" | 17 #include "content/browser/renderer_host/media/media_stream_ui_proxy.h" |
17 #include "content/browser/renderer_host/media/video_capture_manager.h" | 18 #include "content/browser/renderer_host/media/video_capture_manager.h" |
18 #include "content/common/media/media_stream_messages.h" | 19 #include "content/common/media/media_stream_messages.h" |
19 #include "content/common/media/media_stream_options.h" | 20 #include "content/common/media/media_stream_options.h" |
20 #include "content/public/browser/media_device_id.h" | 21 #include "content/public/browser/media_device_id.h" |
21 #include "content/public/common/content_switches.h" | 22 #include "content/public/common/content_switches.h" |
22 #include "content/public/test/mock_resource_context.h" | 23 #include "content/public/test/mock_resource_context.h" |
23 #include "content/public/test/test_browser_context.h" | 24 #include "content/public/test/test_browser_context.h" |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 old_browser_client_ = SetBrowserClientForTesting(host_.get()); | 241 old_browser_client_ = SetBrowserClientForTesting(host_.get()); |
241 } | 242 } |
242 | 243 |
243 virtual ~MediaStreamDispatcherHostTest() { | 244 virtual ~MediaStreamDispatcherHostTest() { |
244 } | 245 } |
245 | 246 |
246 virtual void SetUp() OVERRIDE { | 247 virtual void SetUp() OVERRIDE { |
247 video_capture_device_factory_->GetDeviceNames(&physical_video_devices_); | 248 video_capture_device_factory_->GetDeviceNames(&physical_video_devices_); |
248 ASSERT_GT(physical_video_devices_.size(), 0u); | 249 ASSERT_GT(physical_video_devices_.size(), 0u); |
249 | 250 |
250 audio_manager_->GetAudioInputDeviceNames(&physical_audio_devices_); | 251 media_stream_manager_->audio_input_device_manager()->GetFakeDeviceNames( |
| 252 &physical_audio_devices_); |
251 ASSERT_GT(physical_audio_devices_.size(), 0u); | 253 ASSERT_GT(physical_audio_devices_.size(), 0u); |
252 } | 254 } |
253 | 255 |
254 virtual void TearDown() OVERRIDE { | 256 virtual void TearDown() OVERRIDE { |
255 host_->OnChannelClosing(); | 257 host_->OnChannelClosing(); |
256 } | 258 } |
257 | 259 |
258 protected: | 260 protected: |
259 virtual void SetupFakeUI(bool expect_started) { | 261 virtual void SetupFakeUI(bool expect_started) { |
260 scoped_ptr<MockMediaStreamUIProxy> stream_ui(new MockMediaStreamUIProxy()); | 262 scoped_ptr<MockMediaStreamUIProxy> stream_ui(new MockMediaStreamUIProxy()); |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 EnumerateDevicesAndWaitForResult(kRenderId, kPageRequestId, | 853 EnumerateDevicesAndWaitForResult(kRenderId, kPageRequestId, |
852 MEDIA_DEVICE_AUDIO_CAPTURE); | 854 MEDIA_DEVICE_AUDIO_CAPTURE); |
853 } | 855 } |
854 | 856 |
855 TEST_F(MediaStreamDispatcherHostTest, EnumerateVideoDevices) { | 857 TEST_F(MediaStreamDispatcherHostTest, EnumerateVideoDevices) { |
856 EnumerateDevicesAndWaitForResult(kRenderId, kPageRequestId, | 858 EnumerateDevicesAndWaitForResult(kRenderId, kPageRequestId, |
857 MEDIA_DEVICE_VIDEO_CAPTURE); | 859 MEDIA_DEVICE_VIDEO_CAPTURE); |
858 } | 860 } |
859 | 861 |
860 }; // namespace content | 862 }; // namespace content |
OLD | NEW |