Index: chrome/browser/ui/cocoa/passwords/account_chooser_view_controller_unittest.mm |
diff --git a/chrome/browser/ui/cocoa/passwords/account_chooser_view_controller_unittest.mm b/chrome/browser/ui/cocoa/passwords/account_chooser_view_controller_unittest.mm |
index 667ee3e3bf61b27359f0f8bb9b3bcacbc67d5818..e1534c73a888b561e1860f516cc8abb3b8c846c2 100644 |
--- a/chrome/browser/ui/cocoa/passwords/account_chooser_view_controller_unittest.mm |
+++ b/chrome/browser/ui/cocoa/passwords/account_chooser_view_controller_unittest.mm |
@@ -212,4 +212,19 @@ TEST_F(AccountChooserViewControllerTest, ClickTitleLink) { |
atIndex:0]; |
} |
+TEST_F(AccountChooserViewControllerTest, ClosePromptAndHandleClick) { |
+ // A user may press mouse down, some navigation closes the dialog, mouse up |
+ // still sends the action. The view should not crash. |
+ PasswordDialogController::FormsVector local_forms; |
+ local_forms.push_back(Credential("pizza")); |
+ SetUpAccountChooser(std::move(local_forms), |
+ PasswordDialogController::FormsVector()); |
+ [view_controller() setBridge:nil]; |
+ [view_controller().titleView clickedOnLink:@"" atIndex:0]; |
+ [view_controller().credentialsView |
+ selectRowIndexes:[NSIndexSet indexSetWithIndex:0] |
+ byExtendingSelection:NO]; |
+ [view_controller().cancelButton performClick:nil]; |
+} |
+ |
} // namespace |