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

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

Issue 2379433002: [Sync] Refactoring of sync integration test checkers to remove boilerplate await methods. (Closed)
Patch Set: Rebase Created 4 years, 2 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/migration_waiter.h" 5 #include "chrome/browser/sync/test/integration/migration_waiter.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/sync/test/integration/migration_watcher.h" 8 #include "chrome/browser/sync/test/integration/migration_watcher.h"
9 9
10 MigrationWaiter::MigrationWaiter(syncer::ModelTypeSet expected_types, 10 MigrationWaiter::MigrationWaiter(syncer::ModelTypeSet expected_types,
(...skipping 13 matching lines...) Expand all
24 return watcher_->GetMigratedTypes().HasAll(expected_types_) && 24 return watcher_->GetMigratedTypes().HasAll(expected_types_) &&
25 !watcher_->HasPendingBackendMigration(); 25 !watcher_->HasPendingBackendMigration();
26 } 26 }
27 27
28 std::string MigrationWaiter::GetDebugMessage() const { 28 std::string MigrationWaiter::GetDebugMessage() const {
29 return "Waiting to migrate (" + ModelTypeSetToString(expected_types_) + 29 return "Waiting to migrate (" + ModelTypeSetToString(expected_types_) +
30 "); " + "Currently migrated: (" + 30 "); " + "Currently migrated: (" +
31 ModelTypeSetToString(watcher_->GetMigratedTypes()) + ")"; 31 ModelTypeSetToString(watcher_->GetMigratedTypes()) + ")";
32 } 32 }
33 33
34 void MigrationWaiter::Wait() {
35 if (IsExitConditionSatisfied()) {
36 DVLOG(1) << "Skipping wait: " << GetDebugMessage();
37 return;
38 }
39
40 StartBlockingWait();
41 }
42
43 void MigrationWaiter::OnMigrationStateChange() { 34 void MigrationWaiter::OnMigrationStateChange() {
44 CheckExitCondition(); 35 CheckExitCondition();
45 } 36 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698