| 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 cr.define('settings_system_page', function() { | 5 cr.define('settings_system_page', function() { |
| 6 /** @const {boolean} */ | 6 /** @const {boolean} */ |
| 7 var HARDWARE_ACCELERATION_AT_STARTUP = true; | 7 var HARDWARE_ACCELERATION_AT_STARTUP = true; |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * @constructor | 10 * @constructor |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 value: HARDWARE_ACCELERATION_AT_STARTUP, | 59 value: HARDWARE_ACCELERATION_AT_STARTUP, |
| 60 }, | 60 }, |
| 61 }, | 61 }, |
| 62 }); | 62 }); |
| 63 document.body.appendChild(systemPage); | 63 document.body.appendChild(systemPage); |
| 64 }); | 64 }); |
| 65 | 65 |
| 66 teardown(function() { systemPage.remove(); }); | 66 teardown(function() { systemPage.remove(); }); |
| 67 | 67 |
| 68 test('restart button', function() { | 68 test('restart button', function() { |
| 69 var checkbox = systemPage.$$('#hardware-acceleration settings-checkbox'); | 69 var control = systemPage.$.hardwareAcceleration; |
| 70 expectEquals(checkbox.checked, HARDWARE_ACCELERATION_AT_STARTUP); | 70 expectEquals(control.checked, HARDWARE_ACCELERATION_AT_STARTUP); |
| 71 | 71 |
| 72 // Restart button should be hidden by default. | 72 // Restart button should be hidden by default. |
| 73 expectFalse(!!systemPage.$$('#hardware-acceleration paper-button')); | 73 expectFalse(!!control.querySelector('paper-button')); |
| 74 | 74 |
| 75 systemPage.set('prefs.hardware_acceleration_mode.enabled.value', | 75 systemPage.set('prefs.hardware_acceleration_mode.enabled.value', |
| 76 !HARDWARE_ACCELERATION_AT_STARTUP); | 76 !HARDWARE_ACCELERATION_AT_STARTUP); |
| 77 Polymer.dom.flush(); | 77 Polymer.dom.flush(); |
| 78 expectNotEquals(checkbox.checked, HARDWARE_ACCELERATION_AT_STARTUP); | 78 expectNotEquals(control.checked, HARDWARE_ACCELERATION_AT_STARTUP); |
| 79 | 79 |
| 80 var restart = systemPage.$$('#hardware-acceleration paper-button'); | 80 var restart = control.querySelector('paper-button'); |
| 81 expectTrue(!!restart); // The "RESTART" button should be showing now. | 81 expectTrue(!!restart); // The "RESTART" button should be showing now. |
| 82 | 82 |
| 83 MockInteractions.tap(restart); | 83 MockInteractions.tap(restart); |
| 84 return lifetimeBrowserProxy.whenCalled('restart'); | 84 return lifetimeBrowserProxy.whenCalled('restart'); |
| 85 }); | 85 }); |
| 86 }); | 86 }); |
| 87 }); | 87 }); |
| OLD | NEW |