OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/cocoa/passwords/base_passwords_controller_test.h" | 5 #include "chrome/browser/ui/cocoa/passwords/base_passwords_controller_test.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/password_manager/password_store_factory.h" | 8 #include "chrome/browser/password_manager/password_store_factory.h" |
9 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller_mock.h" | 9 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller_mock.h" |
10 #include "components/password_manager/core/browser/mock_password_store.h" | 10 #include "components/password_manager/core/browser/mock_password_store.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 std::vector<const autofill::PasswordForm*> forms; | 96 std::vector<const autofill::PasswordForm*> forms; |
97 EXPECT_CALL(*ui_controller_, GetCurrentForms()).WillOnce(ReturnRef(forms)); | 97 EXPECT_CALL(*ui_controller_, GetCurrentForms()).WillOnce(ReturnRef(forms)); |
98 GURL origin(kSiteOrigin); | 98 GURL origin(kSiteOrigin); |
99 EXPECT_CALL(*ui_controller_, GetOrigin()).WillOnce(ReturnRef(origin)); | 99 EXPECT_CALL(*ui_controller_, GetOrigin()).WillOnce(ReturnRef(origin)); |
100 EXPECT_CALL(*ui_controller_, GetState()) | 100 EXPECT_CALL(*ui_controller_, GetState()) |
101 .WillOnce(Return(password_manager::ui::MANAGE_STATE)); | 101 .WillOnce(Return(password_manager::ui::MANAGE_STATE)); |
102 GetModelAndCreateIfNull(); | 102 GetModelAndCreateIfNull(); |
103 ASSERT_TRUE(testing::Mock::VerifyAndClearExpectations(ui_controller_)); | 103 ASSERT_TRUE(testing::Mock::VerifyAndClearExpectations(ui_controller_)); |
104 } | 104 } |
105 | 105 |
106 void ManagePasswordsControllerTest::SetUpAccountChooser( | |
107 ScopedVector<const autofill::PasswordForm> local, | |
108 ScopedVector<const autofill::PasswordForm> federations) { | |
109 EXPECT_CALL(*ui_controller_, GetCurrentForms()) | |
110 .WillOnce(ReturnRef(local.get())); | |
111 EXPECT_CALL(*ui_controller_, GetFederatedForms()) | |
112 .WillOnce(ReturnRef(federations.get())); | |
113 EXPECT_CALL(*ui_controller_, GetState()) | |
114 .WillOnce(Return(password_manager::ui::CREDENTIAL_REQUEST_STATE)); | |
115 GURL origin(kSiteOrigin); | |
116 EXPECT_CALL(*ui_controller_, GetOrigin()).WillOnce(ReturnRef(origin)); | |
117 GetModelAndCreateIfNull(); | |
118 ASSERT_TRUE(testing::Mock::VerifyAndClearExpectations(ui_controller_)); | |
119 } | |
120 | |
121 ManagePasswordsBubbleModel::DisplayReason | 106 ManagePasswordsBubbleModel::DisplayReason |
122 ManagePasswordsControllerTest::GetDisplayReason() const { | 107 ManagePasswordsControllerTest::GetDisplayReason() const { |
123 return ManagePasswordsBubbleModel::AUTOMATIC; | 108 return ManagePasswordsBubbleModel::AUTOMATIC; |
124 } | 109 } |
125 | 110 |
126 @implementation ContentViewDelegateMock | 111 @implementation ContentViewDelegateMock |
127 | 112 |
128 @synthesize dismissed = _dismissed; | 113 @synthesize dismissed = _dismissed; |
129 | 114 |
130 - (void)viewShouldDismiss { | 115 - (void)viewShouldDismiss { |
131 _dismissed = YES; | 116 _dismissed = YES; |
132 } | 117 } |
133 | 118 |
134 @end | 119 @end |
OLD | NEW |