Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Side by Side Diff: chrome/test/data/webui/settings/people_page_test.js

Issue 2457483002: [MD Settings][Sync Settings] Updates sync status messages (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 assertFalse(activityControls.hidden); 217 assertFalse(activityControls.hidden);
218 218
219 cr.webUIListenerCallback('sync-status-changed', { 219 cr.webUIListenerCallback('sync-status-changed', {
220 signedIn: false, 220 signedIn: false,
221 }); 221 });
222 222
223 assertTrue(activityControls.hidden); 223 assertTrue(activityControls.hidden);
224 }); 224 });
225 }); 225 });
226 226
227 test('CustomizeSyncDisabledForManagedSignin', function() { 227 test('syncStatusNotActionableForManagedAccounts', function() {
228 assertFalse(!!peoplePage.$$('#customize-sync')); 228 assertFalse(!!peoplePage.$$('#sync-status'));
229 229
230 return browserProxy.whenCalled('getSyncStatus').then(function() { 230 return browserProxy.whenCalled('getSyncStatus').then(function() {
231 cr.webUIListenerCallback('sync-status-changed', { 231 cr.webUIListenerCallback('sync-status-changed', {
232 signedIn: true, 232 signedIn: true,
233 syncSystemEnabled: true, 233 syncSystemEnabled: true,
234 }); 234 });
235 Polymer.dom.flush(); 235 Polymer.dom.flush();
236 236
237 var customizeSync = peoplePage.$$('#customize-sync'); 237 var syncStatusContainer = peoplePage.$$('#sync-status');
238 assertTrue(!!customizeSync); 238 assertTrue(!!syncStatusContainer);
239 assertTrue(customizeSync.hasAttribute('actionable')); 239 assertTrue(syncStatusContainer.hasAttribute('actionable'));
240 240
241 cr.webUIListenerCallback('sync-status-changed', { 241 cr.webUIListenerCallback('sync-status-changed', {
242 managed: true, 242 managed: true,
243 signedIn: true, 243 signedIn: true,
244 syncSystemEnabled: true, 244 syncSystemEnabled: true,
245 }); 245 });
246 Polymer.dom.flush(); 246 Polymer.dom.flush();
247 247
248 var customizeSync = peoplePage.$$('#customize-sync'); 248 var syncStatusContainer = peoplePage.$$('#sync-status');
249 assertTrue(!!customizeSync); 249 assertTrue(!!syncStatusContainer);
250 assertFalse(customizeSync.hasAttribute('actionable')); 250 assertFalse(syncStatusContainer.hasAttribute('actionable'));
251 });
252 });
253
254 test('syncStatusNotActionableForPassiveErrors', function() {
255 assertFalse(!!peoplePage.$$('#sync-status'));
256
257 return browserProxy.whenCalled('getSyncStatus').then(function() {
258 cr.webUIListenerCallback('sync-status-changed', {
259 hasError: true,
260 statusAction: settings.StatusAction.NO_ACTION,
261 signedIn: true,
262 syncSystemEnabled: true,
263 });
264 Polymer.dom.flush();
265
266 var syncStatusContainer = peoplePage.$$('#sync-status');
267 assertTrue(!!syncStatusContainer);
268 assertFalse(syncStatusContainer.hasAttribute('actionable'));
269
270 cr.webUIListenerCallback('sync-status-changed', {
271 hasError: true,
272 statusAction: settings.StatusAction.UPGRADE_CLIENT,
273 signedIn: true,
274 syncSystemEnabled: true,
275 });
276 Polymer.dom.flush();
277
278 var syncStatusContainer = peoplePage.$$('#sync-status');
279 assertTrue(!!syncStatusContainer);
280 assertTrue(syncStatusContainer.hasAttribute('actionable'));
251 }); 281 });
252 }); 282 });
253 }); 283 });
254 } 284 }
255 285
256 return { 286 return {
257 registerTests: function() { 287 registerTests: function() {
258 registerProfileInfoTests(); 288 registerProfileInfoTests();
259 if (!cr.isChromeOS) 289 if (!cr.isChromeOS)
260 registerSyncStatusTests(); 290 registerSyncStatusTests();
261 }, 291 },
262 }; 292 };
263 }); 293 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698