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

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

Issue 2393843002: MacViews: Implement CloseNow() as just -[NSWindow close]. (Closed)
Patch Set: Respond to comments 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/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 0dec9ded50095c597488f9b4f621fe55f2e16cf5..85d7ec30ce630febc6aa7e13dd5f076adefcb3c6 100644
--- a/ui/views/widget/native_widget_mac_unittest.mm
+++ b/ui/views/widget/native_widget_mac_unittest.mm
@@ -1154,9 +1154,18 @@ class ParentCloseMonitor : public WidgetObserver {
}
void OnWidgetDestroying(Widget* child) override {
- // Upon a parent-triggered close, the NSWindow relationship will already be
- // removed. The parent should still be open (children are always closed
- // first), but not have a delegate (since it is being torn down).
+ // 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]);
+ EXPECT_FALSE([parent_nswindow_ delegate]);
+
+ EXPECT_FALSE(child_closed_);
+ }
+
+ void OnWidgetDestroyed(Widget* child) override {
EXPECT_FALSE([child->GetNativeWindow() parentWindow]);
EXPECT_TRUE([parent_nswindow_ isVisible]);
EXPECT_FALSE([parent_nswindow_ delegate]);
« 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