| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 WaitableEvent done_event(false, false); | 79 WaitableEvent done_event(false, false); |
| 80 BrowserThread::PostTask(BrowserThread::DB, | 80 BrowserThread::PostTask(BrowserThread::DB, |
| 81 FROM_HERE, | 81 FROM_HERE, |
| 82 Bind(&RunOnDBThreadAndSignal, task, &done_event)); | 82 Bind(&RunOnDBThreadAndSignal, task, &done_event)); |
| 83 done_event.Wait(); | 83 done_event.Wait(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 void GetAllAutofillEntriesOnDBThread(WebDataService* wds, | 86 void GetAllAutofillEntriesOnDBThread(WebDataService* wds, |
| 87 std::vector<AutofillEntry>* entries) { | 87 std::vector<AutofillEntry>* entries) { |
| 88 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); | 88 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); |
| 89 wds->GetDatabase()->GetAutofillTable()->GetAllAutofillEntries(entries); | 89 AutofillTable::FromWebDatabase( |
| 90 wds->GetDatabase())->GetAllAutofillEntries(entries); |
| 90 } | 91 } |
| 91 | 92 |
| 92 std::vector<AutofillEntry> GetAllAutofillEntries(WebDataService* wds) { | 93 std::vector<AutofillEntry> GetAllAutofillEntries(WebDataService* wds) { |
| 93 std::vector<AutofillEntry> entries; | 94 std::vector<AutofillEntry> entries; |
| 94 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 95 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 95 RunOnDBThreadAndBlock(Bind(&GetAllAutofillEntriesOnDBThread, | 96 RunOnDBThreadAndBlock(Bind(&GetAllAutofillEntriesOnDBThread, |
| 96 Unretained(wds), | 97 Unretained(wds), |
| 97 &entries)); | 98 &entries)); |
| 98 return entries; | 99 return entries; |
| 99 } | 100 } |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 if (!ProfilesMatch(0, i)) { | 326 if (!ProfilesMatch(0, i)) { |
| 326 LOG(ERROR) << "Profile " << i << "does not contain the same autofill " | 327 LOG(ERROR) << "Profile " << i << "does not contain the same autofill " |
| 327 "profiles as profile 0."; | 328 "profiles as profile 0."; |
| 328 return false; | 329 return false; |
| 329 } | 330 } |
| 330 } | 331 } |
| 331 return true; | 332 return true; |
| 332 } | 333 } |
| 333 | 334 |
| 334 } // namespace autofill_helper | 335 } // namespace autofill_helper |
| OLD | NEW |