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

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

Issue 2034663003: Remove use of deprecated MessageLoop methods in content. (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
Index: content/renderer/media/renderer_webmediaplayer_delegate_browsertest.cc
diff --git a/content/renderer/media/renderer_webmediaplayer_delegate_browsertest.cc b/content/renderer/media/renderer_webmediaplayer_delegate_browsertest.cc
index 64a306bac9bfc34d8a0f92733d1ec6acffe0455f..4fe4fdb45256ea6afa9443ab639371b3312825e5 100644
--- a/content/renderer/media/renderer_webmediaplayer_delegate_browsertest.cc
+++ b/content/renderer/media/renderer_webmediaplayer_delegate_browsertest.cc
@@ -6,8 +6,11 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
+#include "base/location.h"
#include "base/run_loop.h"
+#include "base/single_thread_task_runner.h"
#include "base/test/simple_test_tick_clock.h"
+#include "base/threading/thread_task_runner_handle.h"
#include "content/common/media/media_player_delegate_messages.h"
#include "content/public/renderer/render_view.h"
#include "content/public/test/render_view_test.h"
@@ -185,7 +188,8 @@ TEST_F(RendererWebMediaPlayerDelegateTest, IdleDelegatesAreSuspended) {
&RendererWebMediaPlayerDelegate::PlayerGone,
base::Unretained(delegate_manager_.get()), delegate_id_2)));
base::RunLoop run_loop;
- base::MessageLoop::current()->PostTask(FROM_HERE, run_loop.QuitClosure());
+ base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
+ run_loop.QuitClosure());
tick_clock.Advance(kIdleTimeout + base::TimeDelta::FromMicroseconds(1));
run_loop.Run();
}
@@ -204,7 +208,8 @@ TEST_F(RendererWebMediaPlayerDelegateTest, IdleDelegatesAreSuspended) {
EXPECT_CALL(observer_1, OnSuspendRequested(false))
.Times(testing::AtLeast(1));
base::RunLoop run_loop;
- base::MessageLoop::current()->PostTask(FROM_HERE, run_loop.QuitClosure());
+ base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
+ run_loop.QuitClosure());
tick_clock.Advance(kIdleTimeout + base::TimeDelta::FromMicroseconds(1));
run_loop.Run();
}
@@ -223,7 +228,8 @@ TEST_F(RendererWebMediaPlayerDelegateTest, IdleDelegatesAreSuspended) {
&RendererWebMediaPlayerDelegate::PlayerGone,
base::Unretained(delegate_manager_.get()), delegate_id_1)));
base::RunLoop run_loop;
- base::MessageLoop::current()->PostTask(FROM_HERE, run_loop.QuitClosure());
+ base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
+ run_loop.QuitClosure());
tick_clock.Advance(kIdleTimeout + base::TimeDelta::FromMicroseconds(1));
run_loop.Run();
}
@@ -254,7 +260,8 @@ TEST_F(RendererWebMediaPlayerDelegateTest, IdleDelegatesIgnoresSuspendRequest) {
// Wait for the suspend request, but don't call PlayerGone().
EXPECT_CALL(observer_1, OnSuspendRequested(false));
base::RunLoop run_loop;
- base::MessageLoop::current()->PostTask(FROM_HERE, run_loop.QuitClosure());
+ base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
+ run_loop.QuitClosure());
tick_clock.Advance(kIdleTimeout + base::TimeDelta::FromMicroseconds(1));
run_loop.Run();

Powered by Google App Engine
This is Rietveld 408576698