| 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/test/live_sync/autofill_helper.h" | 5 #include "chrome/test/live_sync/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" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 PersonalDataManager* GetPersonalDataManager(int index) { | 129 PersonalDataManager* GetPersonalDataManager(int index) { |
| 130 return test()->GetProfile(index)->GetPersonalDataManager(); | 130 return test()->GetProfile(index)->GetPersonalDataManager(); |
| 131 } | 131 } |
| 132 | 132 |
| 133 void AddKeys(int profile, | 133 void AddKeys(int profile, |
| 134 const std::set<AutofillKey>& keys) { | 134 const std::set<AutofillKey>& keys) { |
| 135 std::vector<webkit_glue::FormField> form_fields; | 135 std::vector<webkit_glue::FormField> form_fields; |
| 136 for (std::set<AutofillKey>::const_iterator i = keys.begin(); | 136 for (std::set<AutofillKey>::const_iterator i = keys.begin(); |
| 137 i != keys.end(); | 137 i != keys.end(); |
| 138 ++i) { | 138 ++i) { |
| 139 form_fields.push_back(webkit_glue::FormField(string16(), | 139 webkit_glue::FormField field; |
| 140 (*i).name(), | 140 field.name = i->name(); |
| 141 (*i).value(), | 141 field.value = i->value(); |
| 142 string16(), | 142 form_fields.push_back(field); |
| 143 0, | |
| 144 false)); | |
| 145 } | 143 } |
| 146 | 144 |
| 147 WaitableEvent done_event(false, false); | 145 WaitableEvent done_event(false, false); |
| 148 scoped_refptr<AutofillDBThreadObserverHelper> observer_helper( | 146 scoped_refptr<AutofillDBThreadObserverHelper> observer_helper( |
| 149 new AutofillDBThreadObserverHelper()); | 147 new AutofillDBThreadObserverHelper()); |
| 150 observer_helper->Init(); | 148 observer_helper->Init(); |
| 151 | 149 |
| 152 EXPECT_CALL(*observer_helper->observer(), Observe(_, _, _)). | 150 EXPECT_CALL(*observer_helper->observer(), Observe(_, _, _)). |
| 153 WillOnce(SignalEvent(&done_event)); | 151 WillOnce(SignalEvent(&done_event)); |
| 154 WebDataService* wds = GetWebDataService(profile); | 152 WebDataService* wds = GetWebDataService(profile); |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 if (!ProfilesMatch(0, i)) { | 286 if (!ProfilesMatch(0, i)) { |
| 289 LOG(ERROR) << "Profile " << i << "does not contain the same autofill " | 287 LOG(ERROR) << "Profile " << i << "does not contain the same autofill " |
| 290 "profiles as profile 0."; | 288 "profiles as profile 0."; |
| 291 return false; | 289 return false; |
| 292 } | 290 } |
| 293 } | 291 } |
| 294 return true; | 292 return true; |
| 295 } | 293 } |
| 296 | 294 |
| 297 } // namespace autofill_helper | 295 } // namespace autofill_helper |
| OLD | NEW |