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

Unified Diff: media/renderers/video_renderer_impl_unittest.cc

Issue 2086353002: Remove calls to deprecated MessageLoop methods in media. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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
« no previous file with comments | « media/renderers/audio_renderer_impl_unittest.cc ('k') | media/test/pipeline_integration_test_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « media/renderers/audio_renderer_impl_unittest.cc ('k') | media/test/pipeline_integration_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698