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/test/integration/sync_test.h" | 5 #include "chrome/browser/sync/test/integration/sync_test.h" |
6 | 6 |
7 #include "chrome/browser/sync/profile_sync_service_harness.h" | 7 #include "chrome/browser/sync/profile_sync_service_harness.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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 if (!syncer::ProxyTypes().Has(it.Get())) { | 104 if (!syncer::ProxyTypes().Has(it.Get())) { |
105 ASSERT_TRUE(DoesTopLevelNodeExist(user_share, it.Get())); | 105 ASSERT_TRUE(DoesTopLevelNodeExist(user_share, it.Get())); |
106 } | 106 } |
107 } | 107 } |
108 | 108 |
109 for (syncer::ModelTypeSet::Iterator it = registered_types.First(); | 109 for (syncer::ModelTypeSet::Iterator it = registered_types.First(); |
110 it.Good(); it.Inc()) { | 110 it.Good(); it.Inc()) { |
111 ASSERT_TRUE(GetClient(0)->DisableSyncForDatatype(it.Get())); | 111 ASSERT_TRUE(GetClient(0)->DisableSyncForDatatype(it.Get())); |
112 | 112 |
113 // AUTOFILL_PROFILE is lumped together with AUTOFILL. | 113 // AUTOFILL_PROFILE is lumped together with AUTOFILL. |
114 // SESSIONS is lumped together with PROXY_TABS and | 114 // SESSIONS is lumped together with PROXY_TABS and TYPED_URLS. |
115 // HISTORY_DELETE_DIRECTIVES. | 115 // HISTORY_DELETE_DIRECTIVES is lumped together with TYPED_URLS. |
116 // PRIORITY_PREFERENCES is lumped together with PREFERENCES. | 116 // PRIORITY_PREFERENCES is lumped together with PREFERENCES. |
117 if (it.Get() == syncer::AUTOFILL_PROFILE || it.Get() == syncer::SESSIONS || | 117 if (it.Get() == syncer::AUTOFILL_PROFILE || |
| 118 it.Get() == syncer::SESSIONS || |
| 119 it.Get() == syncer::HISTORY_DELETE_DIRECTIVES || |
118 it.Get() == syncer::PRIORITY_PREFERENCES) { | 120 it.Get() == syncer::PRIORITY_PREFERENCES) { |
119 continue; | 121 continue; |
120 } | 122 } |
121 | 123 |
122 syncer::UserShare* user_share = | 124 syncer::UserShare* user_share = |
123 GetClient(0)->service()->GetUserShare(); | 125 GetClient(0)->service()->GetUserShare(); |
124 | 126 |
125 ASSERT_FALSE(DoesTopLevelNodeExist(user_share, it.Get())) | 127 ASSERT_FALSE(DoesTopLevelNodeExist(user_share, it.Get())) |
126 << syncer::ModelTypeToString(it.Get()); | 128 << syncer::ModelTypeToString(it.Get()); |
127 | 129 |
128 // AUTOFILL_PROFILE is lumped together with AUTOFILL. | |
129 if (it.Get() == syncer::AUTOFILL) { | 130 if (it.Get() == syncer::AUTOFILL) { |
| 131 // AUTOFILL_PROFILE is lumped together with AUTOFILL. |
| 132 ASSERT_FALSE(DoesTopLevelNodeExist(user_share, syncer::AUTOFILL_PROFILE)); |
| 133 } else if (it.Get() == syncer::TYPED_URLS) { |
130 ASSERT_FALSE(DoesTopLevelNodeExist(user_share, | 134 ASSERT_FALSE(DoesTopLevelNodeExist(user_share, |
131 syncer::AUTOFILL_PROFILE)); | 135 syncer::HISTORY_DELETE_DIRECTIVES)); |
132 } else if (it.Get() == syncer::HISTORY_DELETE_DIRECTIVES || | 136 // SESSIONS should be enabled only if PROXY_TABS is. |
133 it.Get() == syncer::PROXY_TABS) { | 137 ASSERT_EQ(GetClient(0)->IsTypePreferred(syncer::PROXY_TABS), |
134 ASSERT_FALSE(DoesTopLevelNodeExist(user_share, | 138 DoesTopLevelNodeExist(user_share, syncer::SESSIONS)); |
135 syncer::SESSIONS)); | 139 } else if (it.Get() == syncer::PROXY_TABS) { |
| 140 // SESSIONS should be enabled only if TYPED_URLS is. |
| 141 ASSERT_EQ(GetClient(0)->IsTypePreferred(syncer::TYPED_URLS), |
| 142 DoesTopLevelNodeExist(user_share, syncer::SESSIONS)); |
136 } else if (it.Get() == syncer::PREFERENCES) { | 143 } else if (it.Get() == syncer::PREFERENCES) { |
137 ASSERT_FALSE(DoesTopLevelNodeExist(user_share, | 144 ASSERT_FALSE(DoesTopLevelNodeExist(user_share, |
138 syncer::PRIORITY_PREFERENCES)); | 145 syncer::PRIORITY_PREFERENCES)); |
139 } | 146 } |
140 } | 147 } |
141 | 148 |
142 EnableNotifications(); | 149 EnableNotifications(); |
143 } | 150 } |
144 | 151 |
145 } // namespace | 152 } // namespace |
OLD | NEW |