| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 GEN_INCLUDE(['chrome/browser/ui/webui/options/options_browsertest_base.js']); | |
| 6 | |
| 7 GEN('#if defined(OS_CHROMEOS)'); | 5 GEN('#if defined(OS_CHROMEOS)'); |
| 8 | 6 |
| 9 /** | 7 /** |
| 10 * DateTimeOptionsWebUITest tests the date and time section of the options page. | 8 * DateTimeOptionsWebUITest tests the date and time section of the options page. |
| 11 * @constructor | 9 * @constructor |
| 12 * @extends {testing.Test} | 10 * @extends {testing.Test} |
| 13 */ | 11 */ |
| 14 function DateTimeOptionsWebUITest() {} | 12 function DateTimeOptionsWebUITest() {} |
| 15 | 13 |
| 16 DateTimeOptionsWebUITest.prototype = { | 14 DateTimeOptionsWebUITest.prototype = { |
| 17 __proto__: OptionsBrowsertestBase.prototype, | 15 __proto__: testing.Test.prototype, |
| 18 | 16 |
| 19 /** | 17 /** |
| 20 * Browse to date/time options. | 18 * Browse to date/time options. |
| 21 * @override | 19 * @override |
| 22 */ | 20 */ |
| 23 browsePreload: 'chrome://settings-frame/search#date', | 21 browsePreload: 'chrome://settings-frame/search#date', |
| 24 }; | 22 }; |
| 25 | 23 |
| 26 TEST_F('DateTimeOptionsWebUITest', 'testShowSetTimeButton', function() { | 24 TEST_F('DateTimeOptionsWebUITest', 'testShowSetTimeButton', function() { |
| 27 assertEquals(this.browsePreload, document.location.href); | 25 assertEquals(this.browsePreload, document.location.href); |
| 28 | 26 |
| 29 // Hide label and show button. | 27 // Hide label and show button. |
| 30 BrowserOptions.setCanSetTime(true); | 28 BrowserOptions.setCanSetTime(true); |
| 31 expectTrue($('time-synced-explanation').hidden); | 29 expectTrue($('time-synced-explanation').hidden); |
| 32 expectFalse($('set-time').hidden); | 30 expectFalse($('set-time').hidden); |
| 33 | 31 |
| 34 // Show label and hide button. | 32 // Show label and hide button. |
| 35 BrowserOptions.setCanSetTime(false); | 33 BrowserOptions.setCanSetTime(false); |
| 36 expectFalse($('time-synced-explanation').hidden); | 34 expectFalse($('time-synced-explanation').hidden); |
| 37 expectTrue($('set-time').hidden); | 35 expectTrue($('set-time').hidden); |
| 38 }); | 36 }); |
| 39 | 37 |
| 40 GEN('#endif'); | 38 GEN('#endif'); |
| OLD | NEW |