| 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) {
|
|
|