| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "base/compiler_specific.h" | 5 #include "base/compiler_specific.h" |
| 6 #include "base/macros.h" | 6 #include "base/macros.h" |
| 7 #include "base/memory/scoped_vector.h" | 7 #include "base/memory/scoped_vector.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" | 9 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" |
| 10 #include "chrome/browser/sync/test/integration/migration_waiter.h" | 10 #include "chrome/browser/sync/test/integration/migration_waiter.h" |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 ASSERT_TRUE(SetupSync()); | 233 ASSERT_TRUE(SetupSync()); |
| 234 RunMigrationTest(migration_list, trigger_method); | 234 RunMigrationTest(migration_list, trigger_method); |
| 235 } | 235 } |
| 236 | 236 |
| 237 private: | 237 private: |
| 238 DISALLOW_COPY_AND_ASSIGN(MigrationSingleClientTest); | 238 DISALLOW_COPY_AND_ASSIGN(MigrationSingleClientTest); |
| 239 }; | 239 }; |
| 240 | 240 |
| 241 // The simplest possible migration tests -- a single data type. | 241 // The simplest possible migration tests -- a single data type. |
| 242 | 242 |
| 243 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, | 243 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, PrefsOnlyModifyPref) { |
| 244 DISABLED_PrefsOnlyModifyPref) { | |
| 245 RunSingleClientMigrationTest(MakeList(syncer::PREFERENCES), MODIFY_PREF); | 244 RunSingleClientMigrationTest(MakeList(syncer::PREFERENCES), MODIFY_PREF); |
| 246 } | 245 } |
| 247 | 246 |
| 248 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, | 247 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, PrefsOnlyModifyBookmark) { |
| 249 DISABLED_PrefsOnlyModifyBookmark) { | |
| 250 RunSingleClientMigrationTest(MakeList(syncer::PREFERENCES), | 248 RunSingleClientMigrationTest(MakeList(syncer::PREFERENCES), |
| 251 MODIFY_BOOKMARK); | 249 MODIFY_BOOKMARK); |
| 252 } | 250 } |
| 253 | 251 |
| 254 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, | 252 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, |
| 255 DISABLED_PrefsOnlyTriggerNotification) { | 253 PrefsOnlyTriggerNotification) { |
| 256 RunSingleClientMigrationTest(MakeList(syncer::PREFERENCES), | 254 RunSingleClientMigrationTest(MakeList(syncer::PREFERENCES), |
| 257 TRIGGER_NOTIFICATION); | 255 TRIGGER_NOTIFICATION); |
| 258 } | 256 } |
| 259 | 257 |
| 260 // Nigori is handled specially, so we test that separately. | 258 // Nigori is handled specially, so we test that separately. |
| 261 | 259 |
| 262 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, DISABLED_NigoriOnly) { | 260 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, NigoriOnly) { |
| 263 RunSingleClientMigrationTest(MakeList(syncer::PREFERENCES), | 261 RunSingleClientMigrationTest(MakeList(syncer::PREFERENCES), |
| 264 TRIGGER_NOTIFICATION); | 262 TRIGGER_NOTIFICATION); |
| 265 } | 263 } |
| 266 | 264 |
| 267 // A little more complicated -- two data types. | 265 // A little more complicated -- two data types. |
| 268 | 266 |
| 269 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, | 267 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, BookmarksPrefsIndividually) { |
| 270 DISABLED_BookmarksPrefsIndividually) { | |
| 271 RunSingleClientMigrationTest( | 268 RunSingleClientMigrationTest( |
| 272 MakeList(syncer::BOOKMARKS, syncer::PREFERENCES), | 269 MakeList(syncer::BOOKMARKS, syncer::PREFERENCES), |
| 273 MODIFY_PREF); | 270 MODIFY_PREF); |
| 274 } | 271 } |
| 275 | 272 |
| 276 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, DISABLED_BookmarksPrefsBoth) { | 273 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, BookmarksPrefsBoth) { |
| 277 RunSingleClientMigrationTest( | 274 RunSingleClientMigrationTest( |
| 278 MakeList(MakeSet(syncer::BOOKMARKS, syncer::PREFERENCES)), | 275 MakeList(MakeSet(syncer::BOOKMARKS, syncer::PREFERENCES)), |
| 279 MODIFY_BOOKMARK); | 276 MODIFY_BOOKMARK); |
| 280 } | 277 } |
| 281 | 278 |
| 282 // Two data types with one being nigori. | 279 // Two data types with one being nigori. |
| 283 | 280 |
| 284 // See crbug.com/124480. | 281 // See crbug.com/124480. |
| 285 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, | 282 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, |
| 286 DISABLED_PrefsNigoriIndividiaully) { | 283 DISABLED_PrefsNigoriIndividiaully) { |
| 287 RunSingleClientMigrationTest( | 284 RunSingleClientMigrationTest( |
| 288 MakeList(syncer::PREFERENCES, syncer::NIGORI), | 285 MakeList(syncer::PREFERENCES, syncer::NIGORI), |
| 289 TRIGGER_NOTIFICATION); | 286 TRIGGER_NOTIFICATION); |
| 290 } | 287 } |
| 291 | 288 |
| 292 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, DISABLED_PrefsNigoriBoth) { | 289 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, PrefsNigoriBoth) { |
| 293 RunSingleClientMigrationTest( | 290 RunSingleClientMigrationTest( |
| 294 MakeList(MakeSet(syncer::PREFERENCES, syncer::NIGORI)), | 291 MakeList(MakeSet(syncer::PREFERENCES, syncer::NIGORI)), |
| 295 MODIFY_PREF); | 292 MODIFY_PREF); |
| 296 } | 293 } |
| 297 | 294 |
| 298 // The whole shebang -- all data types. | 295 // The whole shebang -- all data types. |
| 299 // http://crbug.com/403778 | 296 // http://crbug.com/403778 |
| 300 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, | 297 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, |
| 301 DISABLED_AllTypesIndividually) { | 298 DISABLED_AllTypesIndividually) { |
| 302 ASSERT_TRUE(SetupClients()); | 299 ASSERT_TRUE(SetupClients()); |
| 303 RunSingleClientMigrationTest(GetPreferredDataTypesList(), MODIFY_BOOKMARK); | 300 RunSingleClientMigrationTest(GetPreferredDataTypesList(), MODIFY_BOOKMARK); |
| 304 } | 301 } |
| 305 | 302 |
| 306 // http://crbug.com/403778 | 303 // http://crbug.com/403778 |
| 307 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, | 304 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, |
| 308 DISABLED_AllTypesIndividuallyTriggerNotification) { | 305 DISABLED_AllTypesIndividuallyTriggerNotification) { |
| 309 ASSERT_TRUE(SetupClients()); | 306 ASSERT_TRUE(SetupClients()); |
| 310 RunSingleClientMigrationTest(GetPreferredDataTypesList(), | 307 RunSingleClientMigrationTest(GetPreferredDataTypesList(), |
| 311 TRIGGER_NOTIFICATION); | 308 TRIGGER_NOTIFICATION); |
| 312 } | 309 } |
| 313 | 310 |
| 314 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, DISABLED_AllTypesAtOnce) { | 311 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, AllTypesAtOnce) { |
| 315 ASSERT_TRUE(SetupClients()); | 312 ASSERT_TRUE(SetupClients()); |
| 316 RunSingleClientMigrationTest(MakeList(GetPreferredDataTypes()), | 313 RunSingleClientMigrationTest(MakeList(GetPreferredDataTypes()), |
| 317 MODIFY_PREF); | 314 MODIFY_PREF); |
| 318 } | 315 } |
| 319 | 316 |
| 320 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, | 317 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, |
| 321 DISABLED_AllTypesAtOnceTriggerNotification) { | 318 AllTypesAtOnceTriggerNotification) { |
| 322 ASSERT_TRUE(SetupClients()); | 319 ASSERT_TRUE(SetupClients()); |
| 323 RunSingleClientMigrationTest(MakeList(GetPreferredDataTypes()), | 320 RunSingleClientMigrationTest(MakeList(GetPreferredDataTypes()), |
| 324 TRIGGER_NOTIFICATION); | 321 TRIGGER_NOTIFICATION); |
| 325 } | 322 } |
| 326 | 323 |
| 327 // All data types plus nigori. | 324 // All data types plus nigori. |
| 328 | 325 |
| 329 // See crbug.com/124480. | 326 // See crbug.com/124480. |
| 330 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, | 327 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, |
| 331 DISABLED_AllTypesWithNigoriIndividually) { | 328 DISABLED_AllTypesWithNigoriIndividually) { |
| 332 ASSERT_TRUE(SetupClients()); | 329 ASSERT_TRUE(SetupClients()); |
| 333 MigrationList migration_list = GetPreferredDataTypesList(); | 330 MigrationList migration_list = GetPreferredDataTypesList(); |
| 334 migration_list.push_front(MakeSet(syncer::NIGORI)); | 331 migration_list.push_front(MakeSet(syncer::NIGORI)); |
| 335 RunSingleClientMigrationTest(migration_list, MODIFY_BOOKMARK); | 332 RunSingleClientMigrationTest(migration_list, MODIFY_BOOKMARK); |
| 336 } | 333 } |
| 337 | 334 |
| 338 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, | 335 IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, AllTypesWithNigoriAtOnce) { |
| 339 DISABLED_AllTypesWithNigoriAtOnce) { | |
| 340 ASSERT_TRUE(SetupClients()); | 336 ASSERT_TRUE(SetupClients()); |
| 341 syncer::ModelTypeSet all_types = GetPreferredDataTypes(); | 337 syncer::ModelTypeSet all_types = GetPreferredDataTypes(); |
| 342 all_types.Put(syncer::NIGORI); | 338 all_types.Put(syncer::NIGORI); |
| 343 RunSingleClientMigrationTest(MakeList(all_types), MODIFY_PREF); | 339 RunSingleClientMigrationTest(MakeList(all_types), MODIFY_PREF); |
| 344 } | 340 } |
| 345 | 341 |
| 346 class MigrationTwoClientTest : public MigrationTest { | 342 class MigrationTwoClientTest : public MigrationTest { |
| 347 public: | 343 public: |
| 348 MigrationTwoClientTest() : MigrationTest(TWO_CLIENT_LEGACY) {} | 344 MigrationTwoClientTest() : MigrationTest(TWO_CLIENT_LEGACY) {} |
| 349 ~MigrationTwoClientTest() override {} | 345 ~MigrationTwoClientTest() override {} |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 // Do not add optional datatypes. | 427 // Do not add optional datatypes. |
| 432 } | 428 } |
| 433 | 429 |
| 434 ~MigrationReconfigureTest() override {} | 430 ~MigrationReconfigureTest() override {} |
| 435 | 431 |
| 436 private: | 432 private: |
| 437 DISALLOW_COPY_AND_ASSIGN(MigrationReconfigureTest); | 433 DISALLOW_COPY_AND_ASSIGN(MigrationReconfigureTest); |
| 438 }; | 434 }; |
| 439 | 435 |
| 440 } // namespace | 436 } // namespace |
| OLD | NEW |