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

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

Issue 1827823003: MD Settings: Rename and fix confusing prefs test function (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@PrefsTests
Patch Set: simplify Created 4 years, 9 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/browser/resources/settings/prefs/prefs.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 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-prefs. */ 5 /** @fileoverview Suite of tests for settings-prefs. */
6 cr.define('settings_prefs', function() { 6 cr.define('settings_prefs', function() {
7 /** 7 /**
8 * Creates a deep copy of the object. 8 * Creates a deep copy of the object.
9 * @param {!Object} obj 9 * @param {!Object} obj
10 * @return {!Object} 10 * @return {!Object}
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 return CrSettingsPrefs.initialized; 102 return CrSettingsPrefs.initialized;
103 }); 103 });
104 104
105 teardown(function() { 105 teardown(function() {
106 CrSettingsPrefs.resetForTesting(); 106 CrSettingsPrefs.resetForTesting();
107 CrSettingsPrefs.deferInitialization = false; 107 CrSettingsPrefs.deferInitialization = false;
108 108
109 // Reset each <settings-prefs>. TODO(michaelpg): make settings-prefs 109 // Reset each <settings-prefs>. TODO(michaelpg): make settings-prefs
110 // less dependent on testing state so we don't have to do this. 110 // less dependent on testing state so we don't have to do this.
111 for (var i = 0; i < createdElements.length; i++) 111 for (var i = 0; i < createdElements.length; i++)
112 createdElements[i].resetForTesting(); 112 createdElements[i].uninitializeForTesting();
113 113
114 PolymerTest.clearBody(); 114 PolymerTest.clearBody();
115 }); 115 });
116 116
117 test('receives and caches prefs', function testGetPrefs() { 117 test('receives and caches prefs', function testGetPrefs() {
118 // Test that each pref has been successfully copied to the Polymer 118 // Test that each pref has been successfully copied to the Polymer
119 // |prefs| property. 119 // |prefs| property.
120 for (var key in fakeApi.prefs) { 120 for (var key in fakeApi.prefs) {
121 var expectedPref = fakeApi.prefs[key]; 121 var expectedPref = fakeApi.prefs[key];
122 var actualPref = getPrefFromKey(prefs.prefs, key); 122 var actualPref = getPrefFromKey(prefs.prefs, key);
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 fakeApi.sendPrefChanges(prefChanges); 186 fakeApi.sendPrefChanges(prefChanges);
187 assertPrefsSet(1); 187 assertPrefsSet(1);
188 }); 188 });
189 }); 189 });
190 } 190 }
191 191
192 return { 192 return {
193 registerTests: registerTests, 193 registerTests: registerTests,
194 }; 194 };
195 }); 195 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/prefs/prefs.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698