| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 cr.define('settings_people_page', function() { | 5 cr.define('settings_people_page', function() { |
| 6 /** | 6 /** |
| 7 * @constructor | 7 * @constructor |
| 8 * @implements {settings.ProfileInfoBrowserProxy} | 8 * @implements {settings.ProfileInfoBrowserProxy} |
| 9 * @extends {settings.TestBrowserProxy} | 9 * @extends {settings.TestBrowserProxy} |
| 10 */ | 10 */ |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 assertFalse(activityControls.hidden); | 223 assertFalse(activityControls.hidden); |
| 224 | 224 |
| 225 cr.webUIListenerCallback('sync-status-changed', { | 225 cr.webUIListenerCallback('sync-status-changed', { |
| 226 signedIn: false, | 226 signedIn: false, |
| 227 }); | 227 }); |
| 228 | 228 |
| 229 assertTrue(activityControls.hidden); | 229 assertTrue(activityControls.hidden); |
| 230 }); | 230 }); |
| 231 }); | 231 }); |
| 232 | 232 |
| 233 test('CustomizeSyncDisabledForManagedSignin', function() { | 233 test('syncStatusNotActionableForManagedAccounts', function() { |
| 234 assertFalse(!!peoplePage.$$('#customize-sync')); | 234 assertFalse(!!peoplePage.$$('#sync-status')); |
| 235 | 235 |
| 236 return browserProxy.whenCalled('getSyncStatus').then(function() { | 236 return browserProxy.whenCalled('getSyncStatus').then(function() { |
| 237 cr.webUIListenerCallback('sync-status-changed', { | 237 cr.webUIListenerCallback('sync-status-changed', { |
| 238 signedIn: true, | 238 signedIn: true, |
| 239 syncSystemEnabled: true, | 239 syncSystemEnabled: true, |
| 240 }); | 240 }); |
| 241 Polymer.dom.flush(); | 241 Polymer.dom.flush(); |
| 242 | 242 |
| 243 var customizeSync = peoplePage.$$('#customize-sync'); | 243 var syncStatusContainer = peoplePage.$$('#sync-status'); |
| 244 assertTrue(!!customizeSync); | 244 assertTrue(!!syncStatusContainer); |
| 245 assertTrue(customizeSync.hasAttribute('actionable')); | 245 assertTrue(syncStatusContainer.hasAttribute('actionable')); |
| 246 | 246 |
| 247 cr.webUIListenerCallback('sync-status-changed', { | 247 cr.webUIListenerCallback('sync-status-changed', { |
| 248 managed: true, | 248 managed: true, |
| 249 signedIn: true, | 249 signedIn: true, |
| 250 syncSystemEnabled: true, | 250 syncSystemEnabled: true, |
| 251 }); | 251 }); |
| 252 Polymer.dom.flush(); | 252 Polymer.dom.flush(); |
| 253 | 253 |
| 254 var customizeSync = peoplePage.$$('#customize-sync'); | 254 var syncStatusContainer = peoplePage.$$('#sync-status'); |
| 255 assertTrue(!!customizeSync); | 255 assertTrue(!!syncStatusContainer); |
| 256 assertFalse(customizeSync.hasAttribute('actionable')); | 256 assertFalse(syncStatusContainer.hasAttribute('actionable')); |
| 257 }); |
| 258 }); |
| 259 |
| 260 test('syncStatusNotActionableForPassiveErrors', function() { |
| 261 assertFalse(!!peoplePage.$$('#sync-status')); |
| 262 |
| 263 return browserProxy.whenCalled('getSyncStatus').then(function() { |
| 264 cr.webUIListenerCallback('sync-status-changed', { |
| 265 hasError: true, |
| 266 statusAction: settings.StatusAction.NO_ACTION, |
| 267 signedIn: true, |
| 268 syncSystemEnabled: true, |
| 269 }); |
| 270 Polymer.dom.flush(); |
| 271 |
| 272 var syncStatusContainer = peoplePage.$$('#sync-status'); |
| 273 assertTrue(!!syncStatusContainer); |
| 274 assertFalse(syncStatusContainer.hasAttribute('actionable')); |
| 275 |
| 276 cr.webUIListenerCallback('sync-status-changed', { |
| 277 hasError: true, |
| 278 statusAction: settings.StatusAction.UPGRADE_CLIENT, |
| 279 signedIn: true, |
| 280 syncSystemEnabled: true, |
| 281 }); |
| 282 Polymer.dom.flush(); |
| 283 |
| 284 var syncStatusContainer = peoplePage.$$('#sync-status'); |
| 285 assertTrue(!!syncStatusContainer); |
| 286 assertTrue(syncStatusContainer.hasAttribute('actionable')); |
| 257 }); | 287 }); |
| 258 }); | 288 }); |
| 259 }); | 289 }); |
| 260 } | 290 } |
| 261 | 291 |
| 262 return { | 292 return { |
| 263 registerTests: function() { | 293 registerTests: function() { |
| 264 registerProfileInfoTests(); | 294 registerProfileInfoTests(); |
| 265 if (!cr.isChromeOS) | 295 if (!cr.isChromeOS) |
| 266 registerSyncStatusTests(); | 296 registerSyncStatusTests(); |
| 267 }, | 297 }, |
| 268 }; | 298 }; |
| 269 }); | 299 }); |
| OLD | NEW |