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 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 protected: | 52 protected: |
53 virtual void SetUp() OVERRIDE { | 53 virtual void SetUp() OVERRIDE { |
54 // The test must run on Browser::IO. | 54 // The test must run on Browser::IO. |
55 message_loop_.reset(new base::MessageLoop(base::MessageLoop::TYPE_IO)); | 55 message_loop_.reset(new base::MessageLoop(base::MessageLoop::TYPE_IO)); |
56 io_thread_.reset(new BrowserThreadImpl(BrowserThread::IO, | 56 io_thread_.reset(new BrowserThreadImpl(BrowserThread::IO, |
57 message_loop_.get())); | 57 message_loop_.get())); |
58 audio_manager_.reset(media::AudioManager::Create()); | 58 audio_manager_.reset(media::AudioManager::Create()); |
59 manager_ = new AudioInputDeviceManager(audio_manager_.get()); | 59 manager_ = new AudioInputDeviceManager(audio_manager_.get()); |
60 audio_input_listener_.reset(new MockAudioInputDeviceManagerListener()); | 60 audio_input_listener_.reset(new MockAudioInputDeviceManagerListener()); |
61 manager_->Register(audio_input_listener_.get(), | 61 manager_->Register(audio_input_listener_.get(), |
62 message_loop_->message_loop_proxy()); | 62 message_loop_->message_loop_proxy().get()); |
63 | 63 |
64 // Gets the enumerated device list from the AudioInputDeviceManager. | 64 // Gets the enumerated device list from the AudioInputDeviceManager. |
65 manager_->EnumerateDevices(MEDIA_DEVICE_AUDIO_CAPTURE); | 65 manager_->EnumerateDevices(MEDIA_DEVICE_AUDIO_CAPTURE); |
66 EXPECT_CALL(*audio_input_listener_, | 66 EXPECT_CALL(*audio_input_listener_, |
67 DevicesEnumerated(MEDIA_DEVICE_AUDIO_CAPTURE, _)) | 67 DevicesEnumerated(MEDIA_DEVICE_AUDIO_CAPTURE, _)) |
68 .Times(1) | 68 .Times(1) |
69 .WillOnce(SaveArg<1>(&devices_)); | 69 .WillOnce(SaveArg<1>(&devices_)); |
70 | 70 |
71 // Wait until we get the list. | 71 // Wait until we get the list. |
72 message_loop_->RunUntilIdle(); | 72 message_loop_->RunUntilIdle(); |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 DCHECK(!info); | 282 DCHECK(!info); |
283 | 283 |
284 manager_->Close(session_id); | 284 manager_->Close(session_id); |
285 EXPECT_CALL(*audio_input_listener_, | 285 EXPECT_CALL(*audio_input_listener_, |
286 Closed(MEDIA_DEVICE_AUDIO_CAPTURE, session_id)) | 286 Closed(MEDIA_DEVICE_AUDIO_CAPTURE, session_id)) |
287 .Times(1); | 287 .Times(1); |
288 message_loop_->RunUntilIdle(); | 288 message_loop_->RunUntilIdle(); |
289 } | 289 } |
290 | 290 |
291 } // namespace content | 291 } // namespace content |
OLD | NEW |