OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>ServiceWorker object: terminate operation</title> | 2 <title>ServiceWorker object: terminate operation</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 async_test(function(t) { | 8 async_test(function(t) { |
9 var worker = 'resources/empty-worker.js'; | 9 var worker = 'resources/empty-worker.js'; |
10 var scope = 'resources/blank.html'; | 10 var scope = 'resources/blank.html'; |
11 service_worker_unregister_and_register(t, worker, scope) | 11 service_worker_unregister_and_register(t, worker, scope) |
12 .then(t.step_func(function(registration) { | 12 .then(t.step_func(function(registration) { |
13 return wait_for_update(t, registration); | |
14 })) | |
15 .then(t.step_func(function(worker) { | |
16 assert_throws({name: 'InvalidAccessError'}, function() { | 13 assert_throws({name: 'InvalidAccessError'}, function() { |
17 worker.terminate(); | 14 registration.installing.terminate(); |
18 }); | 15 }); |
19 return service_worker_unregister_and_done(t, scope); | 16 return service_worker_unregister_and_done(t, scope); |
20 })) | 17 })) |
21 .catch(t.step_func(function(e) { throw e; })); | 18 .catch(t.step_func(function(e) { throw e; })); |
22 }, 'Verify the terminate operation'); | 19 }, 'Verify the terminate operation'); |
23 | 20 |
24 </script> | 21 </script> |
OLD | NEW |