| 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/personal_data_manager_factory.h" | 7 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/sync/profile_sync_service.h" | 9 #include "chrome/browser/sync/profile_sync_service.h" |
| 10 #include "chrome/browser/sync/profile_sync_test_util.h" | 10 #include "chrome/browser/sync/profile_sync_test_util.h" |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 std::set<AutofillEntry> keys = GetAllKeys(profile); | 214 std::set<AutofillEntry> keys = GetAllKeys(profile); |
| 215 for (std::set<AutofillEntry>::const_iterator it = keys.begin(); | 215 for (std::set<AutofillEntry>::const_iterator it = keys.begin(); |
| 216 it != keys.end(); ++it) { | 216 it != keys.end(); ++it) { |
| 217 RemoveKeyDontBlockForSync(profile, it->key()); | 217 RemoveKeyDontBlockForSync(profile, it->key()); |
| 218 } | 218 } |
| 219 BlockForPendingDBThreadTasks(); | 219 BlockForPendingDBThreadTasks(); |
| 220 } | 220 } |
| 221 | 221 |
| 222 std::set<AutofillEntry> GetAllKeys(int profile) { | 222 std::set<AutofillEntry> GetAllKeys(int profile) { |
| 223 scoped_refptr<AutofillWebDataService> wds = GetWebDataService(profile); | 223 scoped_refptr<AutofillWebDataService> wds = GetWebDataService(profile); |
| 224 std::vector<AutofillEntry> all_entries = GetAllAutofillEntries(wds); | 224 std::vector<AutofillEntry> all_entries = GetAllAutofillEntries(wds.get()); |
| 225 std::set<AutofillEntry> all_keys; | 225 std::set<AutofillEntry> all_keys; |
| 226 for (std::vector<AutofillEntry>::const_iterator it = all_entries.begin(); | 226 for (std::vector<AutofillEntry>::const_iterator it = all_entries.begin(); |
| 227 it != all_entries.end(); ++it) { | 227 it != all_entries.end(); ++it) { |
| 228 all_keys.insert(*it); | 228 all_keys.insert(*it); |
| 229 } | 229 } |
| 230 return all_keys; | 230 return all_keys; |
| 231 } | 231 } |
| 232 | 232 |
| 233 bool KeysMatch(int profile_a, int profile_b) { | 233 bool KeysMatch(int profile_a, int profile_b) { |
| 234 return GetAllKeys(profile_a) == GetAllKeys(profile_b); | 234 return GetAllKeys(profile_a) == GetAllKeys(profile_b); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 if (!ProfilesMatch(0, i)) { | 350 if (!ProfilesMatch(0, i)) { |
| 351 LOG(ERROR) << "Profile " << i << "does not contain the same autofill " | 351 LOG(ERROR) << "Profile " << i << "does not contain the same autofill " |
| 352 "profiles as profile 0."; | 352 "profiles as profile 0."; |
| 353 return false; | 353 return false; |
| 354 } | 354 } |
| 355 } | 355 } |
| 356 return true; | 356 return true; |
| 357 } | 357 } |
| 358 | 358 |
| 359 } // namespace autofill_helper | 359 } // namespace autofill_helper |
| OLD | NEW |