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

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

Issue 1515553006: Change password bubble for Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tiny comment update Created 5 years 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 ace1e94598a371b3460a6f03251ebe47b8ba55c7..d4cfef7179ca8ea38e3bb4c572556ff4a50c036a 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
@@ -26,7 +26,6 @@ class SavePendingPasswordViewControllerTest
void SetUp() override {
ManagePasswordsControllerTest::SetUp();
delegate_.reset([[ContentViewDelegateMock alloc] init]);
- SetUpPendingState();
}
ContentViewDelegateMock* delegate() { return delegate_.get(); }
@@ -48,6 +47,7 @@ class SavePendingPasswordViewControllerTest
TEST_F(SavePendingPasswordViewControllerTest,
ShouldSavePasswordAndDismissWhenSaveClicked) {
+ SetUpSavePendingState(false);
EXPECT_CALL(*ui_controller(), SavePassword());
EXPECT_CALL(*ui_controller(), NeverSavePassword()).Times(0);
[controller().saveButton performClick:nil];
@@ -57,6 +57,7 @@ TEST_F(SavePendingPasswordViewControllerTest,
TEST_F(SavePendingPasswordViewControllerTest,
ShouldNeverAndDismissWhenNeverClicked) {
+ SetUpSavePendingState(false);
EXPECT_CALL(*ui_controller(), SavePassword()).Times(0);
EXPECT_CALL(*ui_controller(), NeverSavePassword());
[controller().neverButton performClick:nil];
@@ -65,6 +66,7 @@ TEST_F(SavePendingPasswordViewControllerTest,
}
TEST_F(SavePendingPasswordViewControllerTest, ShouldDismissWhenCrossClicked) {
+ SetUpSavePendingState(false);
EXPECT_CALL(*ui_controller(), SavePassword()).Times(0);
EXPECT_CALL(*ui_controller(), NeverSavePassword()).Times(0);
[controller().closeButton performClick:nil];
@@ -72,4 +74,16 @@ TEST_F(SavePendingPasswordViewControllerTest, ShouldDismissWhenCrossClicked) {
EXPECT_TRUE([delegate() dismissed]);
}
+TEST_F(SavePendingPasswordViewControllerTest,
+ ShouldShowPasswordRowWhenUsernameNonEmpty) {
+ SetUpSavePendingState(false);
+ EXPECT_TRUE([controller() createPasswordView]);
+}
+
+TEST_F(SavePendingPasswordViewControllerTest,
+ ShouldNotShowPasswordRowWhenUsernameEmpty) {
+ SetUpSavePendingState(true);
+ EXPECT_FALSE([controller() createPasswordView]);
+}
+
} // namespace

Powered by Google App Engine
This is Rietveld 408576698