| 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/memory/scoped_vector.h" | 6 #include "base/memory/scoped_vector.h" |
| 7 #include "base/prefs/scoped_user_pref_update.h" | 7 #include "base/prefs/scoped_user_pref_update.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/sync/profile_sync_service.h" | 9 #include "chrome/browser/sync/profile_sync_service.h" |
| 10 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" | 10 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 class MigrationTest : public SyncTest { | 70 class MigrationTest : public SyncTest { |
| 71 public: | 71 public: |
| 72 explicit MigrationTest(TestType test_type) : SyncTest(test_type) {} | 72 explicit MigrationTest(TestType test_type) : SyncTest(test_type) {} |
| 73 virtual ~MigrationTest() {} | 73 virtual ~MigrationTest() {} |
| 74 | 74 |
| 75 enum TriggerMethod { MODIFY_PREF, MODIFY_BOOKMARK, TRIGGER_NOTIFICATION }; | 75 enum TriggerMethod { MODIFY_PREF, MODIFY_BOOKMARK, TRIGGER_NOTIFICATION }; |
| 76 | 76 |
| 77 // Set up sync for all profiles and initialize all MigrationWatchers. This | 77 // Set up sync for all profiles and initialize all MigrationWatchers. This |
| 78 // helps ensure that all migration events are captured, even if they were to | 78 // helps ensure that all migration events are captured, even if they were to |
| 79 // occur before a test calls AwaitMigration for a specific profile. | 79 // occur before a test calls AwaitMigration for a specific profile. |
| 80 virtual bool SetupSync() OVERRIDE { | 80 virtual bool SetupSync() override { |
| 81 if (!SyncTest::SetupSync()) | 81 if (!SyncTest::SetupSync()) |
| 82 return false; | 82 return false; |
| 83 | 83 |
| 84 for (int i = 0; i < num_clients(); ++i) { | 84 for (int i = 0; i < num_clients(); ++i) { |
| 85 MigrationWatcher* watcher = new MigrationWatcher(GetClient(i)); | 85 MigrationWatcher* watcher = new MigrationWatcher(GetClient(i)); |
| 86 migration_watchers_.push_back(watcher); | 86 migration_watchers_.push_back(watcher); |
| 87 } | 87 } |
| 88 return true; | 88 return true; |
| 89 } | 89 } |
| 90 | 90 |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 ASSERT_GE(migration_list.size(), 2u); | 414 ASSERT_GE(migration_list.size(), 2u); |
| 415 ASSERT_FALSE(migration_list.back().Equals(MakeSet(syncer::NIGORI))); | 415 ASSERT_FALSE(migration_list.back().Equals(MakeSet(syncer::NIGORI))); |
| 416 migration_list.back() = MakeSet(syncer::NIGORI); | 416 migration_list.back() = MakeSet(syncer::NIGORI); |
| 417 RunTwoClientMigrationTest(migration_list, MODIFY_BOOKMARK); | 417 RunTwoClientMigrationTest(migration_list, MODIFY_BOOKMARK); |
| 418 } | 418 } |
| 419 | 419 |
| 420 class MigrationReconfigureTest : public MigrationTwoClientTest { | 420 class MigrationReconfigureTest : public MigrationTwoClientTest { |
| 421 public: | 421 public: |
| 422 MigrationReconfigureTest() {} | 422 MigrationReconfigureTest() {} |
| 423 | 423 |
| 424 virtual void SetUpCommandLine(base::CommandLine* cl) OVERRIDE { | 424 virtual void SetUpCommandLine(base::CommandLine* cl) override { |
| 425 AddTestSwitches(cl); | 425 AddTestSwitches(cl); |
| 426 // Do not add optional datatypes. | 426 // Do not add optional datatypes. |
| 427 } | 427 } |
| 428 | 428 |
| 429 virtual ~MigrationReconfigureTest() {} | 429 virtual ~MigrationReconfigureTest() {} |
| 430 | 430 |
| 431 private: | 431 private: |
| 432 DISALLOW_COPY_AND_ASSIGN(MigrationReconfigureTest); | 432 DISALLOW_COPY_AND_ASSIGN(MigrationReconfigureTest); |
| 433 }; | 433 }; |
| 434 | 434 |
| 435 } // namespace | 435 } // namespace |
| OLD | NEW |