self.importScripts() should obey updateViaCache inside service workers
https://bugs.webkit.org/show_bug.cgi?id=180826
Reviewed by Youenn Fablet.
Source/WebCore:
self.importScripts() should obey updateViaCache inside service workers, as per:
- https://html.spec.whatwg.org/multipage/workers.html#dom-workerglobalscope-importscripts
Tests: http/tests/workers/service/registration-updateViaCache-all-importScripts.html
http/tests/workers/service/registration-updateViaCache-imports-importScripts.html
http/tests/workers/service/registration-updateViaCache-none-importScripts.html
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::importScripts):
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadSynchronously):
* workers/WorkerScriptLoader.h:
* workers/service/SWClientConnection.cpp:
(WebCore::SWClientConnection::setRegistrationLastUpdateTime):
* workers/service/SWClientConnection.h:
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::lastUpdateTime const):
(WebCore::ServiceWorkerRegistration::setLastUpdateTime):
* workers/service/ServiceWorkerRegistration.h:
* workers/service/server/SWServer.h:
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::setLastUpdateTime):
* workers/service/server/SWServerRegistration.h:
Source/WebKit:
* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::setRegistrationLastUpdateTime):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* WebProcess/Storage/WebSWClientConnection.messages.in:
LayoutTests:
Add layout test coverage.
* http/tests/workers/service/registration-updateViaCache-all-importScripts-expected.txt: Added.
* http/tests/workers/service/registration-updateViaCache-all-importScripts.html: Added.
* http/tests/workers/service/registration-updateViaCache-imports-importScripts-expected.txt: Added.
* http/tests/workers/service/registration-updateViaCache-imports-importScripts.html: Added.
* http/tests/workers/service/registration-updateViaCache-none-importScripts-expected.txt: Added.
* http/tests/workers/service/registration-updateViaCache-none-importScripts.html: Added.
* http/tests/workers/service/resources/import-cacheable-script-worker.js: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225940
268f45cc-cd09-0410-ab3c-
d52691b4dbfc