Commit 27e05838 authored by Trent Apted's avatar Trent Apted Committed by Commit Bot

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/590332Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Commit-Queue: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#490911}
parent 9be23502
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#import "base/mac/scoped_nsobject.h" #import "base/mac/scoped_nsobject.h"
#import "base/mac/scoped_objc_class_swizzler.h" #import "base/mac/scoped_objc_class_swizzler.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/run_loop.h"
#import "ui/views/cocoa/bridged_native_widget.h" #import "ui/views/cocoa/bridged_native_widget.h"
#include "ui/views/widget/native_widget_mac.h" #include "ui/views/widget/native_widget_mac.h"
#include "ui/views/widget/root_view.h" #include "ui/views/widget/root_view.h"
...@@ -48,6 +49,12 @@ bool WidgetTest::IsNativeWindowVisible(gfx::NativeWindow window) { ...@@ -48,6 +49,12 @@ bool WidgetTest::IsNativeWindowVisible(gfx::NativeWindow window) {
// static // static
bool WidgetTest::IsWindowStackedAbove(Widget* above, Widget* below) { bool WidgetTest::IsWindowStackedAbove(Widget* above, Widget* below) {
// Since 10.13, a trip to the runloop has been necessary to ensure [NSApp
// orderedWindows] has been updated. Since tests using this are only
// concerned with relative ordering of windows in the same process, this
// shouldn't cause flakiness.
base::RunLoop().RunUntilIdle();
EXPECT_TRUE(above->IsVisible()); EXPECT_TRUE(above->IsVisible());
EXPECT_TRUE(below->IsVisible()); EXPECT_TRUE(below->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