Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(282)

Side by Side Diff: chrome/browser/sync/test/integration/bookmarks_helper.cc

Issue 2021393004: Migrate WaitableEvent to enum-based constructor in chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@WEvent_enums
Patch Set: Split out custom changes to thread_watcher_unittest.cc Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 profiles_which_need_to_wait.push_back( 310 profiles_which_need_to_wait.push_back(
311 sync_datatype_helper::test()->verifier()); 311 sync_datatype_helper::test()->verifier());
312 for (int i = 0; i < sync_datatype_helper::test()->num_clients(); ++i) 312 for (int i = 0; i < sync_datatype_helper::test()->num_clients(); ++i)
313 profiles_which_need_to_wait.push_back( 313 profiles_which_need_to_wait.push_back(
314 sync_datatype_helper::test()->GetProfile(i)); 314 sync_datatype_helper::test()->GetProfile(i));
315 315
316 for (size_t i = 0; i < profiles_which_need_to_wait.size(); ++i) { 316 for (size_t i = 0; i < profiles_which_need_to_wait.size(); ++i) {
317 Profile* profile = profiles_which_need_to_wait[i]; 317 Profile* profile = profiles_which_need_to_wait[i];
318 history::HistoryService* history_service = 318 history::HistoryService* history_service =
319 HistoryServiceFactory::GetForProfileWithoutCreating(profile); 319 HistoryServiceFactory::GetForProfileWithoutCreating(profile);
320 base::WaitableEvent done(false, false); 320 base::WaitableEvent done(base::WaitableEvent::ResetPolicy::AUTOMATIC,
321 base::WaitableEvent::InitialState::NOT_SIGNALED);
321 base::CancelableTaskTracker task_tracker; 322 base::CancelableTaskTracker task_tracker;
322 history_service->ScheduleDBTask( 323 history_service->ScheduleDBTask(
323 std::unique_ptr<history::HistoryDBTask>(new HistoryEmptyTask(&done)), 324 std::unique_ptr<history::HistoryDBTask>(new HistoryEmptyTask(&done)),
324 &task_tracker); 325 &task_tracker);
325 done.Wait(); 326 done.Wait();
326 } 327 }
327 // Wait such that any notifications broadcast from one of the history threads 328 // Wait such that any notifications broadcast from one of the history threads
328 // to the UI thread are processed. 329 // to the UI thread are processed.
329 content::RunAllPendingInMessageLoop(); 330 content::RunAllPendingInMessageLoop();
330 } 331 }
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
1000 1001
1001 std::string IndexedSubfolderName(int i) { 1002 std::string IndexedSubfolderName(int i) {
1002 return base::StringPrintf("Subfolder Name %d", i); 1003 return base::StringPrintf("Subfolder Name %d", i);
1003 } 1004 }
1004 1005
1005 std::string IndexedSubsubfolderName(int i) { 1006 std::string IndexedSubsubfolderName(int i) {
1006 return base::StringPrintf("Subsubfolder Name %d", i); 1007 return base::StringPrintf("Subsubfolder Name %d", i);
1007 } 1008 }
1008 1009
1009 } // namespace bookmarks_helper 1010 } // namespace bookmarks_helper
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698