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

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

Issue 2787923002: [MD settings] small code health changes (Closed)
Patch Set: Created 3 years, 8 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 site-list. */ 5 /** @fileoverview Suite of tests for site-list. */
6 cr.define('site_list', function() { 6 cr.define('site_list', function() {
7 /** 7 /**
8 * An example pref with 2 blocked location items and 2 allowed. This pref 8 * An example pref with 2 blocked location items and 2 allowed. This pref
9 * is also used for the All Sites category and therefore needs values for 9 * is also used for the All Sites category and therefore needs values for
10 * all types, even though some might be blank. 10 * all types, even though some might be blank.
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 * @param {HTMLElement} listContainer Node with the exceptions listed. 423 * @param {HTMLElement} listContainer Node with the exceptions listed.
424 * @return {boolean} Whether the entry is incognito only. 424 * @return {boolean} Whether the entry is incognito only.
425 */ 425 */
426 function hasAnIncognito(listContainer) { 426 function hasAnIncognito(listContainer) {
427 var descriptions = listContainer.querySelectorAll('#siteDescription'); 427 var descriptions = listContainer.querySelectorAll('#siteDescription');
428 for (var i = 0; i < descriptions.length; ++i) { 428 for (var i = 0; i < descriptions.length; ++i) {
429 if (descriptions[i].textContent == 'Current incognito session') 429 if (descriptions[i].textContent == 'Current incognito session')
430 return true; 430 return true;
431 } 431 }
432 return false; 432 return false;
433 }; 433 }
434
435 434
436 /** 435 /**
437 * Configures the test element for a particular category. 436 * Configures the test element for a particular category.
438 * @param {settings.ContentSettingsTypes} category The category to set up. 437 * @param {settings.ContentSettingsTypes} category The category to set up.
439 * @param {settings.PermissionValues} subtype Type of list to use. 438 * @param {settings.PermissionValues} subtype Type of list to use.
440 * @param {Array<dictionary>} prefs The prefs to use. 439 * @param {Array<dictionary>} prefs The prefs to use.
441 */ 440 */
442 function setUpCategory(category, subtype, prefs) { 441 function setUpCategory(category, subtype, prefs) {
443 browserProxy.setPrefs(prefs); 442 browserProxy.setPrefs(prefs);
444 if (category == settings.ALL_SITES) { 443 if (category == settings.ALL_SITES) {
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
1137 1136
1138 assertFalse(dialog.$.dialog.open); 1137 assertFalse(dialog.$.dialog.open);
1139 }); 1138 });
1140 }); 1139 });
1141 }); 1140 });
1142 1141
1143 return { 1142 return {
1144 registerTests: registerTests, 1143 registerTests: registerTests,
1145 }; 1144 };
1146 }); 1145 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698