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

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

Issue 1961023002: Close the account chooser and auto sign-in opt in with ESC on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments 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 b6a65da1dc544a91be8fa6af767ee599c3b224b8..1b623f438e1cff994e468aa377d56055bb9204eb 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