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

Unified Diff: ui/views/widget/native_widget_mac_unittest.mm

Issue 2535163002: MacViews: Fix Widget::GetAllChildWidgets(gfx::NativeView) for non-Widgets. (Closed)
Patch Set: respond to comments Created 4 years, 1 month 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
« no previous file with comments | « ui/views/widget/native_widget_mac.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/native_widget_mac_unittest.mm
diff --git a/ui/views/widget/native_widget_mac_unittest.mm b/ui/views/widget/native_widget_mac_unittest.mm
index 1e0544d2fe7df5989b403b66a699f55c8bfb6079..a33c739a5c7a210c85ef646a80342e8b6ce4e719 100644
--- a/ui/views/widget/native_widget_mac_unittest.mm
+++ b/ui/views/widget/native_widget_mac_unittest.mm
@@ -692,6 +692,11 @@ Widget* AttachPopupToNativeParent(NSWindow* native_parent) {
// Tests creating a views::Widget parented off a native NSWindow.
TEST_F(NativeWidgetMacTest, NonWidgetParent) {
NSWindow* native_parent = MakeNativeParent();
+
+ Widget::Widgets children;
+ Widget::GetAllChildWidgets([native_parent contentView], &children);
+ EXPECT_TRUE(children.empty());
+
Widget* child = AttachPopupToNativeParent(native_parent);
TestWidgetObserver child_observer(child);
@@ -719,6 +724,10 @@ TEST_F(NativeWidgetMacTest, NonWidgetParent) {
[[native_parent childWindows] objectAtIndex:0]);
EXPECT_EQ(native_parent, [child->GetNativeWindow() parentWindow]);
+ Widget::GetAllChildWidgets([native_parent contentView], &children);
+ ASSERT_EQ(1u, children.size());
+ EXPECT_EQ(child, *children.begin());
+
// Only non-toplevel Widgets are positioned relative to the parent, so the
// bounds set above should be in screen coordinates.
EXPECT_EQ(child_bounds, child->GetWindowBoundsInScreen());
« no previous file with comments | « ui/views/widget/native_widget_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698