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 (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 Loading... |
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 Loading... |
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 })(); |
OLD | NEW |