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