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

Side by Side Diff: components/autofill/browser/autofill_manager_unittest.cc

Issue 14141006: [components] Switch {RefCounted}ProfileKeyedService to use BrowserContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for review Created 7 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 <algorithm> 5 #include <algorithm>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 TestPersonalDataManager() : PersonalDataManager("en-US") { 79 TestPersonalDataManager() : PersonalDataManager("en-US") {
80 CreateTestAutofillProfiles(&web_profiles_); 80 CreateTestAutofillProfiles(&web_profiles_);
81 CreateTestCreditCards(&credit_cards_); 81 CreateTestCreditCards(&credit_cards_);
82 } 82 }
83 83
84 void SetBrowserContext(content::BrowserContext* context) { 84 void SetBrowserContext(content::BrowserContext* context) {
85 set_browser_context(context); 85 set_browser_context(context);
86 } 86 }
87 87
88 // Factory method for keyed service. PersonalDataManager is NULL for testing. 88 // Factory method for keyed service. PersonalDataManager is NULL for testing.
89 static ProfileKeyedService* Build(Profile* profile) { 89 static ProfileKeyedService* Build(content::BrowserContext* profile) {
90 return NULL; 90 return NULL;
91 } 91 }
92 92
93 MOCK_METHOD1(SaveImportedProfile, void(const AutofillProfile&)); 93 MOCK_METHOD1(SaveImportedProfile, void(const AutofillProfile&));
94 94
95 AutofillProfile* GetProfileWithGUID(const char* guid) { 95 AutofillProfile* GetProfileWithGUID(const char* guid) {
96 for (std::vector<AutofillProfile *>::iterator it = web_profiles_.begin(); 96 for (std::vector<AutofillProfile *>::iterator it = web_profiles_.begin();
97 it != web_profiles_.end(); ++it) { 97 it != web_profiles_.end(); ++it) {
98 if (!(*it)->guid().compare(guid)) 98 if (!(*it)->guid().compare(guid))
99 return *it; 99 return *it;
(...skipping 3226 matching lines...) Expand 10 before | Expand all | Expand 10 after
3326 CreateTestAddressFormData(&form); 3326 CreateTestAddressFormData(&form);
3327 std::vector<FormData> forms(1, form); 3327 std::vector<FormData> forms(1, form);
3328 FormsSeen(forms); 3328 FormsSeen(forms);
3329 const FormFieldData& field = form.fields[0]; 3329 const FormFieldData& field = form.fields[0];
3330 GetAutofillSuggestions(form, field); // should call the delegate's OnQuery() 3330 GetAutofillSuggestions(form, field); // should call the delegate's OnQuery()
3331 3331
3332 autofill_manager_->SetExternalDelegate(NULL); 3332 autofill_manager_->SetExternalDelegate(NULL);
3333 } 3333 }
3334 3334
3335 } // namespace autofill 3335 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698