| 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(); |
| 47 syncer::UserShare* user_share = GetSyncService(0)->GetUserShare(); | 49 syncer::UserShare* user_share = GetSyncService(0)->GetUserShare(); |
| 48 const sync_driver::DataTypeStatusTable& data_type_status_table = | 50 const sync_driver::DataTypeStatusTable& data_type_status_table = |
| 49 GetSyncService(0)->data_type_status_table(); | 51 GetSyncService(0)->data_type_status_table(); |
| 50 | 52 for (syncer::ModelTypeSet::Iterator it = registered_types.First(); |
| 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(); | |
| 56 it.Good(); it.Inc()) { | 53 it.Good(); it.Inc()) { |
| 57 ASSERT_TRUE(GetClient(0)->EnableSyncForDatatype(it.Get())); | 54 ASSERT_TRUE(GetClient(0)->EnableSyncForDatatype(it.Get())); |
| 58 | 55 |
| 59 // AUTOFILL_PROFILE is lumped together with AUTOFILL. | 56 // AUTOFILL_PROFILE is lumped together with AUTOFILL. |
| 60 // SESSIONS is lumped together with PROXY_TABS and | 57 // SESSIONS is lumped together with PROXY_TABS and |
| 61 // HISTORY_DELETE_DIRECTIVES. | 58 // HISTORY_DELETE_DIRECTIVES. |
| 62 // Favicons are lumped together with PROXY_TABS and | 59 // Favicons are lumped together with PROXY_TABS and |
| 63 // HISTORY_DELETE_DIRECTIVES. | 60 // HISTORY_DELETE_DIRECTIVES. |
| 64 if (it.Get() == syncer::AUTOFILL_PROFILE || it.Get() == syncer::SESSIONS) { | 61 if (it.Get() == syncer::AUTOFILL_PROFILE || it.Get() == syncer::SESSIONS) { |
| 65 continue; | 62 continue; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 ASSERT_EQ(GetClient(0)->IsTypePreferred(syncer::TYPED_URLS), | 153 ASSERT_EQ(GetClient(0)->IsTypePreferred(syncer::TYPED_URLS), |
| 157 DoesTopLevelNodeExist(user_share, syncer::SESSIONS)); | 154 DoesTopLevelNodeExist(user_share, syncer::SESSIONS)); |
| 158 } else if (it.Get() == syncer::PREFERENCES) { | 155 } else if (it.Get() == syncer::PREFERENCES) { |
| 159 ASSERT_FALSE(DoesTopLevelNodeExist(user_share, | 156 ASSERT_FALSE(DoesTopLevelNodeExist(user_share, |
| 160 syncer::PRIORITY_PREFERENCES)); | 157 syncer::PRIORITY_PREFERENCES)); |
| 161 } | 158 } |
| 162 } | 159 } |
| 163 } | 160 } |
| 164 | 161 |
| 165 } // namespace | 162 } // namespace |
| OLD | NEW |