| 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 e6681fbc986f4a061530b043a1d33ae2b5586372..2a5fc6138b82c5cb9a45d094cf5e4635484d318c 100644
|
| --- a/chrome/test/base/interactive_test_utils.cc
|
| +++ b/chrome/test/base/interactive_test_utils.cc
|
| @@ -10,6 +10,9 @@
|
|
|
| namespace ui_test_utils {
|
|
|
| +// TODO(msw): Remove flaky test debug logging for http://crbug.com/639350.
|
| +bool g_crbug_639350_logging = false;
|
| +
|
| namespace {
|
|
|
| bool GetNativeWindow(const Browser* browser, gfx::NativeWindow* native_window) {
|
| @@ -49,26 +52,40 @@ bool SendKeyPressToWindowSync(const gfx::NativeWindow window,
|
| bool shift,
|
| bool alt,
|
| bool command) {
|
| + if (g_crbug_639350_logging)
|
| + LOG(ERROR) << "crbug.com/639350 SendKeyPressToWindowSync A";
|
| scoped_refptr<content::MessageLoopRunner> runner =
|
| new content::MessageLoopRunner;
|
| bool result;
|
| result = ui_controls::SendKeyPressNotifyWhenDone(
|
| window, key, control, shift, alt, command, runner->QuitClosure());
|
| + if (g_crbug_639350_logging)
|
| + LOG(ERROR) << "crbug.com/639350 SendKeyPressToWindowSync B";
|
| #if defined(OS_WIN)
|
| + if (g_crbug_639350_logging)
|
| + LOG(ERROR) << "crbug.com/639350 SendKeyPressToWindowSync C";
|
| if (!result && ui_test_utils::ShowAndFocusNativeWindow(window)) {
|
| + if (g_crbug_639350_logging)
|
| + LOG(ERROR) << "crbug.com/639350 SendKeyPressToWindowSync D";
|
| result = ui_controls::SendKeyPressNotifyWhenDone(
|
| window, key, control, shift, alt, command, runner->QuitClosure());
|
| }
|
| + if (g_crbug_639350_logging)
|
| + LOG(ERROR) << "crbug.com/639350 SendKeyPressToWindowSync E";
|
| #endif
|
| if (!result) {
|
| LOG(ERROR) << "ui_controls::SendKeyPressNotifyWhenDone failed";
|
| return false;
|
| }
|
|
|
| + if (g_crbug_639350_logging)
|
| + LOG(ERROR) << "crbug.com/639350 SendKeyPressToWindowSync F: RUN RUNNER";
|
| // 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();
|
| + if (g_crbug_639350_logging)
|
| + LOG(ERROR) << "crbug.com/639350 SendKeyPressToWindowSync G: RUNNER DONE";
|
| return !testing::Test::HasFatalFailure();
|
| }
|
|
|
|
|