| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <title>Service Worker: Registration</title> | 2 <title>Service Worker: Registration</title> |
| 3 <script src="../resources/testharness.js"></script> | 3 <script src="../resources/testharness.js"></script> |
| 4 <script src="../resources/testharness-helpers.js"></script> | 4 <script src="../resources/testharness-helpers.js"></script> |
| 5 <script src="../resources/testharnessreport.js"></script> | 5 <script src="../resources/testharnessreport.js"></script> |
| 6 <script src="resources/test-helpers.js"></script> | 6 <script src="resources/test-helpers.js"></script> |
| 7 <script> | 7 <script> |
| 8 | 8 |
| 9 promise_test(function(t) { | 9 promise_test(function(t) { |
| 10 var script = 'resources/registration-worker.js'; | 10 var script = 'resources/registration-worker.js'; |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 'Non-URL-encoded multibyte characters should be available.'); | 221 'Non-URL-encoded multibyte characters should be available.'); |
| 222 service_worker_unregister_and_done(t, scope); | 222 service_worker_unregister_and_done(t, scope); |
| 223 }); | 223 }); |
| 224 }, 'Scope including non-escaped multibyte characters'); | 224 }, 'Scope including non-escaped multibyte characters'); |
| 225 | 225 |
| 226 promise_test(function(t) { | 226 promise_test(function(t) { |
| 227 var script = 'resources%2fempty-worker.js'; | 227 var script = 'resources%2fempty-worker.js'; |
| 228 var scope = 'resources/scope/encoded-slash-in-script-url'; | 228 var scope = 'resources/scope/encoded-slash-in-script-url'; |
| 229 return assert_promise_rejects( | 229 return assert_promise_rejects( |
| 230 navigator.serviceWorker.register(script, {scope: scope}), | 230 navigator.serviceWorker.register(script, {scope: scope}), |
| 231 'SecurityError', | 231 new TypeError, |
| 232 'URL-encoded slash in the script URL should be rejected.'); | 232 'URL-encoded slash in the script URL should be rejected.'); |
| 233 }, 'Script URL including URL-encoded slash'); | 233 }, 'Script URL including URL-encoded slash'); |
| 234 | 234 |
| 235 promise_test(function(t) { | 235 promise_test(function(t) { |
| 236 var script = 'resources%2Fempty-worker.js'; |
| 237 var scope = 'resources/scope/encoded-slash-in-script-url'; |
| 238 return assert_promise_rejects( |
| 239 navigator.serviceWorker.register(script, {scope: scope}), |
| 240 new TypeError, |
| 241 'URL-encoded slash in the script URL should be rejected.'); |
| 242 }, 'Script URL including uppercase URL-encoded slash'); |
| 243 |
| 244 promise_test(function(t) { |
| 236 var script = 'resources/empty-worker.js'; | 245 var script = 'resources/empty-worker.js'; |
| 237 var scope = 'resources/scope%2fencoded-slash-in-scope'; | 246 var scope = 'resources/scope%2fencoded-slash-in-scope'; |
| 238 return assert_promise_rejects( | 247 return assert_promise_rejects( |
| 239 navigator.serviceWorker.register(script, {scope: scope}), | 248 navigator.serviceWorker.register(script, {scope: scope}), |
| 240 'SecurityError', | 249 new TypeError, |
| 241 'URL-encoded slash in the scope should be rejected.'); | 250 'URL-encoded slash in the scope should be rejected.'); |
| 242 }, 'Scope including URL-encoded slash'); | 251 }, 'Scope including URL-encoded slash'); |
| 243 | 252 |
| 244 promise_test(function(t) { | 253 promise_test(function(t) { |
| 245 var script = 'resources%5cempty-worker.js'; | 254 var script = 'resources%5cempty-worker.js'; |
| 246 var scope = 'resources/scope/encoded-slash-in-script-url'; | 255 var scope = 'resources/scope/encoded-slash-in-script-url'; |
| 247 return assert_promise_rejects( | 256 return assert_promise_rejects( |
| 248 navigator.serviceWorker.register(script, {scope: scope}), | 257 navigator.serviceWorker.register(script, {scope: scope}), |
| 249 'SecurityError', | 258 new TypeError, |
| 250 'URL-encoded backslash in the script URL should be rejected.'); | 259 'URL-encoded backslash in the script URL should be rejected.'); |
| 251 }, 'Script URL including URL-encoded backslash'); | 260 }, 'Script URL including URL-encoded backslash'); |
| 252 | 261 |
| 253 promise_test(function(t) { | 262 promise_test(function(t) { |
| 263 var script = 'resources%5Cempty-worker.js'; |
| 264 var scope = 'resources/scope/encoded-slash-in-script-url'; |
| 265 return assert_promise_rejects( |
| 266 navigator.serviceWorker.register(script, {scope: scope}), |
| 267 new TypeError, |
| 268 'URL-encoded backslash in the script URL should be rejected.'); |
| 269 }, 'Script URL including uppercase URL-encoded backslash'); |
| 270 |
| 271 promise_test(function(t) { |
| 254 var script = 'resources/empty-worker.js'; | 272 var script = 'resources/empty-worker.js'; |
| 255 var scope = 'resources/scope%5cencoded-slash-in-scope'; | 273 var scope = 'resources/scope%5cencoded-slash-in-scope'; |
| 256 return assert_promise_rejects( | 274 return assert_promise_rejects( |
| 257 navigator.serviceWorker.register(script, {scope: scope}), | 275 navigator.serviceWorker.register(script, {scope: scope}), |
| 258 'SecurityError', | 276 new TypeError, |
| 259 'URL-encoded backslash in the scope should be rejected.'); | 277 'URL-encoded backslash in the scope should be rejected.'); |
| 260 }, 'Scope including URL-encoded backslash'); | 278 }, 'Scope including URL-encoded backslash'); |
| 261 | 279 |
| 262 promise_test(function(t) { | 280 promise_test(function(t) { |
| 263 var script = 'resources/././empty-worker.js'; | 281 var script = 'resources/././empty-worker.js'; |
| 264 var scope = 'resources/scope/parent-reference-in-script-url'; | 282 var scope = 'resources/scope/parent-reference-in-script-url'; |
| 265 return navigator.serviceWorker.register(script, {scope: scope}) | 283 return navigator.serviceWorker.register(script, {scope: scope}) |
| 266 .then(function(registration) { | 284 .then(function(registration) { |
| 267 assert_equals( | 285 assert_equals( |
| 268 registration.installing.scriptURL, | 286 registration.installing.scriptURL, |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 var script = 'resources/empty-worker.js'; | 377 var script = 'resources/empty-worker.js'; |
| 360 var scope = 'filesystem:' + normalizeURL('resources/scope/filesystem-scope-u
rl'); | 378 var scope = 'filesystem:' + normalizeURL('resources/scope/filesystem-scope-u
rl'); |
| 361 return assert_promise_rejects( | 379 return assert_promise_rejects( |
| 362 navigator.serviceWorker.register(script, {scope: scope}), | 380 navigator.serviceWorker.register(script, {scope: scope}), |
| 363 'SecurityError', | 381 'SecurityError', |
| 364 'Registering with the scope that has same-origin filesystem: URL ' + | 382 'Registering with the scope that has same-origin filesystem: URL ' + |
| 365 'should fail with SecurityError.'); | 383 'should fail with SecurityError.'); |
| 366 }, 'Scope URL is same-origin filesystem: URL'); | 384 }, 'Scope URL is same-origin filesystem: URL'); |
| 367 | 385 |
| 368 </script> | 386 </script> |
| OLD | NEW |