Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(302)

Side by Side Diff: content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc

Issue 260073013: Added automatic mode to FakeInputAudioStream to generate automatic beeps (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: consolidated how we inject fake audio devices. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 old_browser_client_ = SetBrowserClientForTesting(host_.get()); 242 old_browser_client_ = SetBrowserClientForTesting(host_.get());
242 } 243 }
243 244
244 virtual ~MediaStreamDispatcherHostTest() { 245 virtual ~MediaStreamDispatcherHostTest() {
245 } 246 }
246 247
247 virtual void SetUp() OVERRIDE { 248 virtual void SetUp() OVERRIDE {
248 video_capture_device_factory_->GetDeviceNames(&physical_video_devices_); 249 video_capture_device_factory_->GetDeviceNames(&physical_video_devices_);
249 ASSERT_GT(physical_video_devices_.size(), 0u); 250 ASSERT_GT(physical_video_devices_.size(), 0u);
250 251
251 audio_manager_->GetAudioInputDeviceNames(&physical_audio_devices_); 252 media_stream_manager_->audio_input_device_manager()->GetFakeDeviceNames(
253 &physical_audio_devices_);
252 ASSERT_GT(physical_audio_devices_.size(), 0u); 254 ASSERT_GT(physical_audio_devices_.size(), 0u);
253 } 255 }
254 256
255 virtual void TearDown() OVERRIDE { 257 virtual void TearDown() OVERRIDE {
256 host_->OnChannelClosing(); 258 host_->OnChannelClosing();
257 } 259 }
258 260
259 protected: 261 protected:
260 virtual void SetupFakeUI(bool expect_started) { 262 virtual void SetupFakeUI(bool expect_started) {
261 scoped_ptr<MockMediaStreamUIProxy> stream_ui(new MockMediaStreamUIProxy()); 263 scoped_ptr<MockMediaStreamUIProxy> stream_ui(new MockMediaStreamUIProxy());
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 EnumerateDevicesAndWaitForResult(kRenderId, kPageRequestId, 854 EnumerateDevicesAndWaitForResult(kRenderId, kPageRequestId,
853 MEDIA_DEVICE_AUDIO_CAPTURE); 855 MEDIA_DEVICE_AUDIO_CAPTURE);
854 } 856 }
855 857
856 TEST_F(MediaStreamDispatcherHostTest, EnumerateVideoDevices) { 858 TEST_F(MediaStreamDispatcherHostTest, EnumerateVideoDevices) {
857 EnumerateDevicesAndWaitForResult(kRenderId, kPageRequestId, 859 EnumerateDevicesAndWaitForResult(kRenderId, kPageRequestId,
858 MEDIA_DEVICE_VIDEO_CAPTURE); 860 MEDIA_DEVICE_VIDEO_CAPTURE);
859 } 861 }
860 862
861 }; // namespace content 863 }; // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698