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/bookmarks_helper.h" | 5 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/rand_util.h" | 8 #include "base/rand_util.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 | 216 |
217 std::vector<Profile*> profiles_which_need_to_wait; | 217 std::vector<Profile*> profiles_which_need_to_wait; |
218 if (test()->use_verifier()) | 218 if (test()->use_verifier()) |
219 profiles_which_need_to_wait.push_back(test()->verifier()); | 219 profiles_which_need_to_wait.push_back(test()->verifier()); |
220 for (int i = 0; i < test()->num_clients(); ++i) | 220 for (int i = 0; i < test()->num_clients(); ++i) |
221 profiles_which_need_to_wait.push_back(test()->GetProfile(i)); | 221 profiles_which_need_to_wait.push_back(test()->GetProfile(i)); |
222 | 222 |
223 for (size_t i = 0; i < profiles_which_need_to_wait.size(); ++i) { | 223 for (size_t i = 0; i < profiles_which_need_to_wait.size(); ++i) { |
224 Profile* profile = profiles_which_need_to_wait[i]; | 224 Profile* profile = profiles_which_need_to_wait[i]; |
225 HistoryService* history_service = | 225 HistoryService* history_service = |
226 HistoryServiceFactory::GetForProfileWithoutCreating(profile); | 226 HistoryServiceFactory::GetForProfileWithoutCreating(profile).get(); |
227 base::WaitableEvent done(false, false); | 227 base::WaitableEvent done(false, false); |
228 CancelableRequestConsumer request_consumer; | 228 CancelableRequestConsumer request_consumer; |
229 history_service->ScheduleDBTask(new HistoryEmptyTask(&done), | 229 history_service->ScheduleDBTask(new HistoryEmptyTask(&done), |
230 &request_consumer); | 230 &request_consumer); |
231 done.Wait(); | 231 done.Wait(); |
232 } | 232 } |
233 // Wait such that any notifications broadcast from one of the history threads | 233 // Wait such that any notifications broadcast from one of the history threads |
234 // to the UI thread are processed. | 234 // to the UI thread are processed. |
235 content::RunAllPendingInMessageLoop(); | 235 content::RunAllPendingInMessageLoop(); |
236 } | 236 } |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 | 685 |
686 std::wstring IndexedSubfolderName(int i) { | 686 std::wstring IndexedSubfolderName(int i) { |
687 return StringPrintf(L"Subfolder Name %d", i); | 687 return StringPrintf(L"Subfolder Name %d", i); |
688 } | 688 } |
689 | 689 |
690 std::wstring IndexedSubsubfolderName(int i) { | 690 std::wstring IndexedSubsubfolderName(int i) { |
691 return StringPrintf(L"Subsubfolder Name %d", i); | 691 return StringPrintf(L"Subsubfolder Name %d", i); |
692 } | 692 } |
693 | 693 |
694 } // namespace bookmarks_helper | 694 } // namespace bookmarks_helper |
OLD | NEW |