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

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

Issue 2120273004: Getting rid of AudioHardwareConfig and its synchronous IPC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: compile error fix Created 4 years, 5 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/audio_renderer_sink_cache_unittest.cc
diff --git a/content/renderer/media/audio_renderer_sink_cache_unittest.cc b/content/renderer/media/audio_renderer_sink_cache_unittest.cc
index 81e349c24fa126f183743e9ee06ca4dd4276819a..ea5564b9eb2236a5cfdb711b97ce6365b06564fc 100644
--- a/content/renderer/media/audio_renderer_sink_cache_unittest.cc
+++ b/content/renderer/media/audio_renderer_sink_cache_unittest.cc
@@ -284,6 +284,29 @@ TEST_F(AudioRendererSinkCacheTest, ReleaseSinkBeforeScheduledDeletion) {
EXPECT_EQ(0, sink_count());
}
+// Verify that default output devicee information can be retrieved after default
+// sink deletion without creating another default sink.
+TEST_F(AudioRendererSinkCacheTest, DefaultOutputDeviceInfoCached) {
+ EXPECT_EQ(0, sink_count());
+
+ media::OutputDeviceInfo device_info =
+ cache_->GetSinkInfo(kRenderFrameId, 0, kDefaultDeviceId, url::Origin());
+ EXPECT_EQ(1, sink_count()); // This sink is scheduled for deletion now.
+
+ base::Thread thread("timeout_thread");
+ thread.Start();
+
+ // 100 ms more than garbage collection timeout.
+ WaitOnAnotherThread(thread, kDeleteTimeoutMs + 100);
+
+ EXPECT_EQ(0, sink_count()); // Default sink is deleted.
+
+ media::OutputDeviceInfo another_device_info =
+ cache_->GetSinkInfo(kRenderFrameId, 0, kDefaultDeviceId, url::Origin());
+
+ EXPECT_EQ(0, sink_count()); // No new default sink is created.
+}
+
// Check that a sink created on one thread in response to GetSinkInfo can be
// used on another thread.
TEST_F(AudioRendererSinkCacheTest, MultithreadedAccess) {

Powered by Google App Engine
This is Rietveld 408576698