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

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

Issue 2454283002: MacViews: Hide windows before closing. (Closed)
Patch Set: Fix tests. Created 4 years, 2 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
« no previous file with comments | « ui/views/cocoa/bridged_native_widget.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 85d7ec30ce630febc6aa7e13dd5f076adefcb3c6..e9242d638ca6bb2edb9c12d7b5b7bdb2dd1c07a9 100644
--- a/ui/views/widget/native_widget_mac_unittest.mm
+++ b/ui/views/widget/native_widget_mac_unittest.mm
@@ -365,9 +365,9 @@ bool GetTooltipText(const gfx::Point& p,
EXPECT_EQ(6, observer.gained_visible_count());
EXPECT_EQ(5, observer.lost_visible_count());
- // No change when closing.
+ // Closing the widget also hides it.
widget->CloseNow();
- EXPECT_EQ(5, observer.lost_visible_count());
+ EXPECT_EQ(6, observer.lost_visible_count());
EXPECT_EQ(6, observer.gained_visible_count());
}
@@ -1154,22 +1154,17 @@ explicit ParentCloseMonitor(Widget* parent) {
}
void OnWidgetDestroying(Widget* child) override {
- // Upon a parent-triggered close, the NSWindow relationship will still exist
- // (it's removed just after OnWidgetDestroying() returns). The parent should
- // still be open (children are always closed first), but not have a delegate
- // (since it is being torn down).
- EXPECT_TRUE([child->GetNativeWindow() parentWindow]);
- EXPECT_TRUE([parent_nswindow_ isVisible]);
+ // Closing the parent should hide it first, which will destroy the parent-
+ // child relationship. The parent should still be open (children are always
+ // closed first), but not have a delegate (since it is being torn down).
+ EXPECT_FALSE([child->GetNativeWindow() parentWindow]);
+ EXPECT_FALSE([parent_nswindow_ isVisible]);
EXPECT_FALSE([parent_nswindow_ delegate]);
EXPECT_FALSE(child_closed_);
}
tapted 2016/10/28 05:13:17 huh - there's not much difference between these no
void OnWidgetDestroyed(Widget* child) override {
- EXPECT_FALSE([child->GetNativeWindow() parentWindow]);
- EXPECT_TRUE([parent_nswindow_ isVisible]);
- EXPECT_FALSE([parent_nswindow_ delegate]);
-
EXPECT_FALSE(child_closed_);
child->RemoveObserver(this);
child_closed_ = true;
« no previous file with comments | « ui/views/cocoa/bridged_native_widget.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698