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

Unified Diff: chrome/test/live_sync/migration_errors_test.cc

Issue 7753023: [Sync] Add tests for migration triggered by notifications (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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
Index: chrome/test/live_sync/migration_errors_test.cc
diff --git a/chrome/test/live_sync/migration_errors_test.cc b/chrome/test/live_sync/migration_errors_test.cc
index 0ea11878364852e260c6c5d37d8da23ea49f523a..0b5e96d1600c7a3bd49d824c16cda465750f2cc5 100644
--- a/chrome/test/live_sync/migration_errors_test.cc
+++ b/chrome/test/live_sync/migration_errors_test.cc
@@ -32,15 +32,16 @@ class MigrationCycleTest : public LiveSyncTest {
};
IN_PROC_BROWSER_TEST_F(MigrationCycleTest, PrefsOnly) {
- if (!ServerSupportsErrorTriggering()) {
+ if (!ServerSupportsNotificationControl() ||
+ !ServerSupportsErrorTriggering()) {
LOG(WARNING) << "Test skipped in this server environment.";
return;
}
- DisableNotifications();
-
ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
+ DisableNotifications();
+
// Phase 1: Trigger a preference migration on the server.
syncable::ModelTypeSet migrate_types;
migrate_types.insert(syncable::PREFERENCES);
@@ -56,16 +57,41 @@ IN_PROC_BROWSER_TEST_F(MigrationCycleTest, PrefsOnly) {
}
// TODO(akalin): Fails due to http://crbug.com/92928.
-IN_PROC_BROWSER_TEST_F(MigrationCycleTest, FAILS_PrefsNigori) {
- if (!ServerSupportsErrorTriggering()) {
+IN_PROC_BROWSER_TEST_F(MigrationCycleTest,
+ FAILS_PrefsOnlyTriggerNotification) {
+ if (!ServerSupportsNotificationControl() ||
+ !ServerSupportsErrorTriggering()) {
LOG(WARNING) << "Test skipped in this server environment.";
return;
}
- DisableNotifications();
+ ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
+
+ // Phase 1: Trigger a preference migration on the server.
+ syncable::ModelTypeSet migrate_types;
+ migrate_types.insert(syncable::PREFERENCES);
+ TriggerMigrationDoneError(migrate_types);
+
+ // Phase 2: Synthesize a notification (to trigger migration) and
+ // wait for a sync cycle.
+ // TODO(akalin): Shouldn't need to wait for full sync cycle; see
+ // 93167.
+ TriggerNotification(migrate_types);
+ ASSERT_TRUE(GetClient(0)->AwaitNextSyncCycleCompletion("Migration"));
+}
+
+// TODO(akalin): Fails due to http://crbug.com/92928.
+IN_PROC_BROWSER_TEST_F(MigrationCycleTest, FAILS_PrefsNigori) {
+ if (!ServerSupportsNotificationControl() ||
+ !ServerSupportsErrorTriggering()) {
+ LOG(WARNING) << "Test skipped in this server environment.";
+ return;
+ }
ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
+ DisableNotifications();
+
// Phase 1: Trigger a preference and nigori migration on the server.
{
syncable::ModelTypeSet migrate_types;
@@ -89,15 +115,16 @@ IN_PROC_BROWSER_TEST_F(MigrationCycleTest, FAILS_PrefsNigori) {
// TODO(akalin): Fails due to http://crbug.com/92928.
IN_PROC_BROWSER_TEST_F(MigrationCycleTest, FAILS_BookmarksPrefs) {
- if (!ServerSupportsErrorTriggering()) {
+ if (!ServerSupportsNotificationControl() ||
+ !ServerSupportsErrorTriggering()) {
LOG(WARNING) << "Test skipped in this server environment.";
return;
}
- DisableNotifications();
-
ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
+ DisableNotifications();
+
// Phase 1: Trigger a bookmark and preference migration on the
// server.
{
@@ -119,8 +146,7 @@ IN_PROC_BROWSER_TEST_F(MigrationCycleTest, FAILS_BookmarksPrefs) {
ASSERT_TRUE(GetClient(0)->AwaitSyncCycleCompletion("Migration"));
}
-// TODO(akalin): Add tests where the migration trigger is a poll or a
-// nudge from notifications.
+// TODO(akalin): Add tests where the migration trigger is a poll.
class MigrationErrorsTest : public LiveSyncTest {
public:

Powered by Google App Engine
This is Rietveld 408576698