Index: media/renderers/video_renderer_impl_unittest.cc |
diff --git a/media/renderers/video_renderer_impl_unittest.cc b/media/renderers/video_renderer_impl_unittest.cc |
index 77325ea41db354584032e8324c040e2f7cb1bb18..b4a856b756f453bc98469ea08b8f9d6330dcc944 100644 |
--- a/media/renderers/video_renderer_impl_unittest.cc |
+++ b/media/renderers/video_renderer_impl_unittest.cc |
@@ -13,6 +13,8 @@ |
#include "base/debug/stack_trace.h" |
#include "base/macros.h" |
#include "base/message_loop/message_loop.h" |
+#include "base/run_loop.h" |
+#include "base/single_thread_task_runner.h" |
#include "base/stl_util.h" |
#include "base/strings/string_number_conversions.h" |
#include "base/strings/string_split.h" |
@@ -132,7 +134,7 @@ class VideoRendererImplTest : public testing::Test { |
base::TimeDelta::FromMilliseconds(milliseconds); |
time_source_.SetMediaTime(media_time); |
renderer_->StartPlayingFrom(media_time); |
- message_loop_.RunUntilIdle(); |
+ base::RunLoop().RunUntilIdle(); |
} |
void Flush() { |
@@ -145,7 +147,7 @@ class VideoRendererImplTest : public testing::Test { |
void Destroy() { |
SCOPED_TRACE("Destroy()"); |
renderer_.reset(); |
- message_loop_.RunUntilIdle(); |
+ base::RunLoop().RunUntilIdle(); |
} |
// Parses a string representation of video frames and generates corresponding |
@@ -238,8 +240,9 @@ class VideoRendererImplTest : public testing::Test { |
// Post tasks for OutputCB and DecodeCB. |
scoped_refptr<VideoFrame> frame = decode_results_.front().second; |
if (frame.get()) |
- message_loop_.PostTask(FROM_HERE, base::Bind(output_cb_, frame)); |
- message_loop_.PostTask( |
+ message_loop_.task_runner()->PostTask(FROM_HERE, |
+ base::Bind(output_cb_, frame)); |
+ message_loop_.task_runner()->PostTask( |
FROM_HERE, base::Bind(base::ResetAndReturn(&decode_cb_), |
decode_results_.front().first)); |
decode_results_.pop_front(); |
@@ -254,13 +257,13 @@ class VideoRendererImplTest : public testing::Test { |
DecoderBuffer::CreateEOSBuffer())); |
// Satify pending |decode_cb_| to trigger a new DemuxerStream::Read(). |
- message_loop_.PostTask( |
+ message_loop_.task_runner()->PostTask( |
FROM_HERE, |
base::Bind(base::ResetAndReturn(&decode_cb_), DecodeStatus::OK)); |
WaitForPendingDecode(); |
- message_loop_.PostTask( |
+ message_loop_.task_runner()->PostTask( |
FROM_HERE, |
base::Bind(base::ResetAndReturn(&decode_cb_), DecodeStatus::OK)); |
} |
@@ -467,7 +470,7 @@ class VideoRendererImplTest : public testing::Test { |
SatisfyPendingDecode(); |
} |
- message_loop_.PostTask(FROM_HERE, callback); |
+ message_loop_.task_runner()->PostTask(FROM_HERE, callback); |
} |
// Used to protect |time_|. |
@@ -1124,7 +1127,7 @@ TEST_F(VideoRendererImplAsyncAddFrameReadyTest, InitializeAndStartPlayingFrom) { |
uint32_t frame_ready_index = 0; |
while (frame_ready_index < frame_ready_cbs_.size()) { |
frame_ready_cbs_[frame_ready_index++].Run(); |
- message_loop_.RunUntilIdle(); |
+ base::RunLoop().RunUntilIdle(); |
} |
Destroy(); |
} |