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

Unified Diff: chrome/browser/sync/test/integration/migration_test.cc

Issue 165393010: Draft: Moving code out of ProfileSyncServiceHarness (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/sync/test/integration/multi_client_status_change_checker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/test/integration/migration_test.cc
diff --git a/chrome/browser/sync/test/integration/migration_test.cc b/chrome/browser/sync/test/integration/migration_test.cc
index a63d0d45be82aad06a96a949b7b4fa23cc1de094..5460f484b2810226776f3876e72a93ea67905375 100644
--- a/chrome/browser/sync/test/integration/migration_test.cc
+++ b/chrome/browser/sync/test/integration/migration_test.cc
@@ -10,7 +10,7 @@
#include "chrome/browser/sync/test/integration/bookmarks_helper.h"
#include "chrome/browser/sync/test/integration/preferences_helper.h"
#include "chrome/browser/sync/test/integration/profile_sync_service_harness.h"
-#include "chrome/browser/sync/test/integration/status_change_checker.h"
+#include "chrome/browser/sync/test/integration/single_client_status_change_checker.h"
#include "chrome/browser/sync/test/integration/sync_test.h"
#include "chrome/browser/translate/translate_prefs.h"
#include "chrome/common/pref_names.h"
@@ -67,11 +67,11 @@ MigrationList MakeList(syncer::ModelType type1,
// Helper class that checks if the sync backend has successfully completed
// migration for a set of data types.
-class MigrationChecker : public StatusChangeChecker,
+class MigrationChecker : public SingleClientStatusChangeChecker,
public browser_sync::MigrationObserver {
public:
explicit MigrationChecker(ProfileSyncServiceHarness* harness)
- : StatusChangeChecker("MigrationChecker"),
+ : SingleClientStatusChangeChecker(harness->service()),
harness_(harness) {
DCHECK(harness_);
browser_sync::BackendMigrator* migrator =
@@ -98,6 +98,10 @@ class MigrationChecker : public StatusChangeChecker,
!HasPendingBackendMigration();
}
+ virtual std::string GetDebugMessage() const OVERRIDE {
+ return "Waiting to migrate (" + ModelTypeSetToString(expected_types_) + ")";
+ }
+
bool HasPendingBackendMigration() const {
browser_sync::BackendMigrator* migrator =
harness_->service()->GetBackendMigratorForTest();
@@ -131,9 +135,13 @@ class MigrationChecker : public StatusChangeChecker,
<< syncer::ModelTypeSetToString(migrated_types_);
}
+#if 0
// Nudge ProfileSyncServiceHarness to inspect the exit condition provided by
// AwaitMigration.
- harness_->OnStateChanged();
+ if (IsWaiting() && IsExitConditionSatisfied()) {
+ StopWaitingAndSucceed();
+ }
+#endif
}
private:
@@ -234,7 +242,7 @@ class MigrationTest : public SyncTest {
MigrationChecker* checker = migration_checkers_[i];
checker->set_expected_types(migrate_types);
if (!checker->IsExitConditionSatisfied())
- ASSERT_TRUE(GetClient(i)->AwaitStatusChange(checker, "AwaitMigration"));
+ ASSERT_TRUE(GetClient(i)->AwaitStatusChange(checker));
}
}
« no previous file with comments | « no previous file | chrome/browser/sync/test/integration/multi_client_status_change_checker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698