Chromium Code Reviews| Index: chrome/browser/ui/cocoa/passwords/update_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/update_pending_password_view_controller_unittest.mm |
| similarity index 53% |
| copy from chrome/browser/ui/cocoa/passwords/save_pending_password_view_controller_unittest.mm |
| copy to chrome/browser/ui/cocoa/passwords/update_pending_password_view_controller_unittest.mm |
| index ace1e94598a371b3460a6f03251ebe47b8ba55c7..8b51c39aa92f8a976304be67fd8cbb28163447be 100644 |
| --- a/chrome/browser/ui/cocoa/passwords/save_pending_password_view_controller_unittest.mm |
| +++ b/chrome/browser/ui/cocoa/passwords/update_pending_password_view_controller_unittest.mm |
| @@ -1,4 +1,4 @@ |
| -// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| @@ -10,7 +10,7 @@ |
| #import "chrome/browser/ui/cocoa/bubble_combobox.h" |
| #include "chrome/browser/ui/cocoa/cocoa_test_helper.h" |
| #include "chrome/browser/ui/cocoa/passwords/base_passwords_controller_test.h" |
| -#import "chrome/browser/ui/cocoa/passwords/save_pending_password_view_controller.h" |
| +#import "chrome/browser/ui/cocoa/passwords/update_pending_password_view_controller.h" |
| #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" |
| #include "chrome/browser/ui/passwords/manage_passwords_ui_controller_mock.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| @@ -18,22 +18,22 @@ |
| namespace { |
| -class SavePendingPasswordViewControllerTest |
| +class UpdatePendingPasswordViewControllerTest |
| : public ManagePasswordsControllerTest { |
| public: |
| - SavePendingPasswordViewControllerTest() {} |
| + UpdatePendingPasswordViewControllerTest() {} |
| void SetUp() override { |
| ManagePasswordsControllerTest::SetUp(); |
| delegate_.reset([[ContentViewDelegateMock alloc] init]); |
| - SetUpPendingState(); |
| + SetUpPendingState(false); |
| } |
| ContentViewDelegateMock* delegate() { return delegate_.get(); } |
| - SavePendingPasswordViewController* controller() { |
| + UpdatePendingPasswordViewController* controller() { |
| if (!controller_) { |
| - controller_.reset([[SavePendingPasswordViewController alloc] |
| + controller_.reset([[UpdatePendingPasswordViewController alloc] |
| initWithModel:GetModelAndCreateIfNull() |
| delegate:delegate()]); |
| [controller_ loadView]; |
| @@ -42,31 +42,31 @@ class SavePendingPasswordViewControllerTest |
| } |
| private: |
| - base::scoped_nsobject<SavePendingPasswordViewController> controller_; |
| + base::scoped_nsobject<UpdatePendingPasswordViewController> controller_; |
| base::scoped_nsobject<ContentViewDelegateMock> delegate_; |
| }; |
| -TEST_F(SavePendingPasswordViewControllerTest, |
| - ShouldSavePasswordAndDismissWhenSaveClicked) { |
| - EXPECT_CALL(*ui_controller(), SavePassword()); |
| - EXPECT_CALL(*ui_controller(), NeverSavePassword()).Times(0); |
| - [controller().saveButton performClick:nil]; |
| +TEST_F(UpdatePendingPasswordViewControllerTest, |
| + ShouldUpdatePasswordAndDismissWhenUpdateClicked) { |
| + EXPECT_CALL(*ui_controller(), UpdatePassword(testing::_)); |
|
vasilii
2015/12/15 15:58:02
testing:: is excessive.
dvadym
2015/12/16 14:16:31
Done.
|
| + EXPECT_CALL(*ui_controller(), OnNopeUpdateClicked()).Times(0); |
| + [controller().updateButton performClick:nil]; |
| EXPECT_TRUE([delegate() dismissed]); |
| } |
| -TEST_F(SavePendingPasswordViewControllerTest, |
| - ShouldNeverAndDismissWhenNeverClicked) { |
| - EXPECT_CALL(*ui_controller(), SavePassword()).Times(0); |
| - EXPECT_CALL(*ui_controller(), NeverSavePassword()); |
| - [controller().neverButton performClick:nil]; |
| +TEST_F(UpdatePendingPasswordViewControllerTest, |
| + ShouldNopeAndDismissWhenNopeClicked) { |
| + EXPECT_CALL(*ui_controller(), UpdatePassword(testing::_)).Times(0); |
| + EXPECT_CALL(*ui_controller(), OnNopeUpdateClicked()); |
| + [controller().noButton performClick:nil]; |
| EXPECT_TRUE([delegate() dismissed]); |
| } |
| -TEST_F(SavePendingPasswordViewControllerTest, ShouldDismissWhenCrossClicked) { |
| - EXPECT_CALL(*ui_controller(), SavePassword()).Times(0); |
| - EXPECT_CALL(*ui_controller(), NeverSavePassword()).Times(0); |
| +TEST_F(UpdatePendingPasswordViewControllerTest, ShouldDismissWhenCrossClicked) { |
| + EXPECT_CALL(*ui_controller(), UpdatePassword(testing::_)).Times(0); |
| + EXPECT_CALL(*ui_controller(), OnNopeUpdateClicked()).Times(0); |
| [controller().closeButton performClick:nil]; |
| EXPECT_TRUE([delegate() dismissed]); |