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/passwords/manage_passwords_bubble_model.h" | 5 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 103 |
104 void SetUp() override { | 104 void SetUp() override { |
105 test_web_contents_.reset( | 105 test_web_contents_.reset( |
106 content::WebContentsTester::CreateTestWebContents(&profile_, nullptr)); | 106 content::WebContentsTester::CreateTestWebContents(&profile_, nullptr)); |
107 mock_delegate_.reset(new testing::StrictMock<PasswordsModelDelegateMock>); | 107 mock_delegate_.reset(new testing::StrictMock<PasswordsModelDelegateMock>); |
108 PasswordStoreFactory::GetInstance()->SetTestingFactoryAndUse( | 108 PasswordStoreFactory::GetInstance()->SetTestingFactoryAndUse( |
109 profile(), | 109 profile(), |
110 password_manager::BuildPasswordStore< | 110 password_manager::BuildPasswordStore< |
111 content::BrowserContext, | 111 content::BrowserContext, |
112 testing::StrictMock<password_manager::MockPasswordStore>>); | 112 testing::StrictMock<password_manager::MockPasswordStore>>); |
113 EXPECT_CALL(*GetStore(), FillAutofillableLogins(_)); | |
114 } | 113 } |
115 | 114 |
116 void TearDown() override { | 115 void TearDown() override { |
117 // Reset the delegate first. It can happen if the user closes the tab. | 116 // Reset the delegate first. It can happen if the user closes the tab. |
118 mock_delegate_.reset(); | 117 mock_delegate_.reset(); |
119 model_.reset(); | 118 model_.reset(); |
120 } | 119 } |
121 | 120 |
122 PrefService* prefs() { return profile_.GetPrefs(); } | 121 PrefService* prefs() { return profile_.GetPrefs(); } |
123 | 122 |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 | 466 |
468 EXPECT_CALL(*controller(), NavigateToPasswordManagerSettingsPage()); | 467 EXPECT_CALL(*controller(), NavigateToPasswordManagerSettingsPage()); |
469 | 468 |
470 model()->OnManageLinkClicked(); | 469 model()->OnManageLinkClicked(); |
471 } | 470 } |
472 | 471 |
473 INSTANTIATE_TEST_CASE_P(Default, | 472 INSTANTIATE_TEST_CASE_P(Default, |
474 ManagePasswordsBubbleModelManageLinkTest, | 473 ManagePasswordsBubbleModelManageLinkTest, |
475 ::testing::Values(TestSyncService::SyncedTypes::ALL, | 474 ::testing::Values(TestSyncService::SyncedTypes::ALL, |
476 TestSyncService::SyncedTypes::NONE)); | 475 TestSyncService::SyncedTypes::NONE)); |
OLD | NEW |