| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <title>ServiceWorker object: scope and url property</title> | 2 <title>ServiceWorker object: scope and url property</title> |
| 3 <script src="../resources/testharness.js"></script> | 3 <script src="../resources/testharness.js"></script> |
| 4 <script src="../resources/testharnessreport.js"></script> | 4 <script src="../resources/testharnessreport.js"></script> |
| 5 <script src="resources/test-helpers.js"></script> | 5 <script src="resources/test-helpers.js"></script> |
| 6 <script> | 6 <script> |
| 7 | 7 |
| 8 function scope_test(name, url, scope) { | 8 function scope_test(name, url, scope) { |
| 9 var t = async_test('Verify the scope and url property: ' + name); | 9 var t = async_test('Verify the scope and url property: ' + name); |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 function onRegister(worker) { | 21 function onRegister(worker) { |
| 22 assert_equals(worker.scope, expectedScope, 'Returned ServiceWorker o
bject should have scope'); | 22 assert_equals(worker.scope, expectedScope, 'Returned ServiceWorker o
bject should have scope'); |
| 23 assert_equals(worker.url, expectedURL, 'Returned ServiceWorker objec
t should have url'); | 23 assert_equals(worker.url, expectedURL, 'Returned ServiceWorker objec
t should have url'); |
| 24 service_worker_unregister_and_done(t, scope); | 24 service_worker_unregister_and_done(t, scope); |
| 25 } | 25 } |
| 26 }); | 26 }); |
| 27 } | 27 } |
| 28 | 28 |
| 29 scope_test('default', 'resources/worker-no-op.js'); | 29 scope_test('default', 'resources/worker-no-op.js'); |
| 30 scope_test('wildcard', 'resources/worker-no-op.js', '*'); | 30 scope_test('wildcard', 'resources/worker-no-op.js', '*'); |
| 31 scope_test('script with fragment', 'resources/worker-no-op.js#ref', 'http://127.
0.0.1:8000/*'); |
| 32 scope_test('scope with fragment', 'resources/worker-no-op.js', 'http://127.0.0.1
:8000/*#ref'); |
| 33 scope_test('scope with query', 'resources/worker-no-op.js', '/a?b=c'); |
| 31 scope_test('relative path', 'resources/worker-no-op.js', '/a/b/c/'); | 34 scope_test('relative path', 'resources/worker-no-op.js', '/a/b/c/'); |
| 32 scope_test('relative path with wildcard', 'resources/empty-worker.js', '/a/b/c/*
'); | 35 scope_test('relative path with wildcard', 'resources/empty-worker.js', '/a/b/c/*
'); |
| 33 scope_test('absolute url', 'resources/empty-worker.js', 'http://127.0.0.1:8000/'
); | 36 scope_test('absolute url', 'resources/empty-worker.js', 'http://127.0.0.1:8000/'
); |
| 34 scope_test('absolute url with wildcard', 'resources/empty-worker.js', 'http://12
7.0.0.1:8000/*'); | 37 scope_test('absolute url with wildcard', 'resources/empty-worker.js', 'http://12
7.0.0.1:8000/*'); |
| 35 | 38 |
| 36 </script> | 39 </script> |
| OLD | NEW |