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

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

Issue 566723002: If interactive_ui_tests can't change the foreground window, print the name of the Window that is cu… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698