OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 | 77 |
78 void SetBrowserContext(content::BrowserContext* context) { | 78 void SetBrowserContext(content::BrowserContext* context) { |
79 set_browser_context(context); | 79 set_browser_context(context); |
80 } | 80 } |
81 | 81 |
82 // Factory method for keyed service. PersonalDataManager is NULL for testing. | 82 // Factory method for keyed service. PersonalDataManager is NULL for testing. |
83 static BrowserContextKeyedService* Build(content::BrowserContext* profile) { | 83 static BrowserContextKeyedService* Build(content::BrowserContext* profile) { |
84 return NULL; | 84 return NULL; |
85 } | 85 } |
86 | 86 |
87 MOCK_METHOD1(SaveImportedProfile, void(const AutofillProfile&)); | 87 MOCK_METHOD1(SaveImportedProfile, std::string(const AutofillProfile&)); |
88 | 88 |
89 AutofillProfile* GetProfileWithGUID(const char* guid) { | 89 AutofillProfile* GetProfileWithGUID(const char* guid) { |
90 for (std::vector<AutofillProfile *>::iterator it = web_profiles_.begin(); | 90 for (std::vector<AutofillProfile *>::iterator it = web_profiles_.begin(); |
91 it != web_profiles_.end(); ++it) { | 91 it != web_profiles_.end(); ++it) { |
92 if (!(*it)->guid().compare(guid)) | 92 if (!(*it)->guid().compare(guid)) |
93 return *it; | 93 return *it; |
94 } | 94 } |
95 return NULL; | 95 return NULL; |
96 } | 96 } |
97 | 97 |
(...skipping 2906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3004 test::CreateTestAddressFormData(&form); | 3004 test::CreateTestAddressFormData(&form); |
3005 std::vector<FormData> forms(1, form); | 3005 std::vector<FormData> forms(1, form); |
3006 FormsSeen(forms); | 3006 FormsSeen(forms); |
3007 const FormFieldData& field = form.fields[0]; | 3007 const FormFieldData& field = form.fields[0]; |
3008 GetAutofillSuggestions(form, field); // should call the delegate's OnQuery() | 3008 GetAutofillSuggestions(form, field); // should call the delegate's OnQuery() |
3009 | 3009 |
3010 EXPECT_TRUE(external_delegate_->on_query_seen()); | 3010 EXPECT_TRUE(external_delegate_->on_query_seen()); |
3011 } | 3011 } |
3012 | 3012 |
3013 } // namespace autofill | 3013 } // namespace autofill |
OLD | NEW |