importScripts in service worker should use ServiceWorkersMode::None
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Oct 2017 23:50:35 +0000 (23:50 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Oct 2017 23:50:35 +0000 (23:50 +0000)
commit599889fd2dc5443e01312d7307701010d248c690
tree906deec2d2fe0e244be7d5db8f127501dfae2148
parenteae93515beaac5af9c17bc383e1f3cc5a5c2da60
importScripts in service worker should use ServiceWorkersMode::None
https://bugs.webkit.org/show_bug.cgi?id=178888

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-26
Reviewed by Chris Dumez.

Source/WebCore:

Test: http/tests/workers/service/service-worker-importScript.html

Made sure ServiceWorkersMode::None is used for loading scripts in service workers as we do not support foreign fetch.

* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadSynchronously):

LayoutTests:

* http/tests/workers/service/resources/service-worker-importScript-worker.js: Added.
* http/tests/workers/service/resources/service-worker-importScript.js: Added.
* http/tests/workers/service/service-worker-importScript-expected.txt: Added.
* http/tests/workers/service/service-worker-importScript.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224070 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/workers/service/resources/service-worker-importScript-worker.js [new file with mode: 0644]
LayoutTests/http/tests/workers/service/resources/service-worker-importScript.js [new file with mode: 0644]
LayoutTests/http/tests/workers/service/service-worker-importScript-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/workers/service/service-worker-importScript.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/workers/WorkerScriptLoader.cpp