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

Unified Diff: content/renderer/media/media_stream_dispatcher_unittest.cc

Issue 1314803003: Include default communication devices in audio device enumerations. This removes heuristic that pic… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comment Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/media_stream_dispatcher_unittest.cc
diff --git a/content/renderer/media/media_stream_dispatcher_unittest.cc b/content/renderer/media/media_stream_dispatcher_unittest.cc
index 32acc8825446f4ceecbf5d4b7d29cd162da43a0b..eb68780b232fd2737284185548cfc96886c3ed8a 100644
--- a/content/renderer/media/media_stream_dispatcher_unittest.cc
+++ b/content/renderer/media/media_stream_dispatcher_unittest.cc
@@ -405,66 +405,4 @@ TEST_F(MediaStreamDispatcherTest, DeviceClosed) {
StreamDeviceInfo::kNoId);
}
-TEST_F(MediaStreamDispatcherTest, CheckDuckingState) {
- scoped_ptr<MediaStreamDispatcher> dispatcher(new MediaStreamDispatcher(NULL));
- scoped_ptr<MockMediaStreamDispatcherEventHandler>
- handler(new MockMediaStreamDispatcherEventHandler);
- StreamOptions components(true, false); // audio only.
- int ipc_request_id1 = dispatcher->next_ipc_id_;
-
- dispatcher->GenerateStream(kRequestId1, handler.get()->AsWeakPtr(),
- components, GURL());
- EXPECT_EQ(1u, dispatcher->requests_.size());
-
- // Ducking isn't active at this point.
- EXPECT_FALSE(dispatcher->IsAudioDuckingActive());
-
- // Complete the creation of stream1 with a single audio track that has
- // ducking enabled.
- StreamDeviceInfoArray audio_device_array(1);
- StreamDeviceInfo& audio_device_info = audio_device_array[0];
- audio_device_info.device.name = "Microphone";
- audio_device_info.device.type = kAudioType;
- audio_device_info.session_id = kAudioSessionId;
- audio_device_info.device.input.effects = media::AudioParameters::DUCKING;
-
- StreamDeviceInfoArray video_device_array; // Empty for this test.
-
- const char kStreamLabel[] = "stream1";
- dispatcher->OnMessageReceived(MediaStreamMsg_StreamGenerated(
- kRouteId, ipc_request_id1, kStreamLabel,
- audio_device_array, video_device_array));
- EXPECT_EQ(handler->request_id_, kRequestId1);
- EXPECT_EQ(0u, dispatcher->requests_.size());
-
- // Ducking should now be reported as active.
- EXPECT_TRUE(dispatcher->IsAudioDuckingActive());
-
- // Stop the device (removes the stream).
- dispatcher->OnMessageReceived(
- MediaStreamMsg_DeviceStopped(kRouteId, kStreamLabel,
- handler->audio_device_));
-
- // Ducking should now be reported as inactive again.
- EXPECT_FALSE(dispatcher->IsAudioDuckingActive());
-
- // Now do the same sort of test with the DUCKING flag off.
- audio_device_info.device.input.effects =
- media::AudioParameters::ECHO_CANCELLER;
-
- dispatcher->OnMessageReceived(MediaStreamMsg_StreamGenerated(
- kRouteId, ipc_request_id1, kStreamLabel,
- audio_device_array, video_device_array));
- EXPECT_EQ(handler->request_id_, kRequestId1);
- EXPECT_EQ(0u, dispatcher->requests_.size());
-
- // Ducking should still be reported as not active.
- EXPECT_FALSE(dispatcher->IsAudioDuckingActive());
-
- // Stop the device (removes the stream).
- dispatcher->OnMessageReceived(
- MediaStreamMsg_DeviceStopped(kRouteId, kStreamLabel,
- handler->audio_device_));
-}
-
} // namespace content
« no previous file with comments | « content/renderer/media/media_stream_dispatcher.cc ('k') | content/renderer/media/webrtc/peer_connection_dependency_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698