OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/prefs/pref_registry_simple.h" | 8 #include "base/prefs/pref_registry_simple.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/prefs/testing_pref_service.h" | 10 #include "base/prefs/testing_pref_service.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 true); | 93 true); |
94 | 94 |
95 store_ = new MockPasswordStore; | 95 store_ = new MockPasswordStore; |
96 EXPECT_CALL(*store_.get(), ReportMetrics(_)).Times(AnyNumber()); | 96 EXPECT_CALL(*store_.get(), ReportMetrics(_)).Times(AnyNumber()); |
97 CHECK(store_->Init(syncer::SyncableService::StartSyncFlare(), "")); | 97 CHECK(store_->Init(syncer::SyncableService::StartSyncFlare(), "")); |
98 | 98 |
99 EXPECT_CALL(client_, IsPasswordManagerEnabledForCurrentPage()) | 99 EXPECT_CALL(client_, IsPasswordManagerEnabledForCurrentPage()) |
100 .WillRepeatedly(Return(true)); | 100 .WillRepeatedly(Return(true)); |
101 EXPECT_CALL(client_, IsSyncAccountCredential(_, _)) | 101 EXPECT_CALL(client_, IsSyncAccountCredential(_, _)) |
102 .WillRepeatedly(Return(false)); | 102 .WillRepeatedly(Return(false)); |
103 EXPECT_CALL(client_, GetPasswordStore()).WillRepeatedly(Return(store_)); | 103 EXPECT_CALL(client_, GetPasswordStore()) |
| 104 .WillRepeatedly(Return(store_.get())); |
104 EXPECT_CALL(client_, GetPrefs()).WillRepeatedly(Return(&prefs_)); | 105 EXPECT_CALL(client_, GetPrefs()).WillRepeatedly(Return(&prefs_)); |
105 EXPECT_CALL(client_, GetDriver()).WillRepeatedly(Return(&driver_)); | 106 EXPECT_CALL(client_, GetDriver()).WillRepeatedly(Return(&driver_)); |
106 | 107 |
107 manager_.reset(new TestPasswordManager(&client_)); | 108 manager_.reset(new TestPasswordManager(&client_)); |
108 password_autofill_manager_.reset( | 109 password_autofill_manager_.reset( |
109 new PasswordAutofillManager(&client_, NULL)); | 110 new PasswordAutofillManager(&client_, NULL)); |
110 | 111 |
111 EXPECT_CALL(driver_, GetPasswordManager()) | 112 EXPECT_CALL(driver_, GetPasswordManager()) |
112 .WillRepeatedly(Return(manager_.get())); | 113 .WillRepeatedly(Return(manager_.get())); |
113 EXPECT_CALL(driver_, GetPasswordAutofillManager()) | 114 EXPECT_CALL(driver_, GetPasswordAutofillManager()) |
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
791 observed.push_back(second_form); | 792 observed.push_back(second_form); |
792 | 793 |
793 // Verify that no prompt to save the password is shown. | 794 // Verify that no prompt to save the password is shown. |
794 EXPECT_CALL(client_, PromptUserToSavePasswordPtr(_)).Times(Exactly(0)); | 795 EXPECT_CALL(client_, PromptUserToSavePasswordPtr(_)).Times(Exactly(0)); |
795 manager()->OnPasswordFormsParsed(observed); | 796 manager()->OnPasswordFormsParsed(observed); |
796 manager()->OnPasswordFormsRendered(observed, true); | 797 manager()->OnPasswordFormsRendered(observed, true); |
797 observed.clear(); | 798 observed.clear(); |
798 } | 799 } |
799 | 800 |
800 } // namespace password_manager | 801 } // namespace password_manager |
OLD | NEW |