| 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. |
| 11 * @type {SiteSettingsPref} | 11 * @type {SiteSettingsPref} |
| 12 */ | 12 */ |
| 13 var prefs = { | 13 var prefs = { |
| 14 exceptions: { | 14 exceptions: { |
| 15 auto_downloads: [], | 15 auto_downloads: [], |
| 16 background_sync: [], | 16 background_sync: [], |
| 17 camera: [], | 17 camera: [], |
| 18 cookies: [], | 18 cookies: [], |
| 19 geolocation: [ | 19 geolocation: [ |
| 20 { | 20 { |
| 21 category: 'geolocation', |
| 21 embeddingOrigin: 'https://bar-allow.com:443', | 22 embeddingOrigin: 'https://bar-allow.com:443', |
| 22 origin: 'https://bar-allow.com:443', | 23 origin: 'https://bar-allow.com:443', |
| 23 setting: 'allow', | 24 setting: 'allow', |
| 24 source: 'preference', | 25 source: 'preference', |
| 25 }, | 26 }, |
| 26 { | 27 { |
| 28 category: 'geolocation', |
| 27 embeddingOrigin: 'https://foo-allow.com:443', | 29 embeddingOrigin: 'https://foo-allow.com:443', |
| 28 origin: 'https://foo-allow.com:443', | 30 origin: 'https://foo-allow.com:443', |
| 29 setting: 'allow', | 31 setting: 'allow', |
| 30 source: 'preference', | 32 source: 'preference', |
| 31 }, | 33 }, |
| 32 { | 34 { |
| 35 category: 'geolocation', |
| 33 embeddingOrigin: 'https://bar-block.com:443', | 36 embeddingOrigin: 'https://bar-block.com:443', |
| 34 origin: 'https://bar-block.com:443', | 37 origin: 'https://bar-block.com:443', |
| 35 setting: 'block', | 38 setting: 'block', |
| 36 source: 'preference', | 39 source: 'preference', |
| 37 }, | 40 }, |
| 38 { | 41 { |
| 42 category: 'geolocation', |
| 39 embeddingOrigin: 'https://foo-block.com:443', | 43 embeddingOrigin: 'https://foo-block.com:443', |
| 40 origin: 'https://foo-block.com:443', | 44 origin: 'https://foo-block.com:443', |
| 41 setting: 'block', | 45 setting: 'block', |
| 42 source: 'preference', | 46 source: 'preference', |
| 43 }, | 47 }, |
| 44 ], | 48 ], |
| 45 images: [], | 49 images: [], |
| 46 javascript: [], | 50 javascript: [], |
| 47 mic: [], | 51 mic: [], |
| 48 midiDevices: [], | 52 midiDevices: [], |
| 49 notifications: [], | 53 notifications: [], |
| 50 plugins: [], | 54 plugins: [], |
| 51 protectedContent: [], | 55 protectedContent: [], |
| 52 popups: [], | 56 popups: [], |
| 53 unsandboxed_plugins: [], | 57 unsandboxed_plugins: [], |
| 54 } | 58 } |
| 55 }; | 59 }; |
| 56 | 60 |
| 57 /** | 61 /** |
| 58 * An example pref with mixed schemes (present and absent). | 62 * An example pref with mixed schemes (present and absent). |
| 59 * @type {SiteSettingsPref} | 63 * @type {SiteSettingsPref} |
| 60 */ | 64 */ |
| 61 var prefsMixedSchemes = { | 65 var prefsMixedSchemes = { |
| 62 exceptions: { | 66 exceptions: { |
| 63 geolocation: [ | 67 geolocation: [ |
| 64 { | 68 { |
| 69 category: 'geolocation', |
| 65 embeddingOrigin: 'https://foo-allow.com', | 70 embeddingOrigin: 'https://foo-allow.com', |
| 66 origin: 'https://foo-allow.com', | 71 origin: 'https://foo-allow.com', |
| 67 setting: 'allow', | 72 setting: 'allow', |
| 68 source: 'preference', | 73 source: 'preference', |
| 69 }, | 74 }, |
| 70 { | 75 { |
| 76 category: 'geolocation', |
| 71 embeddingOrigin: 'bar-allow.com', | 77 embeddingOrigin: 'bar-allow.com', |
| 72 origin: 'bar-allow.com', | 78 origin: 'bar-allow.com', |
| 73 setting: 'allow', | 79 setting: 'allow', |
| 74 source: 'preference', | 80 source: 'preference', |
| 75 }, | 81 }, |
| 76 ] | 82 ] |
| 77 } | 83 } |
| 78 }; | 84 }; |
| 79 | 85 |
| 80 | 86 |
| 81 /** | 87 /** |
| 82 * An example pref with exceptions with origins and patterns from | 88 * An example pref with exceptions with origins and patterns from |
| 83 * different providers. | 89 * different providers. |
| 84 * @type {SiteSettingsPref} | 90 * @type {SiteSettingsPref} |
| 85 */ | 91 */ |
| 86 var prefsMixedProvider = { | 92 var prefsMixedProvider = { |
| 87 exceptions: { | 93 exceptions: { |
| 88 geolocation: [ | 94 geolocation: [ |
| 89 { | 95 { |
| 96 category: 'geolocation', |
| 90 embeddingOrigin: 'https://[*.]foo.com', | 97 embeddingOrigin: 'https://[*.]foo.com', |
| 91 origin: 'https://[*.]foo.com', | 98 origin: 'https://[*.]foo.com', |
| 92 setting: 'block', | 99 setting: 'block', |
| 93 source: 'policy', | 100 source: 'policy', |
| 94 }, | 101 }, |
| 95 { | 102 { |
| 103 category: 'geolocation', |
| 96 embeddingOrigin: 'https://bar.foo.com', | 104 embeddingOrigin: 'https://bar.foo.com', |
| 97 origin: 'https://bar.foo.com', | 105 origin: 'https://bar.foo.com', |
| 98 setting: 'block', | 106 setting: 'block', |
| 99 source: 'preference', | 107 source: 'preference', |
| 100 }, | 108 }, |
| 101 { | 109 { |
| 110 category: 'geolocation', |
| 102 embeddingOrigin: 'https://[*.]foo.com', | 111 embeddingOrigin: 'https://[*.]foo.com', |
| 103 origin: 'https://[*.]foo.com', | 112 origin: 'https://[*.]foo.com', |
| 104 setting: 'block', | 113 setting: 'block', |
| 105 source: 'preference', | 114 source: 'preference', |
| 106 }, | 115 }, |
| 107 ] | 116 ] |
| 108 } | 117 } |
| 109 }; | 118 }; |
| 110 | 119 |
| 111 /** | 120 /** |
| 112 * An example pref with mixed origin and pattern. | 121 * An example pref with mixed origin and pattern. |
| 113 * @type {SiteSettingsPref} | 122 * @type {SiteSettingsPref} |
| 114 */ | 123 */ |
| 115 var prefsMixedOriginAndPattern = { | 124 var prefsMixedOriginAndPattern = { |
| 116 exceptions: { | 125 exceptions: { |
| 117 auto_downloads: [], | 126 auto_downloads: [], |
| 118 background_sync: [], | 127 background_sync: [], |
| 119 camera: [], | 128 camera: [], |
| 120 cookies: [], | 129 cookies: [], |
| 121 geolocation: [ | 130 geolocation: [ |
| 122 { | 131 { |
| 132 category: 'geolocation', |
| 123 origin: 'https://foo.com', | 133 origin: 'https://foo.com', |
| 124 embeddingOrigin: '*', | 134 embeddingOrigin: '*', |
| 125 setting: 'allow', | 135 setting: 'allow', |
| 126 source: 'preference', | 136 source: 'preference', |
| 127 }, | 137 }, |
| 128 ], | 138 ], |
| 129 images: [], | 139 images: [], |
| 130 javascript: [ | 140 javascript: [ |
| 131 { | 141 { |
| 142 category: 'javascript', |
| 132 origin: 'https://[*.]foo.com', | 143 origin: 'https://[*.]foo.com', |
| 133 embeddingOrigin: '*', | 144 embeddingOrigin: '*', |
| 134 setting: 'allow', | 145 setting: 'allow', |
| 135 source: 'preference', | 146 source: 'preference', |
| 136 }, | 147 }, |
| 137 ], | 148 ], |
| 138 mic: [], | 149 mic: [], |
| 139 notifications: [], | 150 notifications: [], |
| 140 plugins: [], | 151 plugins: [], |
| 141 midiDevices: [], | 152 midiDevices: [], |
| 142 protectedContent: [], | 153 protectedContent: [], |
| 143 popups: [], | 154 popups: [], |
| 144 unsandboxed_plugins: [], | 155 unsandboxed_plugins: [], |
| 145 } | 156 } |
| 146 }; | 157 }; |
| 147 | 158 |
| 148 /** | 159 /** |
| 149 * An example pref with multiple categories and multiple allow/block | 160 * An example pref with multiple categories and multiple allow/block |
| 150 * state. | 161 * state. |
| 151 * @type {SiteSettingsPref} | 162 * @type {SiteSettingsPref} |
| 152 */ | 163 */ |
| 153 var prefsVarious = { | 164 var prefsVarious = { |
| 154 exceptions: { | 165 exceptions: { |
| 155 auto_downloads: [], | 166 auto_downloads: [], |
| 156 background_sync: [], | 167 background_sync: [], |
| 157 camera: [], | 168 camera: [], |
| 158 cookies: [], | 169 cookies: [], |
| 159 geolocation: [ | 170 geolocation: [ |
| 160 { | 171 { |
| 172 category: 'geolocation', |
| 161 embeddingOrigin: 'https://foo.com', | 173 embeddingOrigin: 'https://foo.com', |
| 162 origin: 'https://foo.com', | 174 origin: 'https://foo.com', |
| 163 setting: 'allow', | 175 setting: 'allow', |
| 164 source: 'preference', | 176 source: 'preference', |
| 165 }, | 177 }, |
| 166 { | 178 { |
| 179 category: 'geolocation', |
| 167 embeddingOrigin: 'https://bar.com', | 180 embeddingOrigin: 'https://bar.com', |
| 168 origin: 'https://bar.com', | 181 origin: 'https://bar.com', |
| 169 setting: 'block', | 182 setting: 'block', |
| 170 source: 'preference', | 183 source: 'preference', |
| 171 }, | 184 }, |
| 172 ], | 185 ], |
| 173 images: [], | 186 images: [], |
| 174 javascript: [], | 187 javascript: [], |
| 175 mic: [], | 188 mic: [], |
| 176 midiDevices: [], | 189 midiDevices: [], |
| 177 notifications: [ | 190 notifications: [ |
| 178 { | 191 { |
| 192 category: 'notifications', |
| 179 embeddingOrigin: 'https://google.com', | 193 embeddingOrigin: 'https://google.com', |
| 180 origin: 'https://google.com', | 194 origin: 'https://google.com', |
| 181 setting: 'block', | 195 setting: 'block', |
| 182 source: 'preference', | 196 source: 'preference', |
| 183 }, | 197 }, |
| 184 { | 198 { |
| 199 category: 'notifications', |
| 185 embeddingOrigin: 'https://bar.com', | 200 embeddingOrigin: 'https://bar.com', |
| 186 origin: 'https://bar.com', | 201 origin: 'https://bar.com', |
| 187 setting: 'block', | 202 setting: 'block', |
| 188 source: 'preference', | 203 source: 'preference', |
| 189 }, | 204 }, |
| 190 { | 205 { |
| 206 category: 'notifications', |
| 191 embeddingOrigin: 'https://foo.com', | 207 embeddingOrigin: 'https://foo.com', |
| 192 origin: 'https://foo.com', | 208 origin: 'https://foo.com', |
| 193 setting: 'block', | 209 setting: 'block', |
| 194 source: 'preference', | 210 source: 'preference', |
| 195 }, | 211 }, |
| 196 ], | 212 ], |
| 197 plugins: [], | 213 plugins: [], |
| 198 protectedContent: [], | 214 protectedContent: [], |
| 199 popups: [], | 215 popups: [], |
| 200 unsandboxed_plugins: [], | 216 unsandboxed_plugins: [], |
| 201 } | 217 } |
| 202 }; | 218 }; |
| 203 | 219 |
| 204 /** | 220 /** |
| 205 * An example pref with 1 allowed location item. | 221 * An example pref with 1 allowed location item. |
| 206 * @type {SiteSettingsPref} | 222 * @type {SiteSettingsPref} |
| 207 */ | 223 */ |
| 208 var prefsOneEnabled = { | 224 var prefsOneEnabled = { |
| 209 exceptions: { | 225 exceptions: { |
| 210 geolocation: [ | 226 geolocation: [ |
| 211 { | 227 { |
| 228 category: 'geolocation', |
| 212 embeddingOrigin: 'https://foo-allow.com:443', | 229 embeddingOrigin: 'https://foo-allow.com:443', |
| 213 origin: 'https://foo-allow.com:443', | 230 origin: 'https://foo-allow.com:443', |
| 214 setting: 'allow', | 231 setting: 'allow', |
| 215 source: 'preference', | 232 source: 'preference', |
| 216 }, | 233 }, |
| 217 ] | 234 ] |
| 218 } | 235 } |
| 219 }; | 236 }; |
| 220 | 237 |
| 221 /** | 238 /** |
| 222 * An example pref with 1 blocked location item. | 239 * An example pref with 1 blocked location item. |
| 223 * @type {SiteSettingsPref} | 240 * @type {SiteSettingsPref} |
| 224 */ | 241 */ |
| 225 var prefsOneDisabled = { | 242 var prefsOneDisabled = { |
| 226 exceptions: { | 243 exceptions: { |
| 227 geolocation: [ | 244 geolocation: [ |
| 228 { | 245 { |
| 246 category: 'geolocation', |
| 229 embeddingOrigin: 'https://foo-block.com:443', | 247 embeddingOrigin: 'https://foo-block.com:443', |
| 230 origin: 'https://foo-block.com:443', | 248 origin: 'https://foo-block.com:443', |
| 231 setting: 'block', | 249 setting: 'block', |
| 232 source: 'preference', | 250 source: 'preference', |
| 233 }, | 251 }, |
| 234 ] | 252 ] |
| 235 } | 253 } |
| 236 }; | 254 }; |
| 237 | 255 |
| 238 /** | 256 /** |
| 239 * An example Cookies pref with 1 in each of the three categories. | 257 * An example Cookies pref with 1 in each of the three categories. |
| 240 * @type {SiteSettingsPref} | 258 * @type {SiteSettingsPref} |
| 241 */ | 259 */ |
| 242 var prefsSessionOnly = { | 260 var prefsSessionOnly = { |
| 243 exceptions: { | 261 exceptions: { |
| 244 cookies: [ | 262 cookies: [ |
| 245 { | 263 { |
| 264 category: 'cookies', |
| 246 embeddingOrigin: 'http://foo-block.com', | 265 embeddingOrigin: 'http://foo-block.com', |
| 247 origin: 'http://foo-block.com', | 266 origin: 'http://foo-block.com', |
| 248 setting: 'block', | 267 setting: 'block', |
| 249 source: 'preference', | 268 source: 'preference', |
| 250 }, | 269 }, |
| 251 { | 270 { |
| 271 category: 'cookies', |
| 252 embeddingOrigin: 'http://foo-allow.com', | 272 embeddingOrigin: 'http://foo-allow.com', |
| 253 origin: 'http://foo-allow.com', | 273 origin: 'http://foo-allow.com', |
| 254 setting: 'allow', | 274 setting: 'allow', |
| 255 source: 'preference', | 275 source: 'preference', |
| 256 }, | 276 }, |
| 257 { | 277 { |
| 278 category: 'cookies', |
| 258 embeddingOrigin: 'http://foo-session.com', | 279 embeddingOrigin: 'http://foo-session.com', |
| 259 origin: 'http://foo-session.com', | 280 origin: 'http://foo-session.com', |
| 260 setting: 'session_only', | 281 setting: 'session_only', |
| 261 source: 'preference', | 282 source: 'preference', |
| 262 }, | 283 }, |
| 263 ] | 284 ] |
| 264 } | 285 } |
| 265 }; | 286 }; |
| 266 | 287 |
| 267 /** | 288 /** |
| 268 * An example Cookies pref with mixed incognito and regular settings. | 289 * An example Cookies pref with mixed incognito and regular settings. |
| 269 * @type {SiteSettingsPref} | 290 * @type {SiteSettingsPref} |
| 270 */ | 291 */ |
| 271 var prefsIncognito = { | 292 var prefsIncognito = { |
| 272 exceptions: { | 293 exceptions: { |
| 273 cookies: [ | 294 cookies: [ |
| 274 // foo.com is blocked for regular sessions. | 295 // foo.com is blocked for regular sessions. |
| 275 { | 296 { |
| 297 category: 'cookies', |
| 276 embeddingOrigin: 'http://foo.com', | 298 embeddingOrigin: 'http://foo.com', |
| 277 incognito: false, | 299 incognito: false, |
| 278 origin: 'http://foo.com', | 300 origin: 'http://foo.com', |
| 279 setting: 'block', | 301 setting: 'block', |
| 280 source: 'preference', | 302 source: 'preference', |
| 281 }, | 303 }, |
| 282 // bar.com is an allowed incognito item without an embedder. | 304 // bar.com is an allowed incognito item without an embedder. |
| 283 { | 305 { |
| 306 category: 'cookies', |
| 284 embeddingOrigin: '', | 307 embeddingOrigin: '', |
| 285 incognito: true, | 308 incognito: true, |
| 286 origin: 'http://bar.com', | 309 origin: 'http://bar.com', |
| 287 setting: 'allow', | 310 setting: 'allow', |
| 288 source: 'preference', | 311 source: 'preference', |
| 289 }, | 312 }, |
| 290 // foo.com is allowed in incognito (overridden). | 313 // foo.com is allowed in incognito (overridden). |
| 291 { | 314 { |
| 315 category: 'cookies', |
| 292 embeddingOrigin: 'http://foo.com', | 316 embeddingOrigin: 'http://foo.com', |
| 293 incognito: true, | 317 incognito: true, |
| 294 origin: 'http://foo.com', | 318 origin: 'http://foo.com', |
| 295 setting: 'allow', | 319 setting: 'allow', |
| 296 source: 'preference', | 320 source: 'preference', |
| 297 }, | 321 }, |
| 298 | 322 |
| 299 ] | 323 ] |
| 300 } | 324 } |
| 301 }; | 325 }; |
| 302 | 326 |
| 303 /** | 327 /** |
| 304 * An example Javascript pref with a chrome-extension:// scheme. | 328 * An example Javascript pref with a chrome-extension:// scheme. |
| 305 * @type {SiteSettingsPref} | 329 * @type {SiteSettingsPref} |
| 306 */ | 330 */ |
| 307 var prefsChromeExtension = { | 331 var prefsChromeExtension = { |
| 308 exceptions: { | 332 exceptions: { |
| 309 javascript: [ | 333 javascript: [ |
| 310 { | 334 { |
| 335 category: 'javascript', |
| 311 embeddingOrigin: '', | 336 embeddingOrigin: '', |
| 312 origin: 'chrome-extension://cfhgfbfpcbnnbibfphagcjmgjfjmojfa/', | 337 origin: 'chrome-extension://cfhgfbfpcbnnbibfphagcjmgjfjmojfa/', |
| 313 setting: 'block', | 338 setting: 'block', |
| 314 source: 'preference', | 339 source: 'preference', |
| 315 }, | 340 }, |
| 316 ] | 341 ] |
| 317 } | 342 } |
| 318 }; | 343 }; |
| 319 | 344 |
| 320 function registerTests() { | 345 function registerTests() { |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 | 474 |
| 450 assertEquals(2, testElement.sites.length); | 475 assertEquals(2, testElement.sites.length); |
| 451 assertEquals(prefs.exceptions.geolocation[0].origin, | 476 assertEquals(prefs.exceptions.geolocation[0].origin, |
| 452 testElement.sites[0].origin); | 477 testElement.sites[0].origin); |
| 453 assertEquals(prefs.exceptions.geolocation[1].origin, | 478 assertEquals(prefs.exceptions.geolocation[1].origin, |
| 454 testElement.sites[1].origin); | 479 testElement.sites[1].origin); |
| 455 assertEquals( | 480 assertEquals( |
| 456 settings.PermissionValues.ALLOW, testElement.categorySubtype); | 481 settings.PermissionValues.ALLOW, testElement.categorySubtype); |
| 457 Polymer.dom.flush(); // Populates action menu. | 482 Polymer.dom.flush(); // Populates action menu. |
| 458 openActionMenu(0); | 483 openActionMenu(0); |
| 459 assertMenu(['Block', 'Remove'], testElement); | 484 assertMenu(['Block', 'Edit', 'Remove'], testElement); |
| 460 | 485 |
| 461 assertFalse(testElement.$.category.hidden); | 486 assertFalse(testElement.$.category.hidden); |
| 462 }); | 487 }); |
| 463 }); | 488 }); |
| 464 | 489 |
| 465 test('action menu closes when list changes', function() { | 490 test('action menu closes when list changes', function() { |
| 466 setUpCategory(settings.ContentSettingsTypes.GEOLOCATION, | 491 setUpCategory(settings.ContentSettingsTypes.GEOLOCATION, |
| 467 settings.PermissionValues.ALLOW, prefs); | 492 settings.PermissionValues.ALLOW, prefs); |
| 468 var actionMenu = testElement.$$('dialog[is=cr-action-menu]'); | 493 var actionMenu = testElement.$$('dialog[is=cr-action-menu]'); |
| 469 return browserProxy.whenCalled('getExceptionList').then( | 494 return browserProxy.whenCalled('getExceptionList').then( |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 | 540 |
| 516 assertEquals(2, testElement.sites.length); | 541 assertEquals(2, testElement.sites.length); |
| 517 assertEquals( | 542 assertEquals( |
| 518 prefs.exceptions.geolocation[2].origin, | 543 prefs.exceptions.geolocation[2].origin, |
| 519 testElement.sites[0].origin); | 544 testElement.sites[0].origin); |
| 520 assertEquals( | 545 assertEquals( |
| 521 prefs.exceptions.geolocation[3].origin, | 546 prefs.exceptions.geolocation[3].origin, |
| 522 testElement.sites[1].origin); | 547 testElement.sites[1].origin); |
| 523 Polymer.dom.flush(); // Populates action menu. | 548 Polymer.dom.flush(); // Populates action menu. |
| 524 openActionMenu(0); | 549 openActionMenu(0); |
| 525 assertMenu(['Allow', 'Remove'], testElement); | 550 assertMenu(['Allow', 'Edit', 'Remove'], testElement); |
| 526 | 551 |
| 527 assertFalse(testElement.$.category.hidden); | 552 assertFalse(testElement.$.category.hidden); |
| 528 }); | 553 }); |
| 529 }); | 554 }); |
| 530 | 555 |
| 531 test('initial SESSION ONLY state is correct', function() { | 556 test('initial SESSION ONLY state is correct', function() { |
| 532 var contentType = settings.ContentSettingsTypes.COOKIES; | 557 var contentType = settings.ContentSettingsTypes.COOKIES; |
| 533 var categorySubtype = settings.PermissionValues.SESSION_ONLY; | 558 var categorySubtype = settings.PermissionValues.SESSION_ONLY; |
| 534 setUpCategory(contentType, categorySubtype, prefsSessionOnly); | 559 setUpCategory(contentType, categorySubtype, prefsSessionOnly); |
| 535 return browserProxy.whenCalled('getExceptionList').then( | 560 return browserProxy.whenCalled('getExceptionList').then( |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 }); | 914 }); |
| 890 }); | 915 }); |
| 891 | 916 |
| 892 test('Chrome Extension scheme', function() { | 917 test('Chrome Extension scheme', function() { |
| 893 setUpCategory(settings.ContentSettingsTypes.JAVASCRIPT, | 918 setUpCategory(settings.ContentSettingsTypes.JAVASCRIPT, |
| 894 settings.PermissionValues.BLOCK, prefsChromeExtension); | 919 settings.PermissionValues.BLOCK, prefsChromeExtension); |
| 895 return browserProxy.whenCalled('getExceptionList').then(function( | 920 return browserProxy.whenCalled('getExceptionList').then(function( |
| 896 contentType) { | 921 contentType) { |
| 897 Polymer.dom.flush(); | 922 Polymer.dom.flush(); |
| 898 openActionMenu(0); | 923 openActionMenu(0); |
| 899 assertMenu(['Allow', 'Remove'], testElement); | 924 assertMenu(['Allow', 'Edit', 'Remove'], testElement); |
| 900 | 925 |
| 901 var allow = testElement.$.allow; | 926 var allow = testElement.$.allow; |
| 902 assertTrue(!!allow); | 927 assertTrue(!!allow); |
| 903 MockInteractions.tap(allow); | 928 MockInteractions.tap(allow); |
| 904 return browserProxy.whenCalled('setCategoryPermissionForOrigin'); | 929 return browserProxy.whenCalled('setCategoryPermissionForOrigin'); |
| 905 }).then(function(args) { | 930 }).then(function(args) { |
| 906 assertEquals('chrome-extension://cfhgfbfpcbnnbibfphagcjmgjfjmojfa/', | 931 assertEquals('chrome-extension://cfhgfbfpcbnnbibfphagcjmgjfjmojfa/', |
| 907 args[0]); | 932 args[0]); |
| 908 assertEquals('', args[1]); | 933 assertEquals('', args[1]); |
| 909 assertEquals(settings.ContentSettingsTypes.JAVASCRIPT, args[2]); | 934 assertEquals(settings.ContentSettingsTypes.JAVASCRIPT, args[2]); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 979 | 1004 |
| 980 assertFalse(dialog.$.dialog.open); | 1005 assertFalse(dialog.$.dialog.open); |
| 981 }); | 1006 }); |
| 982 }); | 1007 }); |
| 983 }); | 1008 }); |
| 984 | 1009 |
| 985 return { | 1010 return { |
| 986 registerTests: registerTests, | 1011 registerTests: registerTests, |
| 987 }; | 1012 }; |
| 988 }); | 1013 }); |
| OLD | NEW |