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

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

Issue 2050053002: MD Settings: split browser tests per-file (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@settings-tests
Patch Set: getter instead Created 4 years, 6 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 /** @fileoverview Suite of tests for settings-checkbox. */ 5 /** @fileoverview Suite of tests for settings-checkbox. */
6 cr.define('settings_checkbox', function() { 6 cr.define('settings_checkbox', function() {
7 function registerTests() { 7 function registerTests() {
8 suite('SettingsCheckbox', function() { 8 suite('SettingsCheckbox', function() {
9 /** 9 /**
10 * Checkbox created before each test. 10 * Checkbox created before each test.
11 * @type {SettingsCheckbox} 11 * @type {SettingsCheckbox}
12 */ 12 */
13 var testElement; 13 var testElement;
14 14
15 /** 15 /**
16 * Pref value used in tests, should reflect checkbox 'checked' attribute. 16 * Pref value used in tests, should reflect checkbox 'checked' attribute.
17 * @type {SettingsCheckbox} 17 * @type {SettingsCheckbox}
18 */ 18 */
19 var pref = { 19 var pref = {
20 key: 'test', 20 key: 'test',
21 type: chrome.settingsPrivate.PrefType.BOOLEAN, 21 type: chrome.settingsPrivate.PrefType.BOOLEAN,
22 value: true 22 value: true
23 }; 23 };
24 24
25 // Import settings_checkbox.html before running suite.
26 suiteSetup(function() {
27 return PolymerTest.importHtml(
28 'chrome://md-settings/controls/settings_checkbox.html');
29 });
30
31 // Initialize a checked settings-checkbox before each test. 25 // Initialize a checked settings-checkbox before each test.
32 setup(function() { 26 setup(function() {
33 PolymerTest.clearBody(); 27 PolymerTest.clearBody();
34 testElement = document.createElement('settings-checkbox'); 28 testElement = document.createElement('settings-checkbox');
35 testElement.set('pref', pref); 29 testElement.set('pref', pref);
36 document.body.appendChild(testElement); 30 document.body.appendChild(testElement);
37 }); 31 });
38 32
39 test('responds to checked attribute', function() { 33 test('responds to checked attribute', function() {
40 assertTrue(testElement.checked); 34 assertTrue(testElement.checked);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 assertTrue(testElement.checked); 79 assertTrue(testElement.checked);
86 assertEquals(1, prefNum.value); 80 assertEquals(1, prefNum.value);
87 }); 81 });
88 }); 82 });
89 } 83 }
90 84
91 return { 85 return {
92 registerTests: registerTests, 86 registerTests: registerTests,
93 }; 87 };
94 }); 88 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698