Commit 4c433702 authored by Ahmed Fakhry's avatar Ahmed Fakhry Committed by Commit Bot

Fix flaky test DesksWindowCyclingTest.CycleShowsAllDesksWindows

Since the WindowCycleView is owned by the Views hierarchy, its
Layout() may get called even after WindowCycleList is destroyed.
This CL fixes the crash by making sure Layout() returns early
in such situation.

BUG=1013174
TEST=Run test with --gtest_repeat=20, no flakes at all.

Change-Id: I6b2e66ac9695f27de2969b7c4fb6729b43db79f9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1873087Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Ahmed Fakhry <afakhry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708039}
parent 380c408a
......@@ -693,13 +693,7 @@ class DesksWindowCyclingTest : public WindowCycleControllerTest {
DISALLOW_COPY_AND_ASSIGN(DesksWindowCyclingTest);
};
// https://crbug.com/1013174
#if defined(OS_CHROMEOS)
#define MAYBE_CycleShowsAllDesksWindows DISABLED_CycleShowsAllDesksWindows
#else
#define MAYBE_CycleShowsAllDesksWindows CycleShowsAllDesksWindows
#endif
TEST_F(DesksWindowCyclingTest, MAYBE_CycleShowsAllDesksWindows) {
TEST_F(DesksWindowCyclingTest, CycleShowsAllDesksWindows) {
// Create two desks with two windows in each.
auto win0 = CreateAppWindow(gfx::Rect(0, 0, 250, 100));
auto win1 = CreateAppWindow(gfx::Rect(50, 50, 200, 200));
......
......@@ -318,6 +318,7 @@ class WindowCycleView : public views::WidgetDelegateView {
void DestroyContents() {
window_view_map_.clear();
target_window_ = nullptr;
RemoveAllChildViews(true);
}
......
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