When SW install fails, null out registration.installing before setting worker state...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Feb 2018 07:09:25 +0000 (07:09 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Feb 2018 07:09:25 +0000 (07:09 +0000)
commit19f2137c858b9d0c3691cacd83e62420ab04456b
tree562e7cd4703df6d92e5e80462b82af987afcc704
parentc33b7528e762d111a930d8e08fc21140dfbd989e
When SW install fails, null out registration.installing before setting worker state to "redundant"
https://bugs.webkit.org/show_bug.cgi?id=182416
<rdar://problem/37141997>

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Rebaseline WPT test now that one more check is passing.

* web-platform-tests/service-workers/service-worker/register-same-scope-different-script-url.https-expected.txt:

Source/WebCore:

When SW install fails, null out registration.installing before setting worker state to "redundant".
This does not match the spec but this is what Firefox and Chrome do. This is also what the
web-platform-tests expect.

Test: http/tests/workers/service/install-fails.html

* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::didFinishInstall):

LayoutTests:

Add layout test coverage. I have verified that this test is passing in both Firefox and Chrome.

* http/tests/workers/service/install-fails-expected.txt: Added.
* http/tests/workers/service/install-fails.html: Added.
* http/tests/workers/service/resources/install-fails-worker.js: Added.
(event.event.waitUntil.new.Promise):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227997 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/workers/service/install-fails-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/workers/service/install-fails.html [new file with mode: 0644]
LayoutTests/http/tests/workers/service/resources/install-fails-worker.js [new file with mode: 0644]
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/register-same-scope-different-script-url.https-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/workers/service/server/SWServerJobQueue.cpp