Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: chrome/test/data/webui/settings/system_page_tests.js

Issue 2617533003: MD Settings: change most checkboxes to toggles (leave dialogs alone) (Closed)
Patch Set: fix tests Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/test/data/webui/settings/search_page_test.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 });
OLDNEW
« no previous file with comments | « chrome/test/data/webui/settings/search_page_test.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698