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