From 8f00ad02fb2828fc16ccd796881979b8eda4effc Mon Sep 17 00:00:00 2001 From: Zijie He Date: Mon, 27 Nov 2017 16:27:15 -0800 Subject: [PATCH] WindowFinderTest.FindConsoleWindow is flaky on Win32 ASan The root cause of the flakiness is unknown, the possible issue is that the console window running the test case is hidden or minimized. So this change adds a SetWindow(SW_MAXIMIZE) to ensure the console window is showing. I have run the tests against win_asan for hundreds times during the thanksgiving. So far, no flakiness were caught. Bug: webrtc:8568 Change-Id: Ib2c93e9bd511257213254bdaa0079c14ea50f3e4 Reviewed-on: https://webrtc-review.googlesource.com/25286 Reviewed-by: Zijie He Reviewed-by: Jamie Walch Commit-Queue: Zijie He Cr-Commit-Position: refs/heads/master@{#20902} --- modules/desktop_capture/window_finder_unittest.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/desktop_capture/window_finder_unittest.cc b/modules/desktop_capture/window_finder_unittest.cc index 1d2375e800..ccbc46956a 100644 --- a/modules/desktop_capture/window_finder_unittest.cc +++ b/modules/desktop_capture/window_finder_unittest.cc @@ -58,6 +58,9 @@ TEST(WindowFinderTest, FindConsoleWindow) { // Enlarges current console window. system("mode 1000,1000"); const HWND console_window = GetConsoleWindow(); + // Ensures that current console window is visible. + ShowWindow(console_window, SW_MAXIMIZE); + // Moves the window to the top-left of the display. MoveWindow(console_window, 0, 0, kMaxSize, kMaxSize, true); // Brings console window to top.