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

Unified Diff: chrome/test/base/interactive_test_utils.cc

Issue 12086095: Fixed drag and drop into and out of Browser Plugin. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Enabled for mac Created 7 years, 8 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: 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();
}

Powered by Google App Engine
This is Rietveld 408576698