Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <script src="../resources/testharness.js"></script> | |
| 3 <script src="../resources/testharness-helpers.js"></script> | |
| 4 <script src="../resources/testharnessreport.js"></script> | |
| 5 <script src="resources/test-helpers.js"></script> | |
| 6 <script> | |
| 7 function wait_for_install_event(worker) { | |
| 8 return new Promise(function(resolve) { | |
| 9 worker.addEventListener('statechange', function(event) { | |
| 10 if (worker.state == 'installed') | |
| 11 resolve(true); | |
| 12 else if (worker.state == 'redundant') | |
| 13 resolve(false); | |
| 14 }); | |
| 15 }); | |
| 16 } | |
| 17 | |
| 18 promise_test(function(t) { | |
| 19 return service_worker_unregister_and_register(t, 'resources/oninstall-even t-type.js', 'resources/oninstall-event-type.js') | |
|
falken
2015/04/08 05:44:46
By convention, service worker script filenames end
Paritosh Kumar
2015/04/08 06:44:06
Thanks. Done.
OO, I was using 'resources/oninstal
| |
| 20 .then(function(registration) { | |
| 21 return wait_for_install_event(registration.installing); | |
| 22 }) | |
| 23 .then(function(did_install) { | |
| 24 assert_equals(did_install, true,'The worker was installed'); | |
|
falken
2015/04/08 05:44:46
You can use assert_true rather than assert_equals
Paritosh Kumar
2015/04/08 06:44:06
Yeah.. Thanks.
| |
| 25 }) | |
| 26 }, 'install event type'); | |
| 27 | |
| 28 </script> | |
| 29 | |
|
falken
2015/04/08 05:44:46
nit: extra empty line
Paritosh Kumar
2015/04/08 06:44:06
Done.
| |
| OLD | NEW |