Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Side by Side Diff: components/password_manager/core/browser/password_form_manager_unittest.cc

Issue 184103016: Autofill: Refactoring to support fetching password after a username is selected (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Actually fix compile failure. Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "base/message_loop/message_loop.h" 6 #include "base/message_loop/message_loop.h"
7 #include "base/prefs/pref_registry_simple.h" 7 #include "base/prefs/pref_registry_simple.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/prefs/testing_pref_service.h" 9 #include "base/prefs/testing_pref_service.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 public: 48 public:
49 MockPasswordManagerDriver() {} 49 MockPasswordManagerDriver() {}
50 virtual ~MockPasswordManagerDriver() {} 50 virtual ~MockPasswordManagerDriver() {}
51 51
52 MOCK_METHOD1(FillPasswordForm, void(const autofill::PasswordFormFillData&)); 52 MOCK_METHOD1(FillPasswordForm, void(const autofill::PasswordFormFillData&));
53 MOCK_METHOD0(DidLastPageLoadEncounterSSLErrors, bool()); 53 MOCK_METHOD0(DidLastPageLoadEncounterSSLErrors, bool());
54 MOCK_METHOD0(IsOffTheRecord, bool()); 54 MOCK_METHOD0(IsOffTheRecord, bool());
55 MOCK_METHOD0(GetPasswordGenerationManager, PasswordGenerationManager*()); 55 MOCK_METHOD0(GetPasswordGenerationManager, PasswordGenerationManager*());
56 MOCK_METHOD0(GetPasswordManager, PasswordManager*()); 56 MOCK_METHOD0(GetPasswordManager, PasswordManager*());
57 MOCK_METHOD0(GetAutofillManager, autofill::AutofillManager*()); 57 MOCK_METHOD0(GetAutofillManager, autofill::AutofillManager*());
58 MOCK_METHOD0(GetPasswordAutofillManager, PasswordAutofillManager*());
58 MOCK_METHOD1(AllowPasswordGenerationForForm, void(autofill::PasswordForm*)); 59 MOCK_METHOD1(AllowPasswordGenerationForForm, void(autofill::PasswordForm*));
59 MOCK_METHOD1(AccountCreationFormsFound, 60 MOCK_METHOD1(AccountCreationFormsFound,
60 void(const std::vector<autofill::FormData>&)); 61 void(const std::vector<autofill::FormData>&));
62 MOCK_METHOD2(AcceptPasswordAutofillSuggestion,
63 void(const base::string16&, const base::string16&));
61 }; 64 };
62 65
63 class TestPasswordManagerClient : public StubPasswordManagerClient { 66 class TestPasswordManagerClient : public StubPasswordManagerClient {
64 public: 67 public:
65 explicit TestPasswordManagerClient(PasswordStore* password_store) 68 explicit TestPasswordManagerClient(PasswordStore* password_store)
66 : password_store_(password_store) { 69 : password_store_(password_store) {
67 prefs_.registry()->RegisterBooleanPref(prefs::kPasswordManagerEnabled, 70 prefs_.registry()->RegisterBooleanPref(prefs::kPasswordManagerEnabled,
68 true); 71 true);
69 } 72 }
70 73
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 complete_form, PasswordFormManager::IGNORE_OTHER_POSSIBLE_USERNAMES); 699 complete_form, PasswordFormManager::IGNORE_OTHER_POSSIBLE_USERNAMES);
697 // By now that form has been used once. 700 // By now that form has been used once.
698 complete_form.times_used = 1; 701 complete_form.times_used = 1;
699 702
700 // Check that PasswordStore receives an update request with the complete form. 703 // Check that PasswordStore receives an update request with the complete form.
701 EXPECT_CALL(*mock_store(), UpdateLogin(complete_form)); 704 EXPECT_CALL(*mock_store(), UpdateLogin(complete_form));
702 form_manager.Save(); 705 form_manager.Save();
703 } 706 }
704 707
705 } // namespace password_manager 708 } // namespace password_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698