Commit 5fb59a6b authored by Elly Fong-Jones's avatar Elly Fong-Jones Committed by Chromium LUCI CQ

views: undo Mac11 sheet visual effect hack in tests

Since r798292 NativeWidgetMacTest.WindowModalSheet has checked for
the presence of a special child window that macOS 11 splices into the
window tree to do the "blur" sheet visual effect. During one of the
later betas it appears that the system stopped adding this child
window, which broke this test.

Bug: 1169225
Change-Id: I8a31e8c6b9ab31c54c9f1a7f819510c1175ea23c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2643517Reviewed-by: default avatarLeonard Grey <lgrey@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845810}
parent e3b5f80a
......@@ -1225,19 +1225,6 @@ TEST_F(NativeWidgetMacTest, ShowAnimationControl) {
EXPECT_FALSE([retained_animation isAnimating]);
}
// Expect that |children|, the list of child windows of a window that has a
// sheet open, is logically empty. "Logically empty" accounts for the
// AppKit-created visual effect window that shows atop windows with open sheets
// on macOS 11.
void AssertNoChildrenForWindowWithSheet(NSArray<NSWindow*>* children) {
if (base::mac::IsAtLeastOS11()) {
ASSERT_EQ(1u, children.count);
EXPECT_NSEQ(@"NSSheetEffectDimmingWindow", children[0].className);
} else {
ASSERT_EQ(0u, children.count);
}
}
// Tests behavior of window-modal dialogs, displayed as sheets.
#if defined(ARCH_CPU_ARM64)
// Bulk-disabled as part of arm64 bot stabilization: https://crbug.com/1154345
......@@ -1301,7 +1288,7 @@ TEST_F(NativeWidgetMacTest, MAYBE_WindowModalSheet) {
ASSERT_EQ(2u, children.size());
EXPECT_TRUE(children.count(sheet_widget));
AssertNoChildrenForWindowWithSheet(native_parent.childWindows);
ASSERT_EQ(0U, native_parent.childWindows.count);
// Modal, so the close button in the parent window should get disabled.
EXPECT_FALSE([parent_close_button isEnabled]);
......@@ -1324,7 +1311,7 @@ TEST_F(NativeWidgetMacTest, MAYBE_WindowModalSheet) {
widget_observer.WaitForVisibleCounts(1, 1);
EXPECT_FALSE(sheet_widget->IsVisible());
[native_parent makeKeyAndOrderFront:nil];
AssertNoChildrenForWindowWithSheet(native_parent.childWindows);
ASSERT_EQ(0u, native_parent.childWindows.count);
widget_observer.WaitForVisibleCounts(2, 1);
EXPECT_TRUE(sheet_widget->IsVisible());
......
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