| OLD | NEW |
| 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 // TODO(akalin): Rename this file to migration_test.cc. | 5 // TODO(akalin): Rename this file to migration_test.cc. |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 8 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/sync/profile_sync_service_harness.h" | 10 #include "chrome/browser/sync/profile_sync_service_harness.h" |
| 11 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" | 11 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" |
| 12 #include "chrome/browser/sync/test/integration/preferences_helper.h" |
| 12 #include "chrome/browser/sync/test/integration/sync_test.h" | 13 #include "chrome/browser/sync/test/integration/sync_test.h" |
| 13 #include "chrome/browser/sync/test/integration/preferences_helper.h" | |
| 14 #include "chrome/browser/translate/translate_prefs.h" | 14 #include "chrome/browser/translate/translate_prefs.h" |
| 15 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
| 16 #include "chrome/test/base/ui_test_utils.h" | 16 #include "chrome/test/base/ui_test_utils.h" |
| 17 | 17 |
| 18 using bookmarks_helper::AddURL; | 18 using bookmarks_helper::AddURL; |
| 19 using bookmarks_helper::IndexedURL; | 19 using bookmarks_helper::IndexedURL; |
| 20 using bookmarks_helper::IndexedURLTitle; | 20 using bookmarks_helper::IndexedURLTitle; |
| 21 | 21 |
| 22 using preferences_helper::BooleanPrefMatches; | 22 using preferences_helper::BooleanPrefMatches; |
| 23 using preferences_helper::ChangeBooleanPref; | 23 using preferences_helper::ChangeBooleanPref; |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 // Utility functions to make a model type set out of a small number of | 27 // Utility functions to make a model type set out of a small number of |
| 28 // model types. | 28 // model types. |
| 29 | 29 |
| 30 syncable::ModelTypeSet MakeSet(syncable::ModelType type) { | 30 syncer::ModelTypeSet MakeSet(syncer::ModelType type) { |
| 31 return syncable::ModelTypeSet(type); | 31 return syncer::ModelTypeSet(type); |
| 32 } | 32 } |
| 33 | 33 |
| 34 syncable::ModelTypeSet MakeSet(syncable::ModelType type1, | 34 syncer::ModelTypeSet MakeSet(syncer::ModelType type1, |
| 35 syncable::ModelType type2) { | 35 syncer::ModelType type2) { |
| 36 return syncable::ModelTypeSet(type1, type2); | 36 return syncer::ModelTypeSet(type1, type2); |
| 37 } | 37 } |
| 38 | 38 |
| 39 // An ordered list of model types sets to migrate. Used by | 39 // An ordered list of model types sets to migrate. Used by |
| 40 // RunMigrationTest(). | 40 // RunMigrationTest(). |
| 41 typedef std::deque<syncable::ModelTypeSet> MigrationList; | 41 typedef std::deque<syncer::ModelTypeSet> MigrationList; |
| 42 | 42 |
| 43 // Utility functions to make a MigrationList out of a small number of | 43 // Utility functions to make a MigrationList out of a small number of |
| 44 // model types / model type sets. | 44 // model types / model type sets. |
| 45 | 45 |
| 46 MigrationList MakeList(syncable::ModelTypeSet model_types) { | 46 MigrationList MakeList(syncer::ModelTypeSet model_types) { |
| 47 return MigrationList(1, model_types); | 47 return MigrationList(1, model_types); |
| 48 } | 48 } |
| 49 | 49 |
| 50 MigrationList MakeList(syncable::ModelTypeSet model_types1, | 50 MigrationList MakeList(syncer::ModelTypeSet model_types1, |
| 51 syncable::ModelTypeSet model_types2) { | 51 syncer::ModelTypeSet model_types2) { |
| 52 MigrationList migration_list; | 52 MigrationList migration_list; |
| 53 migration_list.push_back(model_types1); | 53 migration_list.push_back(model_types1); |
| 54 migration_list.push_back(model_types2); | 54 migration_list.push_back(model_types2); |
| 55 return migration_list; | 55 return migration_list; |
| 56 } | 56 } |
| 57 | 57 |
| 58 MigrationList MakeList(syncable::ModelType type) { | 58 MigrationList MakeList(syncer::ModelType type) { |
| 59 return MakeList(MakeSet(type)); | 59 return MakeList(MakeSet(type)); |
| 60 } | 60 } |
| 61 | 61 |
| 62 MigrationList MakeList(syncable::ModelType type1, | 62 MigrationList MakeList(syncer::ModelType type1, |
| 63 syncable::ModelType type2) { | 63 syncer::ModelType type2) { |
| 64 return MakeList(MakeSet(type1), MakeSet(type2)); | 64 return MakeList(MakeSet(type1), MakeSet(type2)); |
| 65 } | 65 } |
| 66 | 66 |
| 67 class MigrationTest : public SyncTest { | 67 class MigrationTest : public SyncTest { |
| 68 public: | 68 public: |
| 69 explicit MigrationTest(TestType test_type) : SyncTest(test_type) {} | 69 explicit MigrationTest(TestType test_type) : SyncTest(test_type) {} |
| 70 virtual ~MigrationTest() {} | 70 virtual ~MigrationTest() {} |
| 71 | 71 |
| 72 // TODO(akalin): Add more MODIFY_(data type) trigger methods, as | 72 // TODO(akalin): Add more MODIFY_(data type) trigger methods, as |
| 73 // well as a poll-based trigger method. | 73 // well as a poll-based trigger method. |
| 74 enum TriggerMethod { MODIFY_PREF, MODIFY_BOOKMARK, TRIGGER_NOTIFICATION }; | 74 enum TriggerMethod { MODIFY_PREF, MODIFY_BOOKMARK, TRIGGER_NOTIFICATION }; |
| 75 | 75 |
| 76 syncable::ModelTypeSet GetPreferredDataTypes() { | 76 syncer::ModelTypeSet GetPreferredDataTypes() { |
| 77 const syncable::ModelTypeSet preferred_data_types = | 77 const syncer::ModelTypeSet preferred_data_types = |
| 78 GetClient(0)->service()->GetPreferredDataTypes(); | 78 GetClient(0)->service()->GetPreferredDataTypes(); |
| 79 // Make sure all clients have the same preferred data types. | 79 // Make sure all clients have the same preferred data types. |
| 80 for (int i = 1; i < num_clients(); ++i) { | 80 for (int i = 1; i < num_clients(); ++i) { |
| 81 const syncable::ModelTypeSet other_preferred_data_types = | 81 const syncer::ModelTypeSet other_preferred_data_types = |
| 82 GetClient(i)->service()->GetPreferredDataTypes(); | 82 GetClient(i)->service()->GetPreferredDataTypes(); |
| 83 EXPECT_TRUE(preferred_data_types.Equals(other_preferred_data_types)); | 83 EXPECT_TRUE(preferred_data_types.Equals(other_preferred_data_types)); |
| 84 } | 84 } |
| 85 return preferred_data_types; | 85 return preferred_data_types; |
| 86 } | 86 } |
| 87 | 87 |
| 88 // Returns a MigrationList with every enabled data type in its own | 88 // Returns a MigrationList with every enabled data type in its own |
| 89 // set. | 89 // set. |
| 90 MigrationList GetPreferredDataTypesList() { | 90 MigrationList GetPreferredDataTypesList() { |
| 91 MigrationList migration_list; | 91 MigrationList migration_list; |
| 92 const syncable::ModelTypeSet preferred_data_types = | 92 const syncer::ModelTypeSet preferred_data_types = |
| 93 GetPreferredDataTypes(); | 93 GetPreferredDataTypes(); |
| 94 for (syncable::ModelTypeSet::Iterator it = | 94 for (syncer::ModelTypeSet::Iterator it = |
| 95 preferred_data_types.First(); it.Good(); it.Inc()) { | 95 preferred_data_types.First(); it.Good(); it.Inc()) { |
| 96 migration_list.push_back(MakeSet(it.Get())); | 96 migration_list.push_back(MakeSet(it.Get())); |
| 97 } | 97 } |
| 98 return migration_list; | 98 return migration_list; |
| 99 } | 99 } |
| 100 | 100 |
| 101 // Trigger a migration for the given types with the given method. | 101 // Trigger a migration for the given types with the given method. |
| 102 void TriggerMigration(syncable::ModelTypeSet model_types, | 102 void TriggerMigration(syncer::ModelTypeSet model_types, |
| 103 TriggerMethod trigger_method) { | 103 TriggerMethod trigger_method) { |
| 104 switch (trigger_method) { | 104 switch (trigger_method) { |
| 105 case MODIFY_PREF: | 105 case MODIFY_PREF: |
| 106 // Unlike MODIFY_BOOKMARK, MODIFY_PREF doesn't cause a | 106 // Unlike MODIFY_BOOKMARK, MODIFY_PREF doesn't cause a |
| 107 // notification to happen (since model association on a | 107 // notification to happen (since model association on a |
| 108 // boolean pref clobbers the local value), so it doesn't work | 108 // boolean pref clobbers the local value), so it doesn't work |
| 109 // for anything but single-client tests. | 109 // for anything but single-client tests. |
| 110 ASSERT_EQ(1, num_clients()); | 110 ASSERT_EQ(1, num_clients()); |
| 111 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); | 111 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); |
| 112 ChangeBooleanPref(0, prefs::kShowHomeButton); | 112 ChangeBooleanPref(0, prefs::kShowHomeButton); |
| 113 break; | 113 break; |
| 114 case MODIFY_BOOKMARK: | 114 case MODIFY_BOOKMARK: |
| 115 ASSERT_TRUE(AddURL(0, IndexedURLTitle(0), GURL(IndexedURL(0)))); | 115 ASSERT_TRUE(AddURL(0, IndexedURLTitle(0), GURL(IndexedURL(0)))); |
| 116 break; | 116 break; |
| 117 case TRIGGER_NOTIFICATION: | 117 case TRIGGER_NOTIFICATION: |
| 118 TriggerNotification(model_types); | 118 TriggerNotification(model_types); |
| 119 break; | 119 break; |
| 120 default: | 120 default: |
| 121 ADD_FAILURE(); | 121 ADD_FAILURE(); |
| 122 } | 122 } |
| 123 } | 123 } |
| 124 | 124 |
| 125 // Block until all clients have completed migration for the given | 125 // Block until all clients have completed migration for the given |
| 126 // types. | 126 // types. |
| 127 void AwaitMigration(syncable::ModelTypeSet migrate_types) { | 127 void AwaitMigration(syncer::ModelTypeSet migrate_types) { |
| 128 for (int i = 0; i < num_clients(); ++i) { | 128 for (int i = 0; i < num_clients(); ++i) { |
| 129 ASSERT_TRUE(GetClient(i)->AwaitMigration(migrate_types)); | 129 ASSERT_TRUE(GetClient(i)->AwaitMigration(migrate_types)); |
| 130 } | 130 } |
| 131 } | 131 } |
| 132 | 132 |
| 133 bool ShouldRunMigrationTest() const { | 133 bool ShouldRunMigrationTest() const { |
| 134 if (!ServerSupportsNotificationControl() || | 134 if (!ServerSupportsNotificationControl() || |
| 135 !ServerSupportsErrorTriggering()) { | 135 !ServerSupportsErrorTriggering()) { |
| 136 LOG(WARNING) << "Test skipped in this server environment."; | 136 LOG(WARNING) << "Test skipped in this server environment."; |
| 137 return false; | 137 return false; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 RunMigrationTest(migration_list, trigger_method); | 204 RunMigrationTest(migration_list, trigger_method); |
| 205 } | 205 } |
| 206 | 206 |
| 207 private: | 207 private: |
| 208 DISALLOW_COPY_AND_ASSIGN(MigrationSingleClientTest); | 208 DISALLOW_COPY_AND_ASSIGN(MigrationSingleClientTest); |
| 209 }; | 209 }; |
| 210 | 210 |
| 211 // The simplest possible migration tests -- a single data type. | 211 // The simplest possible migration tests -- a single data type. |
| 212 | 212 |
| 213 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, PrefsOnlyModifyPref) { | 213 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, PrefsOnlyModifyPref) { |
| 214 RunSingleClientMigrationTest(MakeList(syncable::PREFERENCES), MODIFY_PREF); | 214 RunSingleClientMigrationTest(MakeList(syncer::PREFERENCES), MODIFY_PREF); |
| 215 } | 215 } |
| 216 | 216 |
| 217 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, PrefsOnlyModifyBookmark) { | 217 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, PrefsOnlyModifyBookmark) { |
| 218 RunSingleClientMigrationTest(MakeList(syncable::PREFERENCES), | 218 RunSingleClientMigrationTest(MakeList(syncer::PREFERENCES), |
| 219 MODIFY_BOOKMARK); | 219 MODIFY_BOOKMARK); |
| 220 } | 220 } |
| 221 | 221 |
| 222 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, | 222 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, |
| 223 PrefsOnlyTriggerNotification) { | 223 PrefsOnlyTriggerNotification) { |
| 224 RunSingleClientMigrationTest(MakeList(syncable::PREFERENCES), | 224 RunSingleClientMigrationTest(MakeList(syncer::PREFERENCES), |
| 225 TRIGGER_NOTIFICATION); | 225 TRIGGER_NOTIFICATION); |
| 226 } | 226 } |
| 227 | 227 |
| 228 // Nigori is handled specially, so we test that separately. | 228 // Nigori is handled specially, so we test that separately. |
| 229 | 229 |
| 230 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, NigoriOnly) { | 230 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, NigoriOnly) { |
| 231 RunSingleClientMigrationTest(MakeList(syncable::PREFERENCES), | 231 RunSingleClientMigrationTest(MakeList(syncer::PREFERENCES), |
| 232 TRIGGER_NOTIFICATION); | 232 TRIGGER_NOTIFICATION); |
| 233 } | 233 } |
| 234 | 234 |
| 235 // A little more complicated -- two data types. | 235 // A little more complicated -- two data types. |
| 236 | 236 |
| 237 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, | 237 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, |
| 238 BookmarksPrefsIndividually) { | 238 BookmarksPrefsIndividually) { |
| 239 RunSingleClientMigrationTest( | 239 RunSingleClientMigrationTest( |
| 240 MakeList(syncable::BOOKMARKS, syncable::PREFERENCES), | 240 MakeList(syncer::BOOKMARKS, syncer::PREFERENCES), |
| 241 MODIFY_PREF); | 241 MODIFY_PREF); |
| 242 } | 242 } |
| 243 | 243 |
| 244 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, BookmarksPrefsBoth) { | 244 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, BookmarksPrefsBoth) { |
| 245 RunSingleClientMigrationTest( | 245 RunSingleClientMigrationTest( |
| 246 MakeList(MakeSet(syncable::BOOKMARKS, syncable::PREFERENCES)), | 246 MakeList(MakeSet(syncer::BOOKMARKS, syncer::PREFERENCES)), |
| 247 MODIFY_BOOKMARK); | 247 MODIFY_BOOKMARK); |
| 248 } | 248 } |
| 249 | 249 |
| 250 // Two data types with one being nigori. | 250 // Two data types with one being nigori. |
| 251 | 251 |
| 252 // See crbug.com/124480. | 252 // See crbug.com/124480. |
| 253 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, | 253 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, |
| 254 DISABLED_PrefsNigoriIndividiaully) { | 254 DISABLED_PrefsNigoriIndividiaully) { |
| 255 RunSingleClientMigrationTest( | 255 RunSingleClientMigrationTest( |
| 256 MakeList(syncable::PREFERENCES, syncable::NIGORI), | 256 MakeList(syncer::PREFERENCES, syncer::NIGORI), |
| 257 TRIGGER_NOTIFICATION); | 257 TRIGGER_NOTIFICATION); |
| 258 } | 258 } |
| 259 | 259 |
| 260 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, PrefsNigoriBoth) { | 260 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, PrefsNigoriBoth) { |
| 261 RunSingleClientMigrationTest( | 261 RunSingleClientMigrationTest( |
| 262 MakeList(MakeSet(syncable::PREFERENCES, syncable::NIGORI)), | 262 MakeList(MakeSet(syncer::PREFERENCES, syncer::NIGORI)), |
| 263 MODIFY_PREF); | 263 MODIFY_PREF); |
| 264 } | 264 } |
| 265 | 265 |
| 266 // The whole shebang -- all data types. | 266 // The whole shebang -- all data types. |
| 267 | 267 |
| 268 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, AllTypesIndividually) { | 268 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, AllTypesIndividually) { |
| 269 ASSERT_TRUE(SetupClients()); | 269 ASSERT_TRUE(SetupClients()); |
| 270 RunSingleClientMigrationTest(GetPreferredDataTypesList(), MODIFY_BOOKMARK); | 270 RunSingleClientMigrationTest(GetPreferredDataTypesList(), MODIFY_BOOKMARK); |
| 271 } | 271 } |
| 272 | 272 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 290 TRIGGER_NOTIFICATION); | 290 TRIGGER_NOTIFICATION); |
| 291 } | 291 } |
| 292 | 292 |
| 293 // All data types plus nigori. | 293 // All data types plus nigori. |
| 294 | 294 |
| 295 // See crbug.com/124480. | 295 // See crbug.com/124480. |
| 296 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, | 296 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, |
| 297 DISABLED_AllTypesWithNigoriIndividually) { | 297 DISABLED_AllTypesWithNigoriIndividually) { |
| 298 ASSERT_TRUE(SetupClients()); | 298 ASSERT_TRUE(SetupClients()); |
| 299 MigrationList migration_list = GetPreferredDataTypesList(); | 299 MigrationList migration_list = GetPreferredDataTypesList(); |
| 300 migration_list.push_front(MakeSet(syncable::NIGORI)); | 300 migration_list.push_front(MakeSet(syncer::NIGORI)); |
| 301 RunSingleClientMigrationTest(migration_list, MODIFY_BOOKMARK); | 301 RunSingleClientMigrationTest(migration_list, MODIFY_BOOKMARK); |
| 302 } | 302 } |
| 303 | 303 |
| 304 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, | 304 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, |
| 305 AllTypesWithNigoriAtOnce) { | 305 AllTypesWithNigoriAtOnce) { |
| 306 ASSERT_TRUE(SetupClients()); | 306 ASSERT_TRUE(SetupClients()); |
| 307 syncable::ModelTypeSet all_types = GetPreferredDataTypes(); | 307 syncer::ModelTypeSet all_types = GetPreferredDataTypes(); |
| 308 all_types.Put(syncable::NIGORI); | 308 all_types.Put(syncer::NIGORI); |
| 309 RunSingleClientMigrationTest(MakeList(all_types), MODIFY_PREF); | 309 RunSingleClientMigrationTest(MakeList(all_types), MODIFY_PREF); |
| 310 } | 310 } |
| 311 | 311 |
| 312 class MigrationTwoClientTest : public MigrationTest { | 312 class MigrationTwoClientTest : public MigrationTest { |
| 313 public: | 313 public: |
| 314 MigrationTwoClientTest() : MigrationTest(TWO_CLIENT) {} | 314 MigrationTwoClientTest() : MigrationTest(TWO_CLIENT) {} |
| 315 virtual ~MigrationTwoClientTest() {} | 315 virtual ~MigrationTwoClientTest() {} |
| 316 | 316 |
| 317 // Helper function that verifies that preferences sync still works. | 317 // Helper function that verifies that preferences sync still works. |
| 318 void VerifyPrefSync() { | 318 void VerifyPrefSync() { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 339 VerifyPrefSync(); | 339 VerifyPrefSync(); |
| 340 } | 340 } |
| 341 | 341 |
| 342 private: | 342 private: |
| 343 DISALLOW_COPY_AND_ASSIGN(MigrationTwoClientTest); | 343 DISALLOW_COPY_AND_ASSIGN(MigrationTwoClientTest); |
| 344 }; | 344 }; |
| 345 | 345 |
| 346 // Easiest possible test of migration errors: triggers a server | 346 // Easiest possible test of migration errors: triggers a server |
| 347 // migration on one datatype, then modifies some other datatype. | 347 // migration on one datatype, then modifies some other datatype. |
| 348 IN_PROC_BROWSER_TEST_F(MigrationTwoClientTest, MigratePrefsThenModifyBookmark) { | 348 IN_PROC_BROWSER_TEST_F(MigrationTwoClientTest, MigratePrefsThenModifyBookmark) { |
| 349 RunTwoClientMigrationTest(MakeList(syncable::PREFERENCES), | 349 RunTwoClientMigrationTest(MakeList(syncer::PREFERENCES), |
| 350 MODIFY_BOOKMARK); | 350 MODIFY_BOOKMARK); |
| 351 } | 351 } |
| 352 | 352 |
| 353 // Triggers a server migration on two datatypes, then makes a local | 353 // Triggers a server migration on two datatypes, then makes a local |
| 354 // modification to one of them. | 354 // modification to one of them. |
| 355 IN_PROC_BROWSER_TEST_F(MigrationTwoClientTest, | 355 IN_PROC_BROWSER_TEST_F(MigrationTwoClientTest, |
| 356 MigratePrefsAndBookmarksThenModifyBookmark) { | 356 MigratePrefsAndBookmarksThenModifyBookmark) { |
| 357 RunTwoClientMigrationTest( | 357 RunTwoClientMigrationTest( |
| 358 MakeList(syncable::PREFERENCES, syncable::BOOKMARKS), | 358 MakeList(syncer::PREFERENCES, syncer::BOOKMARKS), |
| 359 MODIFY_BOOKMARK); | 359 MODIFY_BOOKMARK); |
| 360 } | 360 } |
| 361 | 361 |
| 362 // Migrate every datatype in sequence; the catch being that the server | 362 // Migrate every datatype in sequence; the catch being that the server |
| 363 // will only tell the client about the migrations one at a time. | 363 // will only tell the client about the migrations one at a time. |
| 364 IN_PROC_BROWSER_TEST_F(MigrationTwoClientTest, MigrationHellWithoutNigori) { | 364 IN_PROC_BROWSER_TEST_F(MigrationTwoClientTest, MigrationHellWithoutNigori) { |
| 365 ASSERT_TRUE(SetupClients()); | 365 ASSERT_TRUE(SetupClients()); |
| 366 MigrationList migration_list = GetPreferredDataTypesList(); | 366 MigrationList migration_list = GetPreferredDataTypesList(); |
| 367 // Let the first nudge be a datatype that's neither prefs nor | 367 // Let the first nudge be a datatype that's neither prefs nor |
| 368 // bookmarks. | 368 // bookmarks. |
| 369 migration_list.push_front(MakeSet(syncable::THEMES)); | 369 migration_list.push_front(MakeSet(syncer::THEMES)); |
| 370 RunTwoClientMigrationTest(migration_list, MODIFY_BOOKMARK); | 370 RunTwoClientMigrationTest(migration_list, MODIFY_BOOKMARK); |
| 371 } | 371 } |
| 372 | 372 |
| 373 // See crbug.com/124480. | 373 // See crbug.com/124480. |
| 374 IN_PROC_BROWSER_TEST_F(MigrationTwoClientTest, | 374 IN_PROC_BROWSER_TEST_F(MigrationTwoClientTest, |
| 375 DISABLED_MigrationHellWithNigori) { | 375 DISABLED_MigrationHellWithNigori) { |
| 376 ASSERT_TRUE(SetupClients()); | 376 ASSERT_TRUE(SetupClients()); |
| 377 MigrationList migration_list = GetPreferredDataTypesList(); | 377 MigrationList migration_list = GetPreferredDataTypesList(); |
| 378 // Let the first nudge be a datatype that's neither prefs nor | 378 // Let the first nudge be a datatype that's neither prefs nor |
| 379 // bookmarks. | 379 // bookmarks. |
| 380 migration_list.push_front(MakeSet(syncable::THEMES)); | 380 migration_list.push_front(MakeSet(syncer::THEMES)); |
| 381 // Pop off one so that we don't migrate all data types; the syncer | 381 // Pop off one so that we don't migrate all data types; the syncer |
| 382 // freaks out if we do that (see http://crbug.com/94882). | 382 // freaks out if we do that (see http://crbug.com/94882). |
| 383 ASSERT_GE(migration_list.size(), 2u); | 383 ASSERT_GE(migration_list.size(), 2u); |
| 384 ASSERT_FALSE(migration_list.back().Equals(MakeSet(syncable::NIGORI))); | 384 ASSERT_FALSE(migration_list.back().Equals(MakeSet(syncer::NIGORI))); |
| 385 migration_list.back() = MakeSet(syncable::NIGORI); | 385 migration_list.back() = MakeSet(syncer::NIGORI); |
| 386 RunTwoClientMigrationTest(migration_list, MODIFY_BOOKMARK); | 386 RunTwoClientMigrationTest(migration_list, MODIFY_BOOKMARK); |
| 387 } | 387 } |
| 388 | 388 |
| 389 class MigrationReconfigureTest : public MigrationTwoClientTest { | 389 class MigrationReconfigureTest : public MigrationTwoClientTest { |
| 390 public: | 390 public: |
| 391 MigrationReconfigureTest() {} | 391 MigrationReconfigureTest() {} |
| 392 | 392 |
| 393 virtual void SetUpCommandLine(CommandLine* cl) OVERRIDE { | 393 virtual void SetUpCommandLine(CommandLine* cl) OVERRIDE { |
| 394 AddTestSwitches(cl); | 394 AddTestSwitches(cl); |
| 395 // Do not add optional datatypes. | 395 // Do not add optional datatypes. |
| 396 } | 396 } |
| 397 | 397 |
| 398 virtual ~MigrationReconfigureTest() {} | 398 virtual ~MigrationReconfigureTest() {} |
| 399 | 399 |
| 400 private: | 400 private: |
| 401 DISALLOW_COPY_AND_ASSIGN(MigrationReconfigureTest); | 401 DISALLOW_COPY_AND_ASSIGN(MigrationReconfigureTest); |
| 402 }; | 402 }; |
| 403 | 403 |
| 404 } // namespace | 404 } // namespace |
| OLD | NEW |