Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Issue 1865103003: ServiceWorker: Add a test to check if worker is deleted after reloading iframe following unregister (Closed)

Created:
4 years, 8 months ago by shimazu (google)
Modified:
4 years, 8 months ago
Reviewers:
falken, nhiroki
CC:
chromium-reviews, michaeln, jsbell+serviceworker_chromium.org, kenjibaheux+watch_chromium.org, tzik, serviceworker-reviews, kinuko+serviceworker, blink-reviews, horo+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

ServiceWorker: Add a test to check if worker is updated after reloading After unregistration of a service worker, reloading an iframe provided by the SW should release that worker. This patch is a test for checking this behavior. And, I expected the result of this new test is different between chromium and firefox based on crbug.com/594032, but both two environments passed the test. I'm not sure the difference between reload button and frame.contentWindow.reload(). BUG=594032 Committed: https://crrev.com/6a23a81226c806c8a34291b177ee058dd45b6527 Cr-Commit-Position: refs/heads/master@{#386599}

Patch Set 1 #

Patch Set 2 : Untabified #

Patch Set 3 : indent #

Total comments: 11

Patch Set 4 : Fix the indents and check if r.active is the same with r.installing after the activation #

Total comments: 4

Patch Set 5 : Sipmlify the test #

Total comments: 4

Patch Set 6 : Remove a nest by returning a returned value of getRegistration() #

Patch Set 7 : Change the test to check if the registration gets null/undefined #

Total comments: 8

Patch Set 8 : Update description #

Total comments: 2

Patch Set 9 : Update the scope to match the latest test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+39 lines, -0 lines) Patch
M third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html View 1 2 3 4 5 6 7 8 1 chunk +39 lines, -0 lines 0 comments Download

Messages

