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

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: Address comments 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
« no previous file with comments | « chrome/test/live_sync/live_sync_test.cc ('k') | net/tools/testserver/testserver.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 792e5bbead766f57d7d667d42b6288243eb3ecd8..5a87894ce94a7b5d9b80280c773312fea03d7f17 100644
--- a/chrome/test/live_sync/migration_errors_test.cc
+++ b/chrome/test/live_sync/migration_errors_test.cc
@@ -8,8 +8,8 @@
#include "chrome/browser/translate/translate_prefs.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/ui_test_utils.h"
-#include "chrome/test/live_sync/live_sync_test.h"
#include "chrome/test/live_sync/bookmarks_helper.h"
+#include "chrome/test/live_sync/live_sync_test.h"
#include "chrome/test/live_sync/preferences_helper.h"
using bookmarks_helper::AddURL;
@@ -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 (times out) due to http://crbug.com/92928.
-IN_PROC_BROWSER_TEST_F(MigrationCycleTest, DISABLED_PrefsNigori) {
- if (!ServerSupportsErrorTriggering()) {
+IN_PROC_BROWSER_TEST_F(MigrationCycleTest,
+ DISABLED_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 (times out) due to http://crbug.com/92928.
+IN_PROC_BROWSER_TEST_F(MigrationCycleTest, DISABLED_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, DISABLED_PrefsNigori) {
// TODO(akalin): Fails (times out) due to http://crbug.com/92928.
IN_PROC_BROWSER_TEST_F(MigrationCycleTest, DISABLED_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, DISABLED_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:
« no previous file with comments | « chrome/test/live_sync/live_sync_test.cc ('k') | net/tools/testserver/testserver.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698