| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 registerMessageCallback('getTimeZones', null, function(callback) { | 99 registerMessageCallback('getTimeZones', null, function(callback) { |
| 100 assertFalse(getTimeZonesCalled); | 100 assertFalse(getTimeZonesCalled); |
| 101 getTimeZonesCalled = true; | 101 getTimeZonesCalled = true; |
| 102 cr.webUIResponse(callback, true, fakeTimeZones); | 102 cr.webUIResponse(callback, true, fakeTimeZones); |
| 103 }); | 103 }); |
| 104 }); | 104 }); |
| 105 | 105 |
| 106 suiteTeardown(function() { | 106 suiteTeardown(function() { |
| 107 // TODO(michaelpg): Removes the element before exiting, because the | 107 // TODO(michaelpg): Removes the element before exiting, because the |
| 108 // <paper-tooltip> in <cr-policy-pref-indicator> somehow causes warnings | 108 // <paper-tooltip> in <cr-policy-indicator> somehow causes warnings |
| 109 // and/or script errors in axs_testing.js. | 109 // and/or script errors in axs_testing.js. |
| 110 PolymerTest.clearBody(); | 110 PolymerTest.clearBody(); |
| 111 }); | 111 }); |
| 112 | 112 |
| 113 function verifyAutoDetectSetting(autoDetect) { | 113 function verifyAutoDetectSetting(autoDetect) { |
| 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-indicator'); |
| 121 | 121 |
| 122 if (policy) { | 122 if (policy) { |
| 123 assertTrue(!!indicator); | 123 assertTrue(!!indicator); |
| 124 assertTrue(indicator.indicatorVisible); | 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); |
| (...skipping 127 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 |