New issue
Advanced search Search tips

Issue 749905 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 1
Type: Bug

Blocking:
issue 748242



Sign in to add a comment

views_unittest WidgetTest.ChildStackedRelativeToParent fails on macOS 10.13

Project Member Reported by tapted@chromium.org, Jul 28 2017

Issue description

Chrome Version       : 60.0.3112.78
OS Version: OS X 10.13.0 ( developer beta 4 17A315i )

out/gn_os1013/views_unittests --gtest_filter=WidgetTest.ChildStackedRelativeToParent
Note: Google Test filter = WidgetTest.ChildStackedRelativeToParent
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from WidgetTest
[ RUN      ] WidgetTest.ChildStackedRelativeToParent
2017-07-27 17:51:20.896 views_unittests[69837:382735] *** WARNING: Textured window <NativeWidgetMacNSWindow: 0x7fd5445037c0> is getting an implicitly transparent titlebar. This will break when linking against newer SDKs. Use NSWindow's -titlebarAppearsTransparent=YES instead.
[69837:775:0727/175120.933160:76277300214371:ERROR:native_widget_mac.mm(281)] Not implemented reached in virtual void views::NativeWidgetMac::SetWindowIcons(const gfx::ImageSkia &, const gfx::ImageSkia &)
[69837:775:0727/175120.958348:76277325396776:ERROR:native_widget_mac.mm(281)] Not implemented reached in virtual void views::NativeWidgetMac::SetWindowIcons(const gfx::ImageSkia &, const gfx::ImageSkia &)
../../ui/views/widget/widget_unittest.cc:341: Failure
Value of: IsWindowStackedAbove(grandchild, child)
  Actual: false
Expected: true
[  FAILED  ] WidgetTest.ChildStackedRelativeToParent (278 ms)
[----------] 1 test from WidgetTest (278 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (278 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] WidgetTest.ChildStackedRelativeToParent


There's a simple fix - base::RunLoop().RunUntilIdle() - and it doesn't seem to be flaky, or require interactive_ui_tests.
 
Project Member

Comment 2 by bugdroid1@chromium.org, Aug 1 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/27e058389d2e581df6299b630b4ead0028cdc29a

commit 27e058389d2e581df6299b630b4ead0028cdc29a
Author: Trent Apted <tapted@chromium.org>
Date: Tue Aug 01 08:05:42 2017

Fix WidgetTest.ChildStackedRelativeToParent on 10.13

Since 10.13, a trip to the runloop seems to be been necessary to ensure
[NSApp orderedWindows] updates inside WidgetTest::IsWindowStackedAbove().
Since tests using this are only concerned with relative ordering of
windows in the same process, flushing the run queue here shouldn't cause
flakiness.

Bug:  749905 
Change-Id: I2fdd42994f759613d91458bf4c2d15cb20cf3c65
Reviewed-on: https://chromium-review.googlesource.com/590332
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#490911}
[modify] https://crrev.com/27e058389d2e581df6299b630b4ead0028cdc29a/ui/views/test/widget_test_mac.mm

Status: Fixed (was: Started)
Status: Assigned (was: Verified)
Some wild flakes appeared on 10.10, so there should be a revert CL coming in soon :(
Project Member

Comment 6 by bugdroid1@chromium.org, Aug 1 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1c83ad95c231a1673b9e3c8a61b81d5fe65a2649

commit 1c83ad95c231a1673b9e3c8a61b81d5fe65a2649
Author: Trent Apted <tapted@chromium.org>
Date: Tue Aug 01 21:42:05 2017

Revert "Fix WidgetTest.ChildStackedRelativeToParent on 10.13"

This reverts commit 27e058389d2e581df6299b630b4ead0028cdc29a.

Reason for revert: Makes the test flaky on other macOS versions

Original change's description:
> Fix WidgetTest.ChildStackedRelativeToParent on 10.13
> 
> Since 10.13, a trip to the runloop seems to be been necessary to ensure
> [NSApp orderedWindows] updates inside WidgetTest::IsWindowStackedAbove().
> Since tests using this are only concerned with relative ordering of
> windows in the same process, flushing the run queue here shouldn't cause
> flakiness.
> 
> Bug:  749905 
> Change-Id: I2fdd42994f759613d91458bf4c2d15cb20cf3c65
> Reviewed-on: https://chromium-review.googlesource.com/590332
> Reviewed-by: Robert Sesek <rsesek@chromium.org>
> Commit-Queue: Trent Apted <tapted@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#490911}

TBR=tapted@chromium.org,rsesek@chromium.org

Change-Id: I65b91a0185047ea45bfdf91d5aec4d25a722347a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug:  749905 
Reviewed-on: https://chromium-review.googlesource.com/596987
Reviewed-by: Trent Apted <tapted@chromium.org>
Commit-Queue: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491121}
[modify] https://crrev.com/1c83ad95c231a1673b9e3c8a61b81d5fe65a2649/ui/views/test/widget_test_mac.mm

So different parts of the test fail :|

  // NOTE: for aura-mus-client stacking of top-levels is not maintained in the
  // client, so z-order of top-levels can't be determined.
  const bool check_toplevel_z_order = !IsMus();
  if (check_toplevel_z_order)
*   EXPECT_TRUE(IsWindowStackedAbove(popover.get(), child));  // Flakes on 10.12 with r490911.
  EXPECT_TRUE(IsWindowStackedAbove(child, parent.get()));

  // Showing the parent again should raise it and its child above the popover.
  parent->Show();
  EXPECT_TRUE(IsWindowStackedAbove(child, parent.get()));
  if (check_toplevel_z_order)
    EXPECT_TRUE(IsWindowStackedAbove(parent.get(), popover.get()));

  // Test grandchildren.
  Widget* grandchild = CreateChildPlatformWidget(child->GetNativeView());
  grandchild->SetBounds(gfx::Rect(5, 5, 15, 10));
  grandchild->ShowInactive();
  EXPECT_TRUE(IsWindowStackedAbove(grandchild, child));
  EXPECT_TRUE(IsWindowStackedAbove(child, parent.get()));
  if (check_toplevel_z_order)
    EXPECT_TRUE(IsWindowStackedAbove(parent.get(), popover.get()));

  popover->Show();
  if (check_toplevel_z_order)
*   EXPECT_TRUE(IsWindowStackedAbove(popover.get(), grandchild));  // Flakes on 10.12 with r490911 (less often).
  EXPECT_TRUE(IsWindowStackedAbove(grandchild, child));

  parent->Show();
* EXPECT_TRUE(IsWindowStackedAbove(grandchild, child));  // Fails reliably on 10.13 without r490911.
  if (check_toplevel_z_order)
    EXPECT_TRUE(IsWindowStackedAbove(child, popover.get()));
Components: Internals>Views
Cc: linds...@chromium.org
Mac CQ will be upgraded to 10.13 over the coming 3-4 weeks. Please see issue 805475 for more details. Please resolve 10.13 blockers asap. 
tapted@: are you likely to have cycles to work on this? if not, please assign it back to me and I'll work on it :)
Cc: ellyjo...@chromium.org
@tapted the mac CQ migration is starting, please do let us know if you'll be able to address this over the next week and a half?
Status: Started (was: Assigned)
https://chromium-review.googlesource.com/899806
Project Member

Comment 13 by bugdroid1@chromium.org, Feb 6 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3aa7e6681182857771f75ef57bcd4b7ac6921612

commit 3aa7e6681182857771f75ef57bcd4b7ac6921612
Author: Trent Apted <tapted@chromium.org>
Date: Tue Feb 06 02:00:01 2018

Fix WidgetTest.ChildStackedRelativeToParent on 10.13

Since 10.13, a trip to the runloop seems to be been necessary to ensure
[NSApp orderedWindows] updates inside WidgetTest::IsWindowStackedAbove().

Unforunately, flushing the runloop exposes the test to window server
events which can cause asynchronous activation events to be interleaved
with other parts of the test. To deflake, run the test interactively,
and sync with the window server whenever a new window is raised.

Earlier attempt in https://crrev.com/c/590332 caused flakes on 10.12.

Bug:  749905 
Change-Id: Ifde8800e0966233cfeea41515b66b0fc2926317d
Reviewed-on: https://chromium-review.googlesource.com/899806
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534582}
[modify] https://crrev.com/3aa7e6681182857771f75ef57bcd4b7ac6921612/ui/views/test/widget_test.cc
[modify] https://crrev.com/3aa7e6681182857771f75ef57bcd4b7ac6921612/ui/views/test/widget_test.h
[modify] https://crrev.com/3aa7e6681182857771f75ef57bcd4b7ac6921612/ui/views/test/widget_test_mac.mm
[modify] https://crrev.com/3aa7e6681182857771f75ef57bcd4b7ac6921612/ui/views/widget/widget_interactive_uitest.cc
[modify] https://crrev.com/3aa7e6681182857771f75ef57bcd4b7ac6921612/ui/views/widget/widget_unittest.cc

Status: Fixed (was: Started)

Sign in to add a comment