| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 syncer::ModelTypeSet GetPreferredDataTypes() { | 76 syncer::ModelTypeSet GetPreferredDataTypes() { |
| 77 const syncer::ModelTypeSet preferred_data_types = | 77 syncer::ModelTypeSet preferred_data_types = |
| 78 GetClient(0)->service()->GetPreferredDataTypes(); | 78 GetClient(0)->service()->GetPreferredDataTypes(); |
| 79 preferred_data_types.RemoveAll(syncer::VirtualTypes()); |
| 79 // Make sure all clients have the same preferred data types. | 80 // Make sure all clients have the same preferred data types. |
| 80 for (int i = 1; i < num_clients(); ++i) { | 81 for (int i = 1; i < num_clients(); ++i) { |
| 81 const syncer::ModelTypeSet other_preferred_data_types = | 82 const syncer::ModelTypeSet other_preferred_data_types = |
| 82 GetClient(i)->service()->GetPreferredDataTypes(); | 83 GetClient(i)->service()->GetPreferredDataTypes(); |
| 83 EXPECT_TRUE(preferred_data_types.Equals(other_preferred_data_types)); | 84 EXPECT_TRUE(preferred_data_types.Equals(other_preferred_data_types)); |
| 84 } | 85 } |
| 85 return preferred_data_types; | 86 return preferred_data_types; |
| 86 } | 87 } |
| 87 | 88 |
| 88 // Returns a MigrationList with every enabled data type in its own | 89 // Returns a MigrationList with every enabled data type in its own |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 // Do not add optional datatypes. | 401 // Do not add optional datatypes. |
| 401 } | 402 } |
| 402 | 403 |
| 403 virtual ~MigrationReconfigureTest() {} | 404 virtual ~MigrationReconfigureTest() {} |
| 404 | 405 |
| 405 private: | 406 private: |
| 406 DISALLOW_COPY_AND_ASSIGN(MigrationReconfigureTest); | 407 DISALLOW_COPY_AND_ASSIGN(MigrationReconfigureTest); |
| 407 }; | 408 }; |
| 408 | 409 |
| 409 } // namespace | 410 } // namespace |
| OLD | NEW |