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

Unified Diff: chrome/browser/ui/cocoa/passwords/save_pending_password_view_controller_unittest.mm

Issue 1637043002: Don't try to use ManagePasswordsBubbleModel if the password bubble was closed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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: chrome/browser/ui/cocoa/passwords/save_pending_password_view_controller_unittest.mm
diff --git a/chrome/browser/ui/cocoa/passwords/save_pending_password_view_controller_unittest.mm b/chrome/browser/ui/cocoa/passwords/save_pending_password_view_controller_unittest.mm
index d4cfef7179ca8ea38e3bb4c572556ff4a50c036a..61a8f2dbc85867c210509a3f9946f208e5f733c4 100644
--- a/chrome/browser/ui/cocoa/passwords/save_pending_password_view_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/passwords/save_pending_password_view_controller_unittest.mm
@@ -32,10 +32,10 @@ class SavePendingPasswordViewControllerTest
SavePendingPasswordViewController* controller() {
if (!controller_) {
+ [delegate() setModel:GetModelAndCreateIfNull()];
controller_.reset([[SavePendingPasswordViewController alloc]
- initWithModel:GetModelAndCreateIfNull()
- delegate:delegate()]);
- [controller_ loadView];
+ initWithDelegate:delegate()]);
+ [controller_ view];
}
return controller_.get();
}
@@ -86,4 +86,16 @@ TEST_F(SavePendingPasswordViewControllerTest,
EXPECT_FALSE([controller() createPasswordView]);
}
+TEST_F(SavePendingPasswordViewControllerTest, CloseBubbleAndHandleClick) {
+ // A user may press mouse down, some navigation closes the bubble, mouse up
+ // still sends the action.
+ SetUpSavePendingState(false);
+ EXPECT_CALL(*ui_controller(), SavePassword()).Times(0);
+ EXPECT_CALL(*ui_controller(), NeverSavePassword()).Times(0);
+ [controller() bubbleWillDisappear];
+ [delegate() setModel:nil];
+ [controller().neverButton performClick:nil];
+ [controller().saveButton performClick:nil];
+}
+
} // namespace

Powered by Google App Engine
This is Rietveld 408576698