| OLD | NEW |
| 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 "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_datatype_helper.h" |
| 17 #include "chrome/browser/sync/test/integration/sync_test.h" | 17 #include "chrome/browser/sync/test/integration/sync_test.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_data_service.h" | 20 #include "chrome/browser/webdata/web_data_service.h" |
| 21 #include "chrome/browser/webdata/web_data_service_factory.h" | 21 #include "chrome/browser/webdata/web_data_service_factory.h" |
| 22 #include "chrome/browser/webdata/web_database.h" | 22 #include "chrome/browser/webdata/web_database.h" |
| 23 #include "chrome/common/chrome_notification_types.h" | 23 #include "chrome/common/chrome_notification_types.h" |
| 24 #include "chrome/common/form_field_data.h" |
| 24 #include "chrome/test/base/thread_observer_helper.h" | 25 #include "chrome/test/base/thread_observer_helper.h" |
| 25 #include "webkit/forms/form_field.h" | |
| 26 | 26 |
| 27 using base::WaitableEvent; | 27 using base::WaitableEvent; |
| 28 using content::BrowserThread; | 28 using content::BrowserThread; |
| 29 using sync_datatype_helper::test; | 29 using sync_datatype_helper::test; |
| 30 using testing::_; | 30 using testing::_; |
| 31 | 31 |
| 32 namespace { | 32 namespace { |
| 33 | 33 |
| 34 ACTION_P(SignalEvent, event) { | 34 ACTION_P(SignalEvent, event) { |
| 35 event->Signal(); | 35 event->Signal(); |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 scoped_refptr<WebDataService> GetWebDataService(int index) { | 152 scoped_refptr<WebDataService> GetWebDataService(int index) { |
| 153 return WebDataServiceFactory::GetForProfile( | 153 return WebDataServiceFactory::GetForProfile( |
| 154 test()->GetProfile(index), Profile::EXPLICIT_ACCESS); | 154 test()->GetProfile(index), Profile::EXPLICIT_ACCESS); |
| 155 } | 155 } |
| 156 | 156 |
| 157 PersonalDataManager* GetPersonalDataManager(int index) { | 157 PersonalDataManager* GetPersonalDataManager(int index) { |
| 158 return PersonalDataManagerFactory::GetForProfile(test()->GetProfile(index)); | 158 return PersonalDataManagerFactory::GetForProfile(test()->GetProfile(index)); |
| 159 } | 159 } |
| 160 | 160 |
| 161 void AddKeys(int profile, const std::set<AutofillKey>& keys) { | 161 void AddKeys(int profile, const std::set<AutofillKey>& keys) { |
| 162 std::vector<webkit::forms::FormField> form_fields; | 162 std::vector<FormFieldData> form_fields; |
| 163 for (std::set<AutofillKey>::const_iterator i = keys.begin(); | 163 for (std::set<AutofillKey>::const_iterator i = keys.begin(); |
| 164 i != keys.end(); | 164 i != keys.end(); |
| 165 ++i) { | 165 ++i) { |
| 166 webkit::forms::FormField field; | 166 FormFieldData field; |
| 167 field.name = i->name(); | 167 field.name = i->name(); |
| 168 field.value = i->value(); | 168 field.value = i->value(); |
| 169 form_fields.push_back(field); | 169 form_fields.push_back(field); |
| 170 } | 170 } |
| 171 | 171 |
| 172 WaitableEvent done_event(false, false); | 172 WaitableEvent done_event(false, false); |
| 173 scoped_refptr<AutofillDBThreadObserverHelper> observer_helper( | 173 scoped_refptr<AutofillDBThreadObserverHelper> observer_helper( |
| 174 new AutofillDBThreadObserverHelper()); | 174 new AutofillDBThreadObserverHelper()); |
| 175 observer_helper->Init(); | 175 observer_helper->Init(); |
| 176 | 176 |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 if (!ProfilesMatch(0, i)) { | 327 if (!ProfilesMatch(0, i)) { |
| 328 LOG(ERROR) << "Profile " << i << "does not contain the same autofill " | 328 LOG(ERROR) << "Profile " << i << "does not contain the same autofill " |
| 329 "profiles as profile 0."; | 329 "profiles as profile 0."; |
| 330 return false; | 330 return false; |
| 331 } | 331 } |
| 332 } | 332 } |
| 333 return true; | 333 return true; |
| 334 } | 334 } |
| 335 | 335 |
| 336 } // namespace autofill_helper | 336 } // namespace autofill_helper |
| OLD | NEW |