update-result.https.html (849B)
1 <!DOCTYPE html> 2 <title>Service Worker: update() should resolve a ServiceWorkerRegistration</title> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <script src="resources/test-helpers.sub.js"></script> 6 <body> 7 <script> 8 9 promise_test(async function(t) { 10 const script = './resources/empty.js'; 11 const scope = './resources/empty.html?update-result'; 12 13 let reg = await navigator.serviceWorker.register(script, { scope }); 14 t.add_cleanup(async _ => await reg.unregister()); 15 await wait_for_state(t, reg.installing, 'activated'); 16 17 let result = await reg.update(); 18 assert_true(result instanceof ServiceWorkerRegistration, 19 'update() should resolve a ServiceWorkerRegistration'); 20 }, 'ServiceWorkerRegistration.update() should resolve a registration object'); 21 22 </script> 23 </body>