OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "chrome/browser/sync/profile_sync_service_harness.h" | 6 #include "chrome/browser/sync/profile_sync_service_harness.h" |
7 #include "chrome/test/live_sync/live_extensions_sync_test.h" | 7 #include "chrome/test/live_sync/live_extensions_sync_test.h" |
8 | 8 |
9 class TwoClientLiveExtensionsSyncTest : public LiveExtensionsSyncTest { | 9 class TwoClientLiveExtensionsSyncTest : public LiveExtensionsSyncTest { |
10 public: | 10 public: |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 InstallExtensionsPendingForSync(GetProfile(0)); | 140 InstallExtensionsPendingForSync(GetProfile(0)); |
141 InstallExtensionsPendingForSync(GetProfile(1)); | 141 InstallExtensionsPendingForSync(GetProfile(1)); |
142 ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier()); | 142 ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier()); |
143 | 143 |
144 UninstallExtension(GetProfile(0), 0); | 144 UninstallExtension(GetProfile(0), 0); |
145 UninstallExtension(verifier(), 0); | 145 UninstallExtension(verifier(), 0); |
146 ASSERT_TRUE(AwaitQuiescence()); | 146 ASSERT_TRUE(AwaitQuiescence()); |
147 ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier()); | 147 ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier()); |
148 } | 148 } |
149 | 149 |
| 150 // TCM ID - 3635304. |
| 151 IN_PROC_BROWSER_TEST_F(TwoClientLiveExtensionsSyncTest, Merge) { |
| 152 ASSERT_TRUE(SetupSync()); |
| 153 ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier()); |
| 154 |
| 155 InstallExtension(GetProfile(0), 0); |
| 156 InstallExtension(GetProfile(1), 0); |
| 157 ASSERT_TRUE(AwaitQuiescence()); |
| 158 |
| 159 UninstallExtension(GetProfile(0), 0); |
| 160 InstallExtension(GetProfile(0), 1); |
| 161 InstallExtension(verifier(), 1); |
| 162 |
| 163 InstallExtension(GetProfile(0), 2); |
| 164 InstallExtension(GetProfile(1), 2); |
| 165 InstallExtension(verifier(), 2); |
| 166 |
| 167 InstallExtension(GetProfile(1), 3); |
| 168 InstallExtension(verifier(), 3); |
| 169 |
| 170 ASSERT_TRUE(AwaitQuiescence()); |
| 171 InstallExtensionsPendingForSync(GetProfile(0)); |
| 172 InstallExtensionsPendingForSync(GetProfile(1)); |
| 173 ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier()); |
| 174 } |
| 175 |
| 176 // TCM ID - 3605300. |
| 177 IN_PROC_BROWSER_TEST_F(TwoClientLiveExtensionsSyncTest, |
| 178 UpdateEnableDisableExtension) { |
| 179 ASSERT_TRUE(SetupSync()); |
| 180 ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier()); |
| 181 |
| 182 InstallExtension(GetProfile(0), 0); |
| 183 InstallExtension(GetProfile(1), 0); |
| 184 InstallExtension(verifier(), 0); |
| 185 ASSERT_TRUE(AwaitQuiescence()); |
| 186 ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier()); |
| 187 |
| 188 DisableExtension(GetProfile(0), 0); |
| 189 DisableExtension(verifier(), 0); |
| 190 ASSERT_TRUE(HasSameExtensionsAsVerifier(0)); |
| 191 ASSERT_FALSE(HasSameExtensionsAsVerifier(1)); |
| 192 |
| 193 ASSERT_TRUE(AwaitQuiescence()); |
| 194 ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier()); |
| 195 |
| 196 EnableExtension(GetProfile(1), 0); |
| 197 EnableExtension(verifier(), 0); |
| 198 ASSERT_TRUE(HasSameExtensionsAsVerifier(1)); |
| 199 ASSERT_FALSE(HasSameExtensionsAsVerifier(0)); |
| 200 |
| 201 ASSERT_TRUE(AwaitQuiescence()); |
| 202 ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier()); |
| 203 } |
| 204 |
| 205 // TCM ID - 3728322. |
| 206 IN_PROC_BROWSER_TEST_F(TwoClientLiveExtensionsSyncTest, |
| 207 UpdateIncognitoEnableDisable) { |
| 208 ASSERT_TRUE(SetupSync()); |
| 209 ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier()); |
| 210 |
| 211 InstallExtension(GetProfile(0), 0); |
| 212 InstallExtension(GetProfile(1), 0); |
| 213 InstallExtension(verifier(), 0); |
| 214 ASSERT_TRUE(AwaitQuiescence()); |
| 215 ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier()); |
| 216 |
| 217 IncognitoEnableExtension(GetProfile(0), 0); |
| 218 IncognitoEnableExtension(verifier(), 0); |
| 219 ASSERT_TRUE(HasSameExtensionsAsVerifier(0)); |
| 220 ASSERT_FALSE(HasSameExtensionsAsVerifier(1)); |
| 221 |
| 222 ASSERT_TRUE(AwaitQuiescence()); |
| 223 ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier()); |
| 224 |
| 225 IncognitoDisableExtension(GetProfile(1), 0); |
| 226 IncognitoDisableExtension(verifier(), 0); |
| 227 ASSERT_TRUE(HasSameExtensionsAsVerifier(1)); |
| 228 ASSERT_FALSE(HasSameExtensionsAsVerifier(0)); |
| 229 |
| 230 ASSERT_TRUE(AwaitQuiescence()); |
| 231 ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier()); |
| 232 } |
| 233 |
150 // TCM ID - 3732278. | 234 // TCM ID - 3732278. |
151 IN_PROC_BROWSER_TEST_F(TwoClientLiveExtensionsSyncTest, DisableExtensions) { | 235 IN_PROC_BROWSER_TEST_F(TwoClientLiveExtensionsSyncTest, DisableExtensions) { |
152 ASSERT_TRUE(SetupSync()); | 236 ASSERT_TRUE(SetupSync()); |
153 ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier()); | 237 ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier()); |
154 | 238 |
155 ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncable::EXTENSIONS)); | 239 ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncable::EXTENSIONS)); |
156 InstallExtension(GetProfile(0), 1); | 240 InstallExtension(GetProfile(0), 1); |
157 InstallExtension(verifier(), 1); | 241 InstallExtension(verifier(), 1); |
158 ASSERT_TRUE(AwaitQuiescence()); | 242 ASSERT_TRUE(AwaitQuiescence()); |
159 ASSERT_FALSE(AllProfilesHaveSameExtensionsAsVerifier()); | 243 ASSERT_FALSE(AllProfilesHaveSameExtensionsAsVerifier()); |
(...skipping 22 matching lines...) Expand all Loading... |
182 ASSERT_TRUE(GetClient(1)->EnableSyncForAllDatatypes()); | 266 ASSERT_TRUE(GetClient(1)->EnableSyncForAllDatatypes()); |
183 ASSERT_TRUE(AwaitQuiescence()); | 267 ASSERT_TRUE(AwaitQuiescence()); |
184 InstallExtensionsPendingForSync(GetProfile(0)); | 268 InstallExtensionsPendingForSync(GetProfile(0)); |
185 InstallExtensionsPendingForSync(GetProfile(1)); | 269 InstallExtensionsPendingForSync(GetProfile(1)); |
186 InstallExtensionsPendingForSync(verifier()); | 270 InstallExtensionsPendingForSync(verifier()); |
187 ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier()); | 271 ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier()); |
188 } | 272 } |
189 | 273 |
190 // TODO(akalin): Add tests exercising: | 274 // TODO(akalin): Add tests exercising: |
191 // - Offline installation/uninstallation behavior | 275 // - Offline installation/uninstallation behavior |
OLD | NEW |