Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(727)

Unified Diff: ui/views/test/widget_test_mac.mm

Issue 831643004: MacViews: Fix child window z-order and SetBounds (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ShowInactive for a more compelling test Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/views/test/widget_test_mac.mm
diff --git a/ui/views/test/widget_test_mac.mm b/ui/views/test/widget_test_mac.mm
index 3a3017bf9fe53b5df94e1dcfdfe573e80516551f..22a5929f21597847612c96b760e8fd768b1f975e 100644
--- a/ui/views/test/widget_test_mac.mm
+++ b/ui/views/test/widget_test_mac.mm
@@ -27,6 +27,25 @@ bool WidgetTest::IsNativeWindowVisible(gfx::NativeWindow window) {
}
// static
+bool WidgetTest::IsWindowStackedAbove(Widget* above, Widget* below) {
+ CHECK(above->IsVisible());
+ CHECK(below->IsVisible());
+
+ // -[NSApplication orderedWindows] are ordered front-to-back.
+ NSWindow* first = above->GetNativeWindow();
+ NSWindow* second = below->GetNativeWindow();
+
+ for (NSWindow* window in [NSApp orderedWindows]) {
+ if (window == second)
+ return !first;
+
+ if (window == first)
+ first = nil;
+ }
+ return false;
+}
+
+// static
ui::EventProcessor* WidgetTest::GetEventProcessor(Widget* widget) {
return static_cast<internal::RootView*>(widget->GetRootView());
}

Powered by Google App Engine
This is Rietveld 408576698