| Index: chrome/test/base/interactive_test_utils.cc
|
| diff --git a/chrome/test/base/interactive_test_utils.cc b/chrome/test/base/interactive_test_utils.cc
|
| index 2241bbafe6e1f70200dc9f797ce7a2cfa81a727d..a9941fd5f57ec04b81a56d306feb8e278b170a7a 100644
|
| --- a/chrome/test/base/interactive_test_utils.cc
|
| +++ b/chrome/test/base/interactive_test_utils.cc
|
| @@ -48,15 +48,14 @@ bool SendKeyPressToWindowSync(const gfx::NativeWindow window,
|
| bool shift,
|
| bool alt,
|
| bool command) {
|
| - scoped_refptr<content::MessageLoopRunner> runner =
|
| - new content::MessageLoopRunner;
|
| + base::RunLoop run_loop;
|
| bool result;
|
| result = ui_controls::SendKeyPressNotifyWhenDone(
|
| - window, key, control, shift, alt, command, runner->QuitClosure());
|
| + window, key, control, shift, alt, command, run_loop.QuitClosure());
|
| #if defined(OS_WIN)
|
| if (!result && ui_test_utils::ShowAndFocusNativeWindow(window)) {
|
| result = ui_controls::SendKeyPressNotifyWhenDone(
|
| - window, key, control, shift, alt, command, runner->QuitClosure());
|
| + window, key, control, shift, alt, command, run_loop.QuitClosure());
|
| }
|
| #endif
|
| if (!result) {
|
| @@ -67,7 +66,7 @@ bool SendKeyPressToWindowSync(const gfx::NativeWindow window,
|
| // Run the message loop. It'll stop running when either the key was received
|
| // or the test timed out (in which case testing::Test::HasFatalFailure should
|
| // be set).
|
| - runner->Run();
|
| + run_loop.Run();
|
| return !testing::Test::HasFatalFailure();
|
| }
|
|
|
| @@ -89,24 +88,22 @@ bool SendKeyPressAndWait(const Browser* browser,
|
| }
|
|
|
| bool SendMouseMoveSync(const gfx::Point& location) {
|
| - scoped_refptr<content::MessageLoopRunner> runner =
|
| - new content::MessageLoopRunner;
|
| + base::RunLoop run_loop;
|
| if (!ui_controls::SendMouseMoveNotifyWhenDone(
|
| - location.x(), location.y(), runner->QuitClosure())) {
|
| + location.x(), location.y(), run_loop.QuitClosure())) {
|
| return false;
|
| }
|
| - runner->Run();
|
| + run_loop.Run();
|
| return !testing::Test::HasFatalFailure();
|
| }
|
|
|
| bool SendMouseEventsSync(ui_controls::MouseButton type, int state) {
|
| - scoped_refptr<content::MessageLoopRunner> runner =
|
| - new content::MessageLoopRunner;
|
| + base::RunLoop run_loop;
|
| if (!ui_controls::SendMouseEventsNotifyWhenDone(
|
| - type, state, runner->QuitClosure())) {
|
| + type, state, run_loop.QuitClosure())) {
|
| return false;
|
| }
|
| - runner->Run();
|
| + run_loop.Run();
|
| return !testing::Test::HasFatalFailure();
|
| }
|
|
|
|
|