Total messages: 31 (7 generated)
shimazu (google)
PTAL:)
4 years, 8 months ago (2016-04-07 07:10:14 UTC) #2
nhiroki
https://codereview.chromium.org/1865103003/diff/40001/third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html File third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html (right): https://codereview.chromium.org/1865103003/diff/40001/third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html#newcode65 third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html:65: .then(function(r) { Can you make indents consistent with other ...
4 years, 8 months ago (2016-04-07 10:27:59 UTC) #3
shimazu (google)
Thanks, I incorporate with the reviews. And, I found, on firefox, the |registration.active| in l.99 ...
4 years, 8 months ago (2016-04-08 02:09:20 UTC) #4
falken
Drive by comment inline. > And, I found, on firefox, the |registration.active| in l.99 is ...
4 years, 8 months ago (2016-04-08 02:27:18 UTC) #6
falken
Also, "worker is updated after reloading" is a bit misleading; it sounds like update() or ...
4 years, 8 months ago (2016-04-08 02:29:02 UTC) #7
nhiroki
On 2016/04/08 02:27:18, falken wrote: > Drive by comment inline. > > > And, I ...
4 years, 8 months ago (2016-04-08 03:24:40 UTC) #8
nhiroki
https://codereview.chromium.org/1865103003/diff/60001/third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html File third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html (right): https://codereview.chromium.org/1865103003/diff/60001/third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html#newcode92 third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html:92: 'active sw should be null after reloading'); The purpose ...
4 years, 8 months ago (2016-04-08 03:46:26 UTC) #9
shimazu (google)
On 2016/04/08 03:24:40, nhiroki wrote: > On 2016/04/08 02:27:18, falken wrote: > > Drive by ...
4 years, 8 months ago (2016-04-08 04:32:00 UTC) #10
shimazu (google)
This test is simplified for checking the difference of "registration" instead of "service worker". I ...
4 years, 8 months ago (2016-04-11 03:28:45 UTC) #11
nhiroki
https://codereview.chromium.org/1865103003/diff/80001/third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html File third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html (right): https://codereview.chromium.org/1865103003/diff/80001/third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html#newcode61 third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html:61: 'with-old-registration-in-use'; I'm wondering if we could minimize this test. ...
4 years, 8 months ago (2016-04-11 05:33:13 UTC) #12
shimazu (google)
Fixed these things. \PTAL/ https://codereview.chromium.org/1865103003/diff/80001/third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html File third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html (right): https://codereview.chromium.org/1865103003/diff/80001/third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html#newcode61 third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html:61: 'with-old-registration-in-use'; On 2016/04/11 05:33:13, nhiroki ...
4 years, 8 months ago (2016-04-11 06:58:15 UTC) #13
nhiroki
Almost there! https://codereview.chromium.org/1865103003/diff/120001/third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html File third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html (right): https://codereview.chromium.org/1865103003/diff/120001/third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html#newcode63 third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html:63: var new_registration; unused https://codereview.chromium.org/1865103003/diff/120001/third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html#newcode65 third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html:65: var service_worker; ...
4 years, 8 months ago (2016-04-11 09:51:36 UTC) #14
shimazu (google)
Thanks, PTAL! https://codereview.chromium.org/1865103003/diff/120001/third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html File third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html (right): https://codereview.chromium.org/1865103003/diff/120001/third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html#newcode63 third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html:63: var new_registration; On 2016/04/11 09:51:36, nhiroki wrote: ...
4 years, 8 months ago (2016-04-12 03:42:30 UTC) #15
nhiroki
LGTM As falken@ mentioned, 'worker is updated after reloading' sounds a bit confusing. Can you ...
4 years, 8 months ago (2016-04-12 04:19:10 UTC) #16
shimazu (google)
https://codereview.chromium.org/1865103003/diff/140001/third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html File third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html (right): https://codereview.chromium.org/1865103003/diff/140001/third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html#newcode61 third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-then-register.html:61: 'with-old-registration-in-use'; On 2016/04/12 04:19:10, nhiroki wrote: > This scope ...
4 years, 8 months ago (2016-04-12 05:22:29 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1865103003/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1865103003/160001
4 years, 8 months ago (2016-04-12 05:23:36 UTC) #21
commit-bot: I haz the power
Committed patchset #9 (id:160001)
4 years, 8 months ago (2016-04-12 06:25:29 UTC) #23
commit-bot: I haz the power
Patchset 9 (id:??) landed as https://crrev.com/6a23a81226c806c8a34291b177ee058dd45b6527 Cr-Commit-Position: refs/heads/master@{#386599}
4 years, 8 months ago (2016-04-12 06:27:12 UTC) #25
falken
On 2016/04/12 04:19:10, nhiroki wrote: > LGTM > > As falken@ mentioned, 'worker is updated ...
4 years, 8 months ago (2016-04-12 11:58:21 UTC) #26
falken
I think this test might not assert the desired behavior. Reload of a page never ...
4 years, 8 months ago (2016-04-12 23:39:22 UTC) #27
nhiroki
On 2016/04/12 23:39:22, falken wrote: > I think this test might not assert the desired ...
4 years, 8 months ago (2016-04-13 00:56:24 UTC) #28
falken
On 2016/04/13 00:56:24, nhiroki wrote: > On 2016/04/12 23:39:22, falken wrote: > > I think ...
4 years, 8 months ago (2016-04-13 03:09:14 UTC) #29
nhiroki
On 2016/04/13 03:09:14, falken wrote: > On 2016/04/13 00:56:24, nhiroki wrote: > > On 2016/04/12 ...
4 years, 8 months ago (2016-04-13 04:04:43 UTC) #30
nhiroki
4 years, 8 months ago (2016-04-13 04:12:15 UTC) #31
Message was sent while issue was closed.
On 2016/04/13 04:04:43, nhiroki wrote:
> On 2016/04/13 03:09:14, falken wrote:
> > On 2016/04/13 00:56:24, nhiroki wrote:
> > > On 2016/04/12 23:39:22, falken wrote:
> > > > I think this test might not assert the desired behavior. Reload of a
page
> > > never
> > > > causes the "all clients are unloaded" state that triggers Clear
> > > > Registration/Activate. So we'd expect the same thing to happen for
> reloading
> > > an
> > > > iframe.
> > > 
> > > Hmm... I don't fully understand why reloading an iframe does not cause
"all
> > > clients are unloaded" state yet. I'd like to confirm my understanding, so
> let
> > me
> > > share my interpretation of the specs...
> > > 
> > >   1. Reloading an iframe by Location.reload() triggers a navigation [1]
> > >   2. Navigation triggers "prompt to unload the document" at the step 9 [2]
> > >   3. Unloading triggers "Handle Service Worker Client Unload" [3]
> > > 
> > >   (According to the paragraph "When a user requests that ..." on reload()
> > > algorithm [1], reload of a page by UI seems also to trigger a
> > navigation/unload)
> > > 
> > > Is this interpretation missing something? For example, are there any
> > > early-return cases w/o unloading a client in the above sequences?
> > > 
> > > [1]
https://html.spec.whatwg.org/multipage/browsers.html#dom-location-reload
> > > [2] https://html.spec.whatwg.org/multipage/browsers.html#navigate
> > > [3]
> > >
> >
>
https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#on-client-un...
> > > 
> > 
> > I think it's possible the spec doesn't say what's intended, but there's
clear
> > consensus that reload of a page by UI should not activate the worker
(verified
> > at the F2F). The reason is that the new client is created before the old
> client
> > is unloaded, so there's never a time when "all clients are unloaded". So I'd
> be
> > surprised that iframe reload doesn't work the same way.
> > 
> > I think the easiest thing is just raise a spec issue and see what the
intended
> > behavior is, but first I wanted to make sure the behavior we're observing is
> the
> > same with Activation (rather than specific to Clear Registration).
> 
> I understand it. Thank you for your explanation :)
> 
> > > > Can we additionally check whether reloading an iframe triggers Activate
> for
> > > > Chrome and Firefox, and file a spec bug about this?
> 
> shimazu-san, can you check this?

We maybe need to move the test added by this CL to chromium/ directory because
it does not verify the desired (spec'ed) behavior but the current chromium
behavior.

Powered by Google App Engine
This is Rietveld 408576698