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

Unified Diff: chrome/browser/ui/cocoa/passwords/update_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
« no previous file with comments | « chrome/browser/ui/cocoa/passwords/update_pending_password_view_controller.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/passwords/update_pending_password_view_controller_unittest.mm
diff --git a/chrome/browser/ui/cocoa/passwords/update_pending_password_view_controller_unittest.mm b/chrome/browser/ui/cocoa/passwords/update_pending_password_view_controller_unittest.mm
index ac3df4c327adbe61e37d36dd39a0bd7a009dc514..73efa298a03a8296295aa62a8f701a2fd21f2aeb 100644
--- a/chrome/browser/ui/cocoa/passwords/update_pending_password_view_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/passwords/update_pending_password_view_controller_unittest.mm
@@ -36,10 +36,10 @@ class UpdatePendingPasswordViewControllerTest
UpdatePendingPasswordViewController* controller() {
if (!controller_) {
+ [delegate() setModel:GetModelAndCreateIfNull()];
controller_.reset([[UpdatePendingPasswordViewController alloc]
- initWithModel:GetModelAndCreateIfNull()
- delegate:delegate()]);
- [controller_ loadView];
+ initWithDelegate:delegate()]);
+ [controller_ view];
}
return controller_.get();
}
@@ -92,4 +92,16 @@ TEST_F(UpdatePendingPasswordViewControllerTest,
[[controller() createPasswordView] class]);
}
+TEST_F(UpdatePendingPasswordViewControllerTest, CloseBubbleAndHandleClick) {
+ // A user may press mouse down, some navigation closes the bubble, mouse up
+ // still sends the action.
+ SetUpUpdatePendingState(false);
+ EXPECT_CALL(*ui_controller(), UpdatePassword(_)).Times(0);
+ EXPECT_CALL(*ui_controller(), OnNopeUpdateClicked()).Times(0);
+ [controller() bubbleWillDisappear];
+ [delegate() setModel:nil];
+ [controller().updateButton performClick:nil];
+ [controller().noButton performClick:nil];
+}
+
} // namespace
« no previous file with comments | « chrome/browser/ui/cocoa/passwords/update_pending_password_view_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698