| 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
|
|
|