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 #include "chrome/browser/sync/profile_sync_service.h" | 5 #include "chrome/browser/sync/profile_sync_service.h" |
6 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" | 6 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" |
7 #include "chrome/browser/sync/test/integration/sync_test.h" | 7 #include "chrome/browser/sync/test/integration/sync_test.h" |
8 #include "sync/internal_api/public/base/model_type.h" | 8 #include "sync/internal_api/public/base/model_type.h" |
9 #include "sync/internal_api/public/read_node.h" | 9 #include "sync/internal_api/public/read_node.h" |
10 #include "sync/internal_api/public/read_transaction.h" | 10 #include "sync/internal_api/public/read_transaction.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 syncer::ModelType type) { | 37 syncer::ModelType type) { |
38 return data_type_status_table.GetUnreadyErrorTypes().Has(type); | 38 return data_type_status_table.GetUnreadyErrorTypes().Has(type); |
39 } | 39 } |
40 | 40 |
41 IN_PROC_BROWSER_TEST_F(EnableDisableSingleClientTest, EnableOneAtATime) { | 41 IN_PROC_BROWSER_TEST_F(EnableDisableSingleClientTest, EnableOneAtATime) { |
42 ASSERT_TRUE(SetupClients()); | 42 ASSERT_TRUE(SetupClients()); |
43 | 43 |
44 // Setup sync with no enabled types. | 44 // Setup sync with no enabled types. |
45 ASSERT_TRUE(GetClient(0)->SetupSync(syncer::ModelTypeSet())); | 45 ASSERT_TRUE(GetClient(0)->SetupSync(syncer::ModelTypeSet())); |
46 | 46 |
47 const syncer::ModelTypeSet registered_types = | |
48 GetSyncService(0)->GetRegisteredDataTypes(); | |
49 syncer::UserShare* user_share = GetSyncService(0)->GetUserShare(); | 47 syncer::UserShare* user_share = GetSyncService(0)->GetUserShare(); |
50 const sync_driver::DataTypeStatusTable& data_type_status_table = | 48 const sync_driver::DataTypeStatusTable& data_type_status_table = |
51 GetSyncService(0)->data_type_status_table(); | 49 GetSyncService(0)->data_type_status_table(); |
52 for (syncer::ModelTypeSet::Iterator it = registered_types.First(); | 50 |
| 51 const syncer::ModelTypeSet registered_types = |
| 52 GetSyncService(0)->GetRegisteredDataTypes(); |
| 53 const syncer::ModelTypeSet registered_user_types = |
| 54 Intersection(registered_types, syncer::UserSelectableTypes()); |
| 55 for (syncer::ModelTypeSet::Iterator it = registered_user_types.First(); |
53 it.Good(); it.Inc()) { | 56 it.Good(); it.Inc()) { |
54 ASSERT_TRUE(GetClient(0)->EnableSyncForDatatype(it.Get())); | 57 ASSERT_TRUE(GetClient(0)->EnableSyncForDatatype(it.Get())); |
55 | 58 |
56 // AUTOFILL_PROFILE is lumped together with AUTOFILL. | 59 // AUTOFILL_PROFILE is lumped together with AUTOFILL. |
57 // SESSIONS is lumped together with PROXY_TABS and | 60 // SESSIONS is lumped together with PROXY_TABS and |
58 // HISTORY_DELETE_DIRECTIVES. | 61 // HISTORY_DELETE_DIRECTIVES. |
59 // Favicons are lumped together with PROXY_TABS and | 62 // Favicons are lumped together with PROXY_TABS and |
60 // HISTORY_DELETE_DIRECTIVES. | 63 // HISTORY_DELETE_DIRECTIVES. |
61 if (it.Get() == syncer::AUTOFILL_PROFILE || it.Get() == syncer::SESSIONS) { | 64 if (it.Get() == syncer::AUTOFILL_PROFILE || it.Get() == syncer::SESSIONS) { |
62 continue; | 65 continue; |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 ASSERT_EQ(GetClient(0)->IsTypePreferred(syncer::TYPED_URLS), | 156 ASSERT_EQ(GetClient(0)->IsTypePreferred(syncer::TYPED_URLS), |
154 DoesTopLevelNodeExist(user_share, syncer::SESSIONS)); | 157 DoesTopLevelNodeExist(user_share, syncer::SESSIONS)); |
155 } else if (it.Get() == syncer::PREFERENCES) { | 158 } else if (it.Get() == syncer::PREFERENCES) { |
156 ASSERT_FALSE(DoesTopLevelNodeExist(user_share, | 159 ASSERT_FALSE(DoesTopLevelNodeExist(user_share, |
157 syncer::PRIORITY_PREFERENCES)); | 160 syncer::PRIORITY_PREFERENCES)); |
158 } | 161 } |
159 } | 162 } |
160 } | 163 } |
161 | 164 |
162 } // namespace | 165 } // namespace |
OLD | NEW |