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

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

Issue 2696903005: Move common cr-policy-indicator behavior into CrPolicyIndicatorBehavior (Closed)
Patch Set: rename hasPolicy Created 3 years, 9 months 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 (function() { 5 (function() {
6 function getFakePrefs() { 6 function getFakePrefs() {
7 return { 7 return {
8 cros: { 8 cros: {
9 system: { 9 system: {
10 timezone: { 10 timezone: {
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 assertEquals(autoDetect, dateTime.$$('settings-dropdown-menu').disabled); 114 assertEquals(autoDetect, dateTime.$$('settings-dropdown-menu').disabled);
115 assertEquals(autoDetect, dateTime.$.timeZoneAutoDetect.checked); 115 assertEquals(autoDetect, dateTime.$.timeZoneAutoDetect.checked);
116 } 116 }
117 117
118 function verifyPolicy(policy) { 118 function verifyPolicy(policy) {
119 Polymer.dom.flush(); 119 Polymer.dom.flush();
120 var indicator = dateTime.$$('cr-policy-pref-indicator'); 120 var indicator = dateTime.$$('cr-policy-pref-indicator');
121 121
122 if (policy) { 122 if (policy) {
123 assertTrue(!!indicator); 123 assertTrue(!!indicator);
124 assertTrue(indicator.isActive()); 124 assertTrue(indicator.indicatorVisible);
125 } else { 125 } else {
126 // Indicator should be missing dom-ifed out. 126 // Indicator should be missing dom-ifed out.
127 assertFalse(!!indicator); 127 assertFalse(!!indicator);
128 } 128 }
129 129
130 assertEquals(policy, dateTime.$.timeZoneAutoDetect.disabled); 130 assertEquals(policy, dateTime.$.timeZoneAutoDetect.disabled);
131 } 131 }
132 132
133 function verifyTimeZonesPopulated(populated) { 133 function verifyTimeZonesPopulated(populated) {
134 var dropdown = dateTime.$$('settings-dropdown-menu'); 134 var dropdown = dateTime.$$('settings-dropdown-menu');
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 assertFalse(showSetDateTimeUICalled); 258 assertFalse(showSetDateTimeUICalled);
259 MockInteractions.tap(setDateTimeButton); 259 MockInteractions.tap(setDateTimeButton);
260 assertTrue(showSetDateTimeUICalled); 260 assertTrue(showSetDateTimeUICalled);
261 261
262 // Make the date and time not editable. 262 // Make the date and time not editable.
263 cr.webUIListenerCallback('can-set-date-time-changed', false); 263 cr.webUIListenerCallback('can-set-date-time-changed', false);
264 assertEquals(setDateTimeButton.offsetHeight, 0); 264 assertEquals(setDateTimeButton.offsetHeight, 0);
265 }); 265 });
266 }); 266 });
267 })(); 267 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698