Commit b5e4c43e authored by Michael Kolomeytsev's avatar Michael Kolomeytsev Committed by Chromium LUCI CQ

Fix flaky test SessionRestoreTest.RestoreMinimizedWindow.

The test checks window activity which in turn depends on a focus
given by OS windowing system.
Being run in parallel with other tests it looses the focus very quickly.
So the test should be moved to interactive_ui_tests.

Bug: 1080602
Change-Id: I39cd0afb41f2841fda467ee1ae89e3ff0dd083bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2593370
Commit-Queue: Alexander Dunaev <adunaev@igalia.com>
Reviewed-by: default avatarFrançois Doray <fdoray@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#837448}
parent a4230ab6
...@@ -698,6 +698,7 @@ Michael Cirone <mikecirone@gmail.com> ...@@ -698,6 +698,7 @@ Michael Cirone <mikecirone@gmail.com>
Michael Constant <mconst@gmail.com> Michael Constant <mconst@gmail.com>
Michael Forney <mforney@mforney.org> Michael Forney <mforney@mforney.org>
Michael Gilbert <floppymaster@gmail.com> Michael Gilbert <floppymaster@gmail.com>
Michael Kolomeytsev <michael.kolomeytsev@gmail.com>
Michael Lopez <lopes92290@gmail.com> Michael Lopez <lopes92290@gmail.com>
Michael Morrison <codebythepound@gmail.com> Michael Morrison <codebythepound@gmail.com>
Michael Müller <michael@fds-team.de> Michael Müller <michael@fds-team.de>
......
...@@ -375,36 +375,6 @@ IN_PROC_BROWSER_TEST_F(SessionRestoreTest, RestoredTabsShouldHaveWindow) { ...@@ -375,36 +375,6 @@ IN_PROC_BROWSER_TEST_F(SessionRestoreTest, RestoredTabsShouldHaveWindow) {
} }
} }
// Verify that restoring a minimized window does not create a blank window.
// Regression test for https://crbug.com/1018885.
// TODO(1080602): Flaky on Windows and Linux.
#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS)
#define MAYBE_RestoreMinimizedWindow DISABLED_RestoreMinimizedWindow
#else
#define MAYBE_RestoreMinimizedWindow RestoreMinimizedWindow
#endif
IN_PROC_BROWSER_TEST_F(SessionRestoreTest, MAYBE_RestoreMinimizedWindow) {
// Minimize the window.
browser()->window()->Minimize();
// Restart and session restore the tabs.
Browser* restored = QuitBrowserAndRestore(browser(), 3);
EXPECT_EQ(1, restored->tab_strip_model()->count());
#if defined(OS_MAC)
// On macOS, minimized windows are neither active nor shown, to avoid causing
// space switches during session restore.
EXPECT_FALSE(restored->window()->IsActive());
EXPECT_FALSE(restored->window()->IsVisible());
#else
// Expect the window to be visible.
// Prior to the fix for https://crbug.com/1018885, the window was active but
// not visible.
EXPECT_TRUE(restored->window()->IsActive());
EXPECT_TRUE(restored->window()->IsVisible());
#endif
}
// Verify that restored tabs have correct disposition. Only one tab should // Verify that restored tabs have correct disposition. Only one tab should
// have "visible" visibility state, the rest should not. // have "visible" visibility state, the rest should not.
// (http://crbug.com/155365 http://crbug.com/118269) // (http://crbug.com/155365 http://crbug.com/118269)
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "build/build_config.h"
#include "build/chromeos_buildflags.h" #include "build/chromeos_buildflags.h"
#include "chrome/browser/prefs/session_startup_pref.h" #include "chrome/browser/prefs/session_startup_pref.h"
#include "chrome/browser/sessions/session_restore_test_helper.h" #include "chrome/browser/sessions/session_restore_test_helper.h"
...@@ -9,6 +10,7 @@ ...@@ -9,6 +10,7 @@
#include "chrome/browser/sessions/session_service_test_helper.h" #include "chrome/browser/sessions/session_service_test_helper.h"
#include "chrome/browser/ui/browser_commands.h" #include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h" #include "chrome/test/base/ui_test_utils.h"
#include "components/keep_alive_registry/keep_alive_types.h" #include "components/keep_alive_registry/keep_alive_types.h"
...@@ -100,3 +102,35 @@ IN_PROC_BROWSER_TEST_F(SessionRestoreInteractiveTest, MAYBE_FocusOnLaunch) { ...@@ -100,3 +102,35 @@ IN_PROC_BROWSER_TEST_F(SessionRestoreInteractiveTest, MAYBE_FocusOnLaunch) {
->GetRenderWidgetHostView() ->GetRenderWidgetHostView()
->HasFocus()); ->HasFocus());
} }
// TODO(https://crbug.com/1152160): Enable RestoreMinimizedWindow on Lacros
// builds.
#if BUILDFLAG(IS_CHROMEOS_LACROS)
#define MAYBE_RestoreMinimizedWindow DISABLED_RestoreMinimizedWindow
#else
#define MAYBE_RestoreMinimizedWindow RestoreMinimizedWindow
#endif
// Verify that restoring a minimized window does not create a blank window.
// Regression test for https://crbug.com/1018885.
IN_PROC_BROWSER_TEST_F(SessionRestoreInteractiveTest,
MAYBE_RestoreMinimizedWindow) {
// Minimize the window.
browser()->window()->Minimize();
// Restart and session restore the tabs.
Browser* restored = QuitBrowserAndRestore(browser(), 3);
EXPECT_EQ(1, restored->tab_strip_model()->count());
#if defined(OS_MAC)
// On macOS, minimized windows are neither active nor shown, to avoid causing
// space switches during session restore.
EXPECT_FALSE(restored->window()->IsActive());
EXPECT_FALSE(restored->window()->IsVisible());
#else
// Expect the window to be visible.
// Prior to the fix for https://crbug.com/1018885, the window was active but
// not visible.
EXPECT_TRUE(restored->window()->IsActive());
EXPECT_TRUE(restored->window()->IsVisible());
#endif
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment