Re: [w3c/ServiceWorker] Does changing updateViaCache mint a new ServiceWorkerRegistration or update them all? (#1189)

I was a bit wrong. We have basic tests that the registration object remains the same and the updateViaCache property is updated after register() is called with a new value. I wanted to add a test that all registration objects for the same registration entity are updated. So the test would like:


```
let reg  = await register('sw.js');
reg.updateViaCache; // 'imports'
let frameReg = await frame.contentWindow.navigator.serviceWorker.getRegistration('sw.js');
await register('sw.js', {updateViaCache: 'none'});
reg.updateViaCache; // 'none'
frameReg.updateViaCache; // 'none'
```

I'm not sure when the spec guarantees that frameReg.updateViaCache is updated. So our test might use  wait_for_activation_on_dummy_scope() to try to wait for the update  to happen.

I'd also like to add a test for the unregister() case, just to ensure we don't crash.

We could do these as Chromium only tests since the spec might be vague here, but I prefer WPT tests by default.



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/1189#issuecomment-380689629

Received on Thursday, 12 April 2018 06:09:16 UTC