OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/sync/test/integration/autofill_helper.h" | 5 #include "chrome/browser/sync/test/integration/autofill_helper.h" |
6 | 6 |
7 #include "chrome/browser/autofill/autofill_common_test.h" | 7 #include "chrome/browser/autofill/autofill_common_test.h" |
8 #include "chrome/browser/autofill/autofill_profile.h" | 8 #include "chrome/browser/autofill/autofill_profile.h" |
9 #include "chrome/browser/autofill/autofill_type.h" | 9 #include "chrome/browser/autofill/autofill_type.h" |
10 #include "chrome/browser/autofill/personal_data_manager.h" | 10 #include "chrome/browser/autofill/personal_data_manager.h" |
11 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 11 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
12 #include "chrome/browser/autofill/personal_data_manager_observer.h" | 12 #include "chrome/browser/autofill/personal_data_manager_observer.h" |
13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/sync/profile_sync_service.h" | 14 #include "chrome/browser/sync/profile_sync_service.h" |
15 #include "chrome/browser/sync/profile_sync_test_util.h" | 15 #include "chrome/browser/sync/profile_sync_test_util.h" |
| 16 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" |
16 #include "chrome/browser/sync/test/integration/sync_test.h" | 17 #include "chrome/browser/sync/test/integration/sync_test.h" |
17 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" | |
18 #include "chrome/browser/webdata/autofill_entry.h" | 18 #include "chrome/browser/webdata/autofill_entry.h" |
19 #include "chrome/browser/webdata/autofill_table.h" | 19 #include "chrome/browser/webdata/autofill_table.h" |
20 #include "chrome/browser/webdata/web_database.h" | 20 #include "chrome/browser/webdata/web_database.h" |
21 #include "chrome/common/chrome_notification_types.h" | 21 #include "chrome/common/chrome_notification_types.h" |
22 #include "chrome/test/base/thread_observer_helper.h" | 22 #include "chrome/test/base/thread_observer_helper.h" |
23 #include "webkit/glue/form_field.h" | 23 #include "webkit/forms/form_field.h" |
24 | 24 |
25 using base::WaitableEvent; | 25 using base::WaitableEvent; |
26 using content::BrowserThread; | 26 using content::BrowserThread; |
27 using sync_datatype_helper::test; | 27 using sync_datatype_helper::test; |
28 using testing::_; | 28 using testing::_; |
29 | 29 |
30 namespace { | 30 namespace { |
31 | 31 |
32 class GetAllAutofillEntries | 32 class GetAllAutofillEntries |
33 : public base::RefCountedThreadSafe<GetAllAutofillEntries> { | 33 : public base::RefCountedThreadSafe<GetAllAutofillEntries> { |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 126 |
127 WebDataService* GetWebDataService(int index) { | 127 WebDataService* GetWebDataService(int index) { |
128 return test()->GetProfile(index)->GetWebDataService(Profile::EXPLICIT_ACCESS); | 128 return test()->GetProfile(index)->GetWebDataService(Profile::EXPLICIT_ACCESS); |
129 } | 129 } |
130 | 130 |
131 PersonalDataManager* GetPersonalDataManager(int index) { | 131 PersonalDataManager* GetPersonalDataManager(int index) { |
132 return PersonalDataManagerFactory::GetForProfile(test()->GetProfile(index)); | 132 return PersonalDataManagerFactory::GetForProfile(test()->GetProfile(index)); |
133 } | 133 } |
134 | 134 |
135 void AddKeys(int profile, const std::set<AutofillKey>& keys) { | 135 void AddKeys(int profile, const std::set<AutofillKey>& keys) { |
136 std::vector<webkit_glue::FormField> form_fields; | 136 std::vector<webkit::forms::FormField> form_fields; |
137 for (std::set<AutofillKey>::const_iterator i = keys.begin(); | 137 for (std::set<AutofillKey>::const_iterator i = keys.begin(); |
138 i != keys.end(); | 138 i != keys.end(); |
139 ++i) { | 139 ++i) { |
140 webkit_glue::FormField field; | 140 webkit::forms::FormField field; |
141 field.name = i->name(); | 141 field.name = i->name(); |
142 field.value = i->value(); | 142 field.value = i->value(); |
143 form_fields.push_back(field); | 143 form_fields.push_back(field); |
144 } | 144 } |
145 | 145 |
146 WaitableEvent done_event(false, false); | 146 WaitableEvent done_event(false, false); |
147 scoped_refptr<AutofillDBThreadObserverHelper> observer_helper( | 147 scoped_refptr<AutofillDBThreadObserverHelper> observer_helper( |
148 new AutofillDBThreadObserverHelper()); | 148 new AutofillDBThreadObserverHelper()); |
149 observer_helper->Init(); | 149 observer_helper->Init(); |
150 | 150 |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 if (!ProfilesMatch(0, i)) { | 291 if (!ProfilesMatch(0, i)) { |
292 LOG(ERROR) << "Profile " << i << "does not contain the same autofill " | 292 LOG(ERROR) << "Profile " << i << "does not contain the same autofill " |
293 "profiles as profile 0."; | 293 "profiles as profile 0."; |
294 return false; | 294 return false; |
295 } | 295 } |
296 } | 296 } |
297 return true; | 297 return true; |
298 } | 298 } |
299 | 299 |
300 } // namespace autofill_helper | 300 } // namespace autofill_helper |
OLD | NEW |