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

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

Issue 1968463002: Close the account chooser and auto sign-in opt in with ESC on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 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/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 4629120b71d1402b278088d585e7da12df661661..5a9cc5d3b569e80f09f50a4c334097cff0c9c3b0 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
@@ -6,6 +6,8 @@
#include <utility>
+#include <Carbon/Carbon.h>
+
#include "base/mac/foundation_util.h"
#include "base/mac/scoped_nsobject.h"
#include "base/strings/string16.h"
@@ -20,6 +22,7 @@
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/gtest_mac.h"
+#import "ui/events/test/cocoa_test_event_utils.h"
#include "url/gurl.h"
#include "url/origin.h"
@@ -231,4 +234,14 @@ TEST_F(AccountChooserViewControllerTest, ClosePromptAndHandleClick) {
[view_controller().cancelButton performClick:nil];
}
+TEST_F(AccountChooserViewControllerTest, CloseOnEsc) {
+ PasswordDialogController::FormsVector local_forms;
+ local_forms.push_back(Credential("pizza"));
+ SetUpAccountChooser(&local_forms);
+ EXPECT_CALL(*this, OnPerformClose());
+ [[view_controller() view]
+ performKeyEquivalent:cocoa_test_event_utils::KeyEventWithKeyCode(
+ kVK_Escape, '\e', NSKeyDown, 0)];
+}
+
} // namespace

Powered by Google App Engine
This is Rietveld 408576698