Index: content/browser/renderer_host/render_widget_host_unittest.cc |
diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc |
index 1787f66be29850bd589f60bacd96ddca97e8893c..fc691c720b85f8a3a78094c29239c2f774c57b8b 100644 |
--- a/content/browser/renderer_host/render_widget_host_unittest.cc |
+++ b/content/browser/renderer_host/render_widget_host_unittest.cc |
@@ -5,11 +5,8 @@ |
#include "base/basictypes.h" |
#include "base/bind.h" |
#include "base/command_line.h" |
-#include "base/location.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/memory/shared_memory.h" |
-#include "base/single_thread_task_runner.h" |
-#include "base/thread_task_runner_handle.h" |
#include "base/timer/timer.h" |
#include "content/browser/browser_thread_impl.h" |
#include "content/browser/gpu/compositor_util.h" |
@@ -982,8 +979,9 @@ TEST_F(RenderWidgetHostTest, DontPostponeHangMonitorTimeout) { |
host_->StartHangMonitorTimeout(TimeDelta::FromSeconds(30)); |
// Wait long enough for first timeout and see if it fired. |
- base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
- FROM_HERE, base::MessageLoop::QuitClosure(), |
+ base::MessageLoop::current()->PostDelayedTask( |
+ FROM_HERE, |
+ base::MessageLoop::QuitClosure(), |
TimeDelta::FromMilliseconds(10)); |
base::MessageLoop::current()->Run(); |
EXPECT_TRUE(host_->unresponsive_timer_fired()); |
@@ -1001,8 +999,9 @@ TEST_F(RenderWidgetHostTest, StopAndStartHangMonitorTimeout) { |
host_->StartHangMonitorTimeout(TimeDelta::FromMilliseconds(10)); |
// Wait long enough for first timeout and see if it fired. |
- base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
- FROM_HERE, base::MessageLoop::QuitClosure(), |
+ base::MessageLoop::current()->PostDelayedTask( |
+ FROM_HERE, |
+ base::MessageLoop::QuitClosure(), |
TimeDelta::FromMilliseconds(40)); |
base::MessageLoop::current()->Run(); |
EXPECT_TRUE(host_->unresponsive_timer_fired()); |
@@ -1019,8 +1018,9 @@ TEST_F(RenderWidgetHostTest, ShorterDelayHangMonitorTimeout) { |
host_->StartHangMonitorTimeout(TimeDelta::FromMilliseconds(20)); |
// Wait long enough for the second timeout and see if it fired. |
- base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
- FROM_HERE, base::MessageLoop::QuitClosure(), |
+ base::MessageLoop::current()->PostDelayedTask( |
+ FROM_HERE, |
+ base::MessageLoop::QuitClosure(), |
TimeDelta::FromMilliseconds(25)); |
base::MessageLoop::current()->Run(); |
EXPECT_TRUE(host_->unresponsive_timer_fired()); |
@@ -1037,16 +1037,18 @@ TEST_F(RenderWidgetHostTest, HangMonitorTimeoutDisabledForInputWhenHidden) { |
// The timeout should not fire. |
EXPECT_FALSE(host_->unresponsive_timer_fired()); |
- base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
- FROM_HERE, base::MessageLoop::QuitClosure(), |
+ base::MessageLoop::current()->PostDelayedTask( |
+ FROM_HERE, |
+ base::MessageLoop::QuitClosure(), |
TimeDelta::FromMicroseconds(2)); |
base::MessageLoop::current()->Run(); |
EXPECT_FALSE(host_->unresponsive_timer_fired()); |
// The timeout should never reactivate while hidden. |
SimulateMouseEvent(WebInputEvent::MouseMove, 10, 10, 0, false); |
- base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
- FROM_HERE, base::MessageLoop::QuitClosure(), |
+ base::MessageLoop::current()->PostDelayedTask( |
+ FROM_HERE, |
+ base::MessageLoop::QuitClosure(), |
TimeDelta::FromMicroseconds(2)); |
base::MessageLoop::current()->Run(); |
EXPECT_FALSE(host_->unresponsive_timer_fired()); |
@@ -1054,8 +1056,9 @@ TEST_F(RenderWidgetHostTest, HangMonitorTimeoutDisabledForInputWhenHidden) { |
// Showing the widget should restore the timeout, as the events have |
// not yet been ack'ed. |
host_->WasShown(ui::LatencyInfo()); |
- base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
- FROM_HERE, base::MessageLoop::QuitClosure(), |
+ base::MessageLoop::current()->PostDelayedTask( |
+ FROM_HERE, |
+ base::MessageLoop::QuitClosure(), |
TimeDelta::FromMicroseconds(2)); |
base::MessageLoop::current()->Run(); |
EXPECT_TRUE(host_->unresponsive_timer_fired()); |
@@ -1076,8 +1079,9 @@ TEST_F(RenderWidgetHostTest, MultipleInputEvents) { |
INPUT_EVENT_ACK_STATE_CONSUMED); |
// Wait long enough for first timeout and see if it fired. |
- base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
- FROM_HERE, base::MessageLoop::QuitClosure(), |
+ base::MessageLoop::current()->PostDelayedTask( |
+ FROM_HERE, |
+ base::MessageLoop::QuitClosure(), |
TimeDelta::FromMicroseconds(20)); |
base::MessageLoop::current()->Run(); |
EXPECT_TRUE(host_->unresponsive_timer_fired()); |