Index: content/browser/renderer_host/media/audio_input_device_manager_unittest.cc |
diff --git a/content/browser/renderer_host/media/audio_input_device_manager_unittest.cc b/content/browser/renderer_host/media/audio_input_device_manager_unittest.cc |
index 8b8fcb7e03441b3a721ad52561338521a7d6762e..a9fb93cd548312b9e3678c06f5c93270134e715d 100644 |
--- a/content/browser/renderer_host/media/audio_input_device_manager_unittest.cc |
+++ b/content/browser/renderer_host/media/audio_input_device_manager_unittest.cc |
@@ -38,7 +38,7 @@ class MockAudioInputDeviceManagerListener |
virtual void DevicesEnumerated(MediaStreamType service_type, |
const StreamDeviceInfoArray& devices) { |
- if (service_type != content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE) |
+ if (!content::IsAudioMediaStreamDeviceType(service_type)) |
return; |
devices_ = devices; |
@@ -98,7 +98,9 @@ class AudioInputDeviceManagerTest : public testing::Test { |
message_loop_.get())); |
audio_manager_.reset(media::AudioManager::Create()); |
- manager_ = new AudioInputDeviceManager(audio_manager_.get()); |
+ manager_ = new AudioInputDeviceManager( |
+ audio_manager_.get(), |
+ content::MEDIA_STREAM_DEVICE_TYPE_USER_AUDIO_CAPTURE); |
audio_input_listener_.reset(new MockAudioInputDeviceManagerListener()); |
manager_->Register(audio_input_listener_.get(), |
message_loop_->message_loop_proxy()); |
@@ -145,11 +147,11 @@ TEST_F(AudioInputDeviceManagerTest, OpenAndCloseDevice) { |
// Expected mock call with expected return value. |
EXPECT_CALL(*audio_input_listener_, |
- Opened(content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE, |
+ Opened(content::MEDIA_STREAM_DEVICE_TYPE_USER_AUDIO_CAPTURE, |
session_id)) |
.Times(1); |
EXPECT_CALL(*audio_input_listener_, |
- Closed(content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE, |
+ Closed(content::MEDIA_STREAM_DEVICE_TYPE_USER_AUDIO_CAPTURE, |
session_id)) |
.Times(1); |
@@ -180,7 +182,7 @@ TEST_F(AudioInputDeviceManagerTest, OpenMultipleDevices) { |
// Expected mock call with expected returned value. |
EXPECT_CALL(*audio_input_listener_, |
- Opened(content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE, |
+ Opened(content::MEDIA_STREAM_DEVICE_TYPE_USER_AUDIO_CAPTURE, |
session_id[index])) |
.Times(1); |
@@ -199,7 +201,7 @@ TEST_F(AudioInputDeviceManagerTest, OpenMultipleDevices) { |
// Closes the devices. |
manager_->Close(session_id[i]); |
EXPECT_CALL(*audio_input_listener_, |
- Closed(content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE, |
+ Closed(content::MEDIA_STREAM_DEVICE_TYPE_USER_AUDIO_CAPTURE, |
session_id[i])) |
.Times(1); |
@@ -214,14 +216,15 @@ TEST_F(AudioInputDeviceManagerTest, OpenNotExistingDevice) { |
return; |
InSequence s; |
- MediaStreamType stream_type = content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE; |
+ MediaStreamType stream_type = |
+ content::MEDIA_STREAM_DEVICE_TYPE_USER_AUDIO_CAPTURE; |
std::string device_name("device_doesnt_exist"); |
std::string device_id("id_doesnt_exist"); |
StreamDeviceInfo dummy_device(stream_type, device_name, device_id, false); |
int session_id = manager_->Open(dummy_device); |
EXPECT_CALL(*audio_input_listener_, |
- Opened(content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE, |
+ Opened(content::MEDIA_STREAM_DEVICE_TYPE_USER_AUDIO_CAPTURE, |
session_id)) |
.Times(1); |
@@ -249,19 +252,19 @@ TEST_F(AudioInputDeviceManagerTest, OpenDeviceTwice) { |
// Expected mock calls with expected returned values. |
EXPECT_NE(first_session_id, second_session_id); |
EXPECT_CALL(*audio_input_listener_, |
- Opened(content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE, |
+ Opened(content::MEDIA_STREAM_DEVICE_TYPE_USER_AUDIO_CAPTURE, |
first_session_id)) |
.Times(1); |
EXPECT_CALL(*audio_input_listener_, |
- Opened(content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE, |
+ Opened(content::MEDIA_STREAM_DEVICE_TYPE_USER_AUDIO_CAPTURE, |
second_session_id)) |
.Times(1); |
EXPECT_CALL(*audio_input_listener_, |
- Closed(content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE, |
+ Closed(content::MEDIA_STREAM_DEVICE_TYPE_USER_AUDIO_CAPTURE, |
first_session_id)) |
.Times(1); |
EXPECT_CALL(*audio_input_listener_, |
- Closed(content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE, |
+ Closed(content::MEDIA_STREAM_DEVICE_TYPE_USER_AUDIO_CAPTURE, |
second_session_id)) |
.Times(1); |
@@ -296,7 +299,7 @@ TEST_F(AudioInputDeviceManagerTest, StartAndStopSession) { |
// stopped the device before calling close. |
session_id[index] = manager_->Open(*iter); |
EXPECT_CALL(*audio_input_listener_, |
- Opened(content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE, |
+ Opened(content::MEDIA_STREAM_DEVICE_TYPE_USER_AUDIO_CAPTURE, |
session_id[index])) |
.Times(1); |
message_loop_->RunAllPending(); |
@@ -310,7 +313,7 @@ TEST_F(AudioInputDeviceManagerTest, StartAndStopSession) { |
manager_->Stop(session_id[index]); |
manager_->Close(session_id[index]); |
EXPECT_CALL(*audio_input_listener_, |
- Closed(content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE, |
+ Closed(content::MEDIA_STREAM_DEVICE_TYPE_USER_AUDIO_CAPTURE, |
session_id[index])) |
.Times(1); |
message_loop_->RunAllPending(); |
@@ -343,7 +346,7 @@ TEST_F(AudioInputDeviceManagerTest, CloseWithoutStopSession) { |
// Calls Open()/Start()/Close() for each device. |
session_id[index] = manager_->Open(*iter); |
EXPECT_CALL(*audio_input_listener_, |
- Opened(content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE, |
+ Opened(content::MEDIA_STREAM_DEVICE_TYPE_USER_AUDIO_CAPTURE, |
session_id[index])) |
.Times(1); |
message_loop_->RunAllPending(); |
@@ -361,7 +364,7 @@ TEST_F(AudioInputDeviceManagerTest, CloseWithoutStopSession) { |
DeviceStopped(session_id[index])) |
.Times(1); |
EXPECT_CALL(*audio_input_listener_, |
- Closed(content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE, |
+ Closed(content::MEDIA_STREAM_DEVICE_TYPE_USER_AUDIO_CAPTURE, |
session_id[index])) |
.Times(1); |
message_loop_->RunAllPending(); |
@@ -392,11 +395,11 @@ TEST_F(AudioInputDeviceManagerTest, StartDeviceTwice) { |
int second_session_id = manager_->Open(*iter); |
EXPECT_NE(first_session_id, second_session_id); |
EXPECT_CALL(*audio_input_listener_, |
- Opened(content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE, |
+ Opened(content::MEDIA_STREAM_DEVICE_TYPE_USER_AUDIO_CAPTURE, |
first_session_id)) |
.Times(1); |
EXPECT_CALL(*audio_input_listener_, |
- Opened(content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE, |
+ Opened(content::MEDIA_STREAM_DEVICE_TYPE_USER_AUDIO_CAPTURE, |
second_session_id)) |
.Times(1); |
message_loop_->RunAllPending(); |
@@ -419,11 +422,11 @@ TEST_F(AudioInputDeviceManagerTest, StartDeviceTwice) { |
manager_->Close(first_session_id); |
manager_->Close(second_session_id); |
EXPECT_CALL(*audio_input_listener_, |
- Closed(content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE, |
+ Closed(content::MEDIA_STREAM_DEVICE_TYPE_USER_AUDIO_CAPTURE, |
first_session_id)) |
.Times(1); |
EXPECT_CALL(*audio_input_listener_, |
- Closed(content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE, |
+ Closed(content::MEDIA_STREAM_DEVICE_TYPE_USER_AUDIO_CAPTURE, |
second_session_id)) |
.Times(1); |
message_loop_->RunAllPending(); |
@@ -445,7 +448,7 @@ TEST_F(AudioInputDeviceManagerTest, StartInvalidSession) { |
audio_input_listener_->devices_.begin(); |
int session_id = manager_->Open(*iter); |
EXPECT_CALL(*audio_input_listener_, |
- Opened(content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE, |
+ Opened(content::MEDIA_STREAM_DEVICE_TYPE_USER_AUDIO_CAPTURE, |
session_id)) |
.Times(1); |
message_loop_->RunAllPending(); |
@@ -461,7 +464,7 @@ TEST_F(AudioInputDeviceManagerTest, StartInvalidSession) { |
manager_->Close(session_id); |
EXPECT_CALL(*audio_input_listener_, |
- Closed(content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE, |
+ Closed(content::MEDIA_STREAM_DEVICE_TYPE_USER_AUDIO_CAPTURE, |
session_id)) |
.Times(1); |
message_loop_->RunAllPending(); |
@@ -484,7 +487,7 @@ TEST_F(AudioInputDeviceManagerTest, StartSessionTwice) { |
audio_input_listener_->devices_.begin(); |
int session_id = manager_->Open(*iter); |
EXPECT_CALL(*audio_input_listener_, |
- Opened(content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE, |
+ Opened(content::MEDIA_STREAM_DEVICE_TYPE_USER_AUDIO_CAPTURE, |
session_id)) |
.Times(1); |
message_loop_->RunAllPending(); |
@@ -506,7 +509,7 @@ TEST_F(AudioInputDeviceManagerTest, StartSessionTwice) { |
manager_->Stop(session_id); |
manager_->Close(session_id); |
EXPECT_CALL(*audio_input_listener_, |
- Closed(content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE, |
+ Closed(content::MEDIA_STREAM_DEVICE_TYPE_USER_AUDIO_CAPTURE, |
session_id)) |
.Times(1); |
message_loop_->RunAllPending(); |