| 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" |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 } | 244 } |
| 245 | 245 |
| 246 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, BookmarksPrefsBoth) { | 246 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, BookmarksPrefsBoth) { |
| 247 RunSingleClientMigrationTest( | 247 RunSingleClientMigrationTest( |
| 248 MakeList(MakeSet(syncable::BOOKMARKS, syncable::PREFERENCES)), | 248 MakeList(MakeSet(syncable::BOOKMARKS, syncable::PREFERENCES)), |
| 249 MODIFY_BOOKMARK); | 249 MODIFY_BOOKMARK); |
| 250 } | 250 } |
| 251 | 251 |
| 252 // Two data types with one being nigori. | 252 // Two data types with one being nigori. |
| 253 | 253 |
| 254 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, PrefsNigoriIndividiaully) { | 254 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, |
| 255 DISABLED_PrefsNigoriIndividiaully) { |
| 255 RunSingleClientMigrationTest( | 256 RunSingleClientMigrationTest( |
| 256 MakeList(syncable::PREFERENCES, syncable::NIGORI), | 257 MakeList(syncable::PREFERENCES, syncable::NIGORI), |
| 257 TRIGGER_NOTIFICATION); | 258 TRIGGER_NOTIFICATION); |
| 258 } | 259 } |
| 259 | 260 |
| 260 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, PrefsNigoriBoth) { | 261 // TODO(rlarocque): Re-enable this test when crbug.com/122033 is fixed. |
| 262 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, DISABLED_PrefsNigoriBoth) { |
| 261 RunSingleClientMigrationTest( | 263 RunSingleClientMigrationTest( |
| 262 MakeList(MakeSet(syncable::PREFERENCES, syncable::NIGORI)), | 264 MakeList(MakeSet(syncable::PREFERENCES, syncable::NIGORI)), |
| 263 MODIFY_PREF); | 265 MODIFY_PREF); |
| 264 } | 266 } |
| 265 | 267 |
| 266 // The whole shebang -- all data types. | 268 // The whole shebang -- all data types. |
| 267 | 269 |
| 268 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, AllTypesIndividually) { | 270 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, AllTypesIndividually) { |
| 269 ASSERT_TRUE(SetupClients()); | 271 ASSERT_TRUE(SetupClients()); |
| 270 RunSingleClientMigrationTest(GetPreferredDataTypesList(), MODIFY_BOOKMARK); | 272 RunSingleClientMigrationTest(GetPreferredDataTypesList(), MODIFY_BOOKMARK); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 286 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, | 288 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, |
| 287 AllTypesAtOnceTriggerNotification) { | 289 AllTypesAtOnceTriggerNotification) { |
| 288 ASSERT_TRUE(SetupClients()); | 290 ASSERT_TRUE(SetupClients()); |
| 289 RunSingleClientMigrationTest(MakeList(GetPreferredDataTypes()), | 291 RunSingleClientMigrationTest(MakeList(GetPreferredDataTypes()), |
| 290 TRIGGER_NOTIFICATION); | 292 TRIGGER_NOTIFICATION); |
| 291 } | 293 } |
| 292 | 294 |
| 293 // All data types plus nigori. | 295 // All data types plus nigori. |
| 294 | 296 |
| 295 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, | 297 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, |
| 296 AllTypesWithNigoriIndividually) { | 298 DISABLED_AllTypesWithNigoriIndividually) { |
| 297 ASSERT_TRUE(SetupClients()); | 299 ASSERT_TRUE(SetupClients()); |
| 298 MigrationList migration_list = GetPreferredDataTypesList(); | 300 MigrationList migration_list = GetPreferredDataTypesList(); |
| 299 migration_list.push_front(MakeSet(syncable::NIGORI)); | 301 migration_list.push_front(MakeSet(syncable::NIGORI)); |
| 300 RunSingleClientMigrationTest(migration_list, MODIFY_BOOKMARK); | 302 RunSingleClientMigrationTest(migration_list, MODIFY_BOOKMARK); |
| 301 } | 303 } |
| 302 | 304 |
| 303 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, AllTypesWithNigoriAtOnce) { | 305 // TODO(rlarocque): Re-enable this test when crbug.com/122033 is fixed. |
| 306 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, |
| 307 DISABLED_AllTypesWithNigoriAtOnce) { |
| 304 ASSERT_TRUE(SetupClients()); | 308 ASSERT_TRUE(SetupClients()); |
| 305 syncable::ModelTypeSet all_types = GetPreferredDataTypes(); | 309 syncable::ModelTypeSet all_types = GetPreferredDataTypes(); |
| 306 all_types.Put(syncable::NIGORI); | 310 all_types.Put(syncable::NIGORI); |
| 307 RunSingleClientMigrationTest(MakeList(all_types), MODIFY_PREF); | 311 RunSingleClientMigrationTest(MakeList(all_types), MODIFY_PREF); |
| 308 } | 312 } |
| 309 | 313 |
| 310 class MigrationTwoClientTest : public MigrationTest { | 314 class MigrationTwoClientTest : public MigrationTest { |
| 311 public: | 315 public: |
| 312 MigrationTwoClientTest() : MigrationTest(TWO_CLIENT) {} | 316 MigrationTwoClientTest() : MigrationTest(TWO_CLIENT) {} |
| 313 virtual ~MigrationTwoClientTest() {} | 317 virtual ~MigrationTwoClientTest() {} |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 // will only tell the client about the migrations one at a time. | 371 // will only tell the client about the migrations one at a time. |
| 368 IN_PROC_BROWSER_TEST_F(MigrationTwoClientTest, MigrationHellWithoutNigori) { | 372 IN_PROC_BROWSER_TEST_F(MigrationTwoClientTest, MigrationHellWithoutNigori) { |
| 369 ASSERT_TRUE(SetupClients()); | 373 ASSERT_TRUE(SetupClients()); |
| 370 MigrationList migration_list = GetPreferredDataTypesList(); | 374 MigrationList migration_list = GetPreferredDataTypesList(); |
| 371 // Let the first nudge be a datatype that's neither prefs nor | 375 // Let the first nudge be a datatype that's neither prefs nor |
| 372 // bookmarks. | 376 // bookmarks. |
| 373 migration_list.push_front(MakeSet(syncable::THEMES)); | 377 migration_list.push_front(MakeSet(syncable::THEMES)); |
| 374 RunTwoClientMigrationTest(migration_list, MODIFY_BOOKMARK); | 378 RunTwoClientMigrationTest(migration_list, MODIFY_BOOKMARK); |
| 375 } | 379 } |
| 376 | 380 |
| 377 IN_PROC_BROWSER_TEST_F(MigrationTwoClientTest, MigrationHellWithNigori) { | 381 // TODO(rlarocque) Re-enable this test when crbug.com/122033 is fixed. |
| 382 IN_PROC_BROWSER_TEST_F(MigrationTwoClientTest, |
| 383 DISABLED_MigrationHellWithNigori) { |
| 378 ASSERT_TRUE(SetupClients()); | 384 ASSERT_TRUE(SetupClients()); |
| 379 MigrationList migration_list = GetPreferredDataTypesList(); | 385 MigrationList migration_list = GetPreferredDataTypesList(); |
| 380 // Let the first nudge be a datatype that's neither prefs nor | 386 // Let the first nudge be a datatype that's neither prefs nor |
| 381 // bookmarks. | 387 // bookmarks. |
| 382 migration_list.push_front(MakeSet(syncable::THEMES)); | 388 migration_list.push_front(MakeSet(syncable::THEMES)); |
| 383 // Pop off one so that we don't migrate all data types; the syncer | 389 // Pop off one so that we don't migrate all data types; the syncer |
| 384 // freaks out if we do that (see http://crbug.com/94882). | 390 // freaks out if we do that (see http://crbug.com/94882). |
| 385 ASSERT_GE(migration_list.size(), 2u); | 391 ASSERT_GE(migration_list.size(), 2u); |
| 386 ASSERT_FALSE(migration_list.back().Equals(MakeSet(syncable::NIGORI))); | 392 ASSERT_FALSE(migration_list.back().Equals(MakeSet(syncable::NIGORI))); |
| 387 migration_list.back() = MakeSet(syncable::NIGORI); | 393 migration_list.back() = MakeSet(syncable::NIGORI); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 | 459 |
| 454 // Phase 5: Verify that preferences can still be synchronized. | 460 // Phase 5: Verify that preferences can still be synchronized. |
| 455 VerifyPrefSync(); | 461 VerifyPrefSync(); |
| 456 | 462 |
| 457 // Phase 6: Verify that sessions are registered and enabled. | 463 // Phase 6: Verify that sessions are registered and enabled. |
| 458 ASSERT_TRUE(GetClient(0)->IsTypeRunning(syncable::SESSIONS)); | 464 ASSERT_TRUE(GetClient(0)->IsTypeRunning(syncable::SESSIONS)); |
| 459 ASSERT_TRUE(GetClient(0)->IsTypePreferred(syncable::SESSIONS)); | 465 ASSERT_TRUE(GetClient(0)->IsTypePreferred(syncable::SESSIONS)); |
| 460 } | 466 } |
| 461 | 467 |
| 462 } // namespace | 468 } // namespace |
| OLD | NEW |