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

Side by Side Diff: components/password_manager/core/browser/password_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: Address gcasto's comments. Created 6 years, 9 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 <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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 public: 59 public:
60 MOCK_METHOD1(FillPasswordForm, void(const autofill::PasswordFormFillData&)); 60 MOCK_METHOD1(FillPasswordForm, void(const autofill::PasswordFormFillData&));
61 MOCK_METHOD0(DidLastPageLoadEncounterSSLErrors, bool()); 61 MOCK_METHOD0(DidLastPageLoadEncounterSSLErrors, bool());
62 MOCK_METHOD0(IsOffTheRecord, bool()); 62 MOCK_METHOD0(IsOffTheRecord, bool());
63 MOCK_METHOD0(GetPasswordGenerationManager, PasswordGenerationManager*()); 63 MOCK_METHOD0(GetPasswordGenerationManager, PasswordGenerationManager*());
64 MOCK_METHOD0(GetPasswordManager, PasswordManager*()); 64 MOCK_METHOD0(GetPasswordManager, PasswordManager*());
65 MOCK_METHOD0(GetAutofillManager, autofill::AutofillManager*()); 65 MOCK_METHOD0(GetAutofillManager, autofill::AutofillManager*());
66 MOCK_METHOD1(AllowPasswordGenerationForForm, void(autofill::PasswordForm*)); 66 MOCK_METHOD1(AllowPasswordGenerationForForm, void(autofill::PasswordForm*));
67 MOCK_METHOD1(AccountCreationFormsFound, 67 MOCK_METHOD1(AccountCreationFormsFound,
68 void(const std::vector<autofill::FormData>&)); 68 void(const std::vector<autofill::FormData>&));
69 MOCK_METHOD2(AcceptPasswordAutofillSuggestion,
70 void(const base::string16&, const base::string16&));
71 MOCK_METHOD0(GetPasswordAutofillManager, PasswordAutofillManager*());
Ilya Sherman 2014/03/18 00:14:27 nit: Unneeded?
Patrick Dubroy 2014/03/28 15:44:22 Yes, pure virtuals. Will fix in a future CL as men
69 }; 72 };
70 73
71 ACTION_P(InvokeConsumer, forms) { arg0->OnGetPasswordStoreResults(forms); } 74 ACTION_P(InvokeConsumer, forms) { arg0->OnGetPasswordStoreResults(forms); }
72 75
73 ACTION_P(SaveToScopedPtr, scoped) { scoped->reset(arg0); } 76 ACTION_P(SaveToScopedPtr, scoped) { scoped->reset(arg0); }
74 77
75 class TestPasswordManager : public PasswordManager { 78 class TestPasswordManager : public PasswordManager {
76 public: 79 public:
77 explicit TestPasswordManager(PasswordManagerClient* client) 80 explicit TestPasswordManager(PasswordManagerClient* client)
78 : PasswordManager(client) {} 81 : PasswordManager(client) {}
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 manager()->ProvisionallySavePassword(login_form); 608 manager()->ProvisionallySavePassword(login_form);
606 609
607 PasswordForm failed_login_form(MakeTwitterFailedLoginForm()); 610 PasswordForm failed_login_form(MakeTwitterFailedLoginForm());
608 observed.clear(); 611 observed.clear();
609 observed.push_back(failed_login_form); 612 observed.push_back(failed_login_form);
610 // A PasswordForm appears, and is visible in the layout: 613 // A PasswordForm appears, and is visible in the layout:
611 // No expected calls to the PasswordStore... 614 // No expected calls to the PasswordStore...
612 manager()->OnPasswordFormsParsed(observed); 615 manager()->OnPasswordFormsParsed(observed);
613 manager()->OnPasswordFormsRendered(observed); 616 manager()->OnPasswordFormsRendered(observed);
614 } 617 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698