| 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 function registerTests() { | 7 function registerTests() { |
| 8 suite('SiteList', function() { | 8 suite('SiteList', function() { |
| 9 /** | 9 /** |
| 10 * A site list element created before each test. | 10 * A site list element created before each test. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 * is also used for the All Sites category and therefore needs values for | 23 * is also used for the All Sites category and therefore needs values for |
| 24 * all types, even though some might be blank. | 24 * all types, even though some might be blank. |
| 25 * @type {SiteSettingsPref} | 25 * @type {SiteSettingsPref} |
| 26 */ | 26 */ |
| 27 var prefs = { | 27 var prefs = { |
| 28 exceptions: { | 28 exceptions: { |
| 29 auto_downloads: [], | 29 auto_downloads: [], |
| 30 background_sync: [], | 30 background_sync: [], |
| 31 camera: [], | 31 camera: [], |
| 32 cookies: [], | 32 cookies: [], |
| 33 fullscreen: [], | |
| 34 geolocation: [ | 33 geolocation: [ |
| 35 { | 34 { |
| 36 embeddingOrigin: 'https://foo-allow.com:443', | 35 embeddingOrigin: 'https://foo-allow.com:443', |
| 37 origin: 'https://foo-allow.com:443', | 36 origin: 'https://foo-allow.com:443', |
| 38 setting: 'allow', | 37 setting: 'allow', |
| 39 source: 'preference', | 38 source: 'preference', |
| 40 }, | 39 }, |
| 41 { | 40 { |
| 42 embeddingOrigin: 'https://bar-allow.com:443', | 41 embeddingOrigin: 'https://bar-allow.com:443', |
| 43 origin: 'https://bar-allow.com:443', | 42 origin: 'https://bar-allow.com:443', |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 /** | 93 /** |
| 95 * An example pref with mixed origin and pattern. | 94 * An example pref with mixed origin and pattern. |
| 96 * @type {SiteSettingsPref} | 95 * @type {SiteSettingsPref} |
| 97 */ | 96 */ |
| 98 var prefsMixedOriginAndPattern = { | 97 var prefsMixedOriginAndPattern = { |
| 99 exceptions: { | 98 exceptions: { |
| 100 auto_downloads: [], | 99 auto_downloads: [], |
| 101 background_sync: [], | 100 background_sync: [], |
| 102 camera: [], | 101 camera: [], |
| 103 cookies: [], | 102 cookies: [], |
| 104 fullscreen: [], | |
| 105 geolocation: [ | 103 geolocation: [ |
| 106 { | 104 { |
| 107 origin: 'https://foo.com', | 105 origin: 'https://foo.com', |
| 108 embeddingOrigin: '*', | 106 embeddingOrigin: '*', |
| 109 setting: 'allow', | 107 setting: 'allow', |
| 110 source: 'preference', | 108 source: 'preference', |
| 111 }, | 109 }, |
| 112 ], | 110 ], |
| 113 images: [], | 111 images: [], |
| 114 javascript: [ | 112 javascript: [ |
| (...skipping 17 matching lines...) Expand all Loading... |
| 132 * An example pref with multiple categories and multiple allow/block | 130 * An example pref with multiple categories and multiple allow/block |
| 133 * state. | 131 * state. |
| 134 * @type {SiteSettingsPref} | 132 * @type {SiteSettingsPref} |
| 135 */ | 133 */ |
| 136 var prefsVarious = { | 134 var prefsVarious = { |
| 137 exceptions: { | 135 exceptions: { |
| 138 auto_downloads: [], | 136 auto_downloads: [], |
| 139 background_sync: [], | 137 background_sync: [], |
| 140 camera: [], | 138 camera: [], |
| 141 cookies: [], | 139 cookies: [], |
| 142 fullscreen: [], | |
| 143 geolocation: [ | 140 geolocation: [ |
| 144 { | 141 { |
| 145 embeddingOrigin: 'https://foo.com', | 142 embeddingOrigin: 'https://foo.com', |
| 146 origin: 'https://foo.com', | 143 origin: 'https://foo.com', |
| 147 setting: 'allow', | 144 setting: 'allow', |
| 148 source: 'preference', | 145 source: 'preference', |
| 149 }, | 146 }, |
| 150 { | 147 { |
| 151 embeddingOrigin: 'https://bar.com', | 148 embeddingOrigin: 'https://bar.com', |
| 152 origin: 'https://bar.com', | 149 origin: 'https://bar.com', |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 assertEquals(settings.ContentSettingsTypes.JAVASCRIPT, args[2]); | 794 assertEquals(settings.ContentSettingsTypes.JAVASCRIPT, args[2]); |
| 798 assertEquals('allow', args[3]); | 795 assertEquals('allow', args[3]); |
| 799 }); | 796 }); |
| 800 }); | 797 }); |
| 801 }); | 798 }); |
| 802 } | 799 } |
| 803 return { | 800 return { |
| 804 registerTests: registerTests, | 801 registerTests: registerTests, |
| 805 }; | 802 }; |
| 806 }); | 803 }); |
| OLD | NEW |