| 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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 cr.webUIListenerCallback('time-zone-auto-detect-policy', false); | 228 cr.webUIListenerCallback('time-zone-auto-detect-policy', false); |
| 229 verifyAutoDetectSetting(true); | 229 verifyAutoDetectSetting(true); |
| 230 verifyPolicy(false); | 230 verifyPolicy(false); |
| 231 | 231 |
| 232 // User can disable auto-detect. | 232 // User can disable auto-detect. |
| 233 MockInteractions.tap(dateTime.$.timeZoneAutoDetectCheckbox); | 233 MockInteractions.tap(dateTime.$.timeZoneAutoDetectCheckbox); |
| 234 verifyAutoDetectSetting(false); | 234 verifyAutoDetectSetting(false); |
| 235 done(); | 235 done(); |
| 236 }); | 236 }); |
| 237 }); | 237 }); |
| 238 |
| 239 test('set date and time button', function() { |
| 240 dateTime = initializeDateTime(getFakePrefs(), false); |
| 241 |
| 242 var showSetDateTimeUICalled = false; |
| 243 registerMessageCallback('showSetDateTimeUI', null, function() { |
| 244 assertFalse(showSetDateTimeUICalled); |
| 245 showSetDateTimeUICalled = true; |
| 246 }); |
| 247 |
| 248 var setDateTimeButton = dateTime.$.setDateTime; |
| 249 assertEquals(0, setDateTimeButton.offsetHeight); |
| 250 |
| 251 // Make the date and time editable. |
| 252 cr.webUIListenerCallback('can-set-date-time-changed', true); |
| 253 assertGT(setDateTimeButton.offsetHeight, 0); |
| 254 |
| 255 assertFalse(showSetDateTimeUICalled); |
| 256 MockInteractions.tap(setDateTimeButton); |
| 257 assertTrue(showSetDateTimeUICalled); |
| 258 |
| 259 // Make the date and time not editable. |
| 260 cr.webUIListenerCallback('can-set-date-time-changed', false); |
| 261 assertEquals(setDateTimeButton.offsetHeight, 0); |
| 262 }); |
| 238 }); | 263 }); |
| 239 })(); | 264 })(); |
| OLD | NEW |