| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 }); |
| OLD | NEW |