Chromium Code Reviews| 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 <memory> | 5 #include <memory> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 105 | 105 |
| 106 // Autofill wallet will be unready during this test, so we should not | 106 // Autofill wallet will be unready during this test, so we should not |
| 107 // request that it be migrated. | 107 // request that it be migrated. |
| 108 preferred_data_types.Remove(syncer::AUTOFILL_WALLET_DATA); | 108 preferred_data_types.Remove(syncer::AUTOFILL_WALLET_DATA); |
| 109 preferred_data_types.Remove(syncer::AUTOFILL_WALLET_METADATA); | 109 preferred_data_types.Remove(syncer::AUTOFILL_WALLET_METADATA); |
| 110 | 110 |
| 111 // ARC package will be unready during this test, so we should not request | 111 // ARC package will be unready during this test, so we should not request |
| 112 // that it be migrated. | 112 // that it be migrated. |
| 113 preferred_data_types.Remove(syncer::ARC_PACKAGE); | 113 preferred_data_types.Remove(syncer::ARC_PACKAGE); |
| 114 | 114 |
| 115 // Doesn't make sense to migrate commit only types. | |
| 116 preferred_data_types.RemoveAll(syncer::CommitOnlyTypes()); | |
| 117 | |
| 115 // Make sure all clients have the same preferred data types. | 118 // Make sure all clients have the same preferred data types. |
| 116 for (int i = 1; i < num_clients(); ++i) { | 119 for (int i = 1; i < num_clients(); ++i) { |
| 117 const syncer::ModelTypeSet other_preferred_data_types = | 120 const syncer::ModelTypeSet other_preferred_data_types = |
| 118 GetSyncService(i)->GetPreferredDataTypes(); | 121 GetSyncService(i)->GetPreferredDataTypes(); |
| 119 EXPECT_EQ(other_preferred_data_types, preferred_data_types); | 122 EXPECT_EQ(other_preferred_data_types, preferred_data_types); |
| 120 } | 123 } |
| 121 return preferred_data_types; | 124 return preferred_data_types; |
| 122 } | 125 } |
| 123 | 126 |
| 124 // Returns a MigrationList with every enabled data type in its own | 127 // Returns a MigrationList with every enabled data type in its own |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 155 break; | 158 break; |
| 156 default: | 159 default: |
| 157 ADD_FAILURE(); | 160 ADD_FAILURE(); |
| 158 } | 161 } |
| 159 } | 162 } |
| 160 | 163 |
| 161 // Block until all clients have completed migration for the given | 164 // Block until all clients have completed migration for the given |
| 162 // types. | 165 // types. |
| 163 void AwaitMigration(syncer::ModelTypeSet migrate_types) { | 166 void AwaitMigration(syncer::ModelTypeSet migrate_types) { |
| 164 for (int i = 0; i < num_clients(); ++i) { | 167 for (int i = 0; i < num_clients(); ++i) { |
| 168 LOG(ERROR) << "SKYM " << syncer::ModelTypeSetToString(migrate_types); | |
|
Patrick Noland
2017/06/26 19:20:23
Did you mean to include this? If so, could you mak
skym
2017/06/26 19:59:40
I did not! Whoops. Removed.
| |
| 165 ASSERT_TRUE( | 169 ASSERT_TRUE( |
| 166 MigrationWaiter(migrate_types, migration_watchers_[i].get()).Wait()); | 170 MigrationWaiter(migrate_types, migration_watchers_[i].get()).Wait()); |
| 167 } | 171 } |
| 168 } | 172 } |
| 169 | 173 |
| 170 // Makes sure migration works with the given migration list and | 174 // Makes sure migration works with the given migration list and |
| 171 // trigger method. | 175 // trigger method. |
| 172 void RunMigrationTest(const MigrationList& migration_list, | 176 void RunMigrationTest(const MigrationList& migration_list, |
| 173 TriggerMethod trigger_method) { | 177 TriggerMethod trigger_method) { |
| 174 // If we have only one client, turn off notifications to avoid the | 178 // If we have only one client, turn off notifications to avoid the |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 428 // Do not add optional datatypes. | 432 // Do not add optional datatypes. |
| 429 } | 433 } |
| 430 | 434 |
| 431 ~MigrationReconfigureTest() override {} | 435 ~MigrationReconfigureTest() override {} |
| 432 | 436 |
| 433 private: | 437 private: |
| 434 DISALLOW_COPY_AND_ASSIGN(MigrationReconfigureTest); | 438 DISALLOW_COPY_AND_ASSIGN(MigrationReconfigureTest); |
| 435 }; | 439 }; |
| 436 | 440 |
| 437 } // namespace | 441 } // namespace |
| OLD | NEW |