Service Worker Registration promise is sometimes not rejected when the script load...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Dec 2017 19:36:51 +0000 (19:36 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Dec 2017 19:36:51 +0000 (19:36 +0000)
commitd2c8973c7b8f4175fde1a05294f7344e4bae23a6
treeb38f979b23573f590c94027a13366f4dd28d5e52
parent451ff59c1f1b7ed4d87c5aaa4f2b16cb174db667
Service Worker Registration promise is sometimes not rejected when the script load fails
https://bugs.webkit.org/show_bug.cgi?id=180849

Reviewed by Brady Eidson.

LayoutTests/imported/w3c:

Rebaseline tests that are now passing.

* web-platform-tests/service-workers/service-worker/register-same-scope-different-script-url.https-expected.txt:
* web-platform-tests/service-workers/service-worker/registration-iframe.https-expected.txt:
* web-platform-tests/service-workers/service-worker/registration-script.https-expected.txt:
* web-platform-tests/service-workers/service-worker/registration-security-error.https-expected.txt:
* web-platform-tests/service-workers/service-worker/unregister-then-register-new-script.https-expected.txt:

Source/WebCore:

Service Worker Registration promise is sometimes not rejected when the script load fails.
This was caused by the ServiceWorkerJob sometimes passing a null ResourceError to the
StorageProcess, even though the load failed.

No new tests, rebaselined exisiting tests.

* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::notifyError):
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::notifyFinished):

LayoutTests:

Fix WebKit-specific tests that had invalid URLs for workers. We failed to notice this
before because we were wrongly resolving the registration promise.

* http/tests/workers/service/basic-register-expected.txt:
* http/tests/workers/service/basic-unregister-then-register-again-no-reuse.html:
* http/tests/workers/service/registration-clear-redundant-worker.html:
* http/tests/workers/service/resources/basic-register.js:
* http/tests/workers/service/service-worker-gc-event.html:
* http/tests/workers/service/service-worker-registration-gc-event.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/workers/service/basic-register-expected.txt
LayoutTests/http/tests/workers/service/basic-unregister-then-register-again-no-reuse.html
LayoutTests/http/tests/workers/service/registration-clear-redundant-worker.html
LayoutTests/http/tests/workers/service/resources/basic-register.js
LayoutTests/http/tests/workers/service/service-worker-gc-event.html
LayoutTests/http/tests/workers/service/service-worker-registration-gc-event.html
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/register-same-scope-different-script-url.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-iframe.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-script.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-security-error.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/unregister-then-register-new-script.https-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/workers/WorkerScriptLoader.cpp
Source/WebCore/workers/service/ServiceWorkerJob.cpp