Index: chrome/test/base/interactive_test_utils_win.cc |
diff --git a/chrome/test/base/interactive_test_utils_win.cc b/chrome/test/base/interactive_test_utils_win.cc |
index 4858cf69c0b0f2639954e60a33ad355fbc63ba5b..232a85e62cb572f27cc6fcf5306c0061e51d72dc 100644 |
--- a/chrome/test/base/interactive_test_utils_win.cc |
+++ b/chrome/test/base/interactive_test_utils_win.cc |
@@ -46,7 +46,15 @@ bool ShowAndFocusNativeWindow(gfx::NativeWindow window) { |
// ShowWindow does not necessarily activate the window. In particular if a |
// window from another app is the foreground window then the request to |
// activate the window fails. See SetForegroundWindow for details. |
- return GetForegroundWindow() == hwnd; |
+ HWND foreground_window = GetForegroundWindow(); |
+ if (foreground_window == hwnd) |
+ return true; |
+ |
+ wchar_t window_title[256]; |
+ GetWindowText(foreground_window, window_title, arraysize(window_title)); |
+ LOG(ERROR) << "ShowAndFocusNativeWindow failed. foreground window text: " << |
+ window_title; |
+ return false; |
} |
} // namespace ui_test_utils |