| Differences between
and this patch
- a/Source/WebCore/ChangeLog +42 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2021-02-20  Yusuke Suzuki  <ysuzuki@apple.com>
2
3
        Support modules in service workers
4
        https://bugs.webkit.org/show_bug.cgi?id=222155
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        This patch adds module support to service-workers. Basically this just plumbs the type: "module" information to
9
        service worker's job as described in the spec[1]: Each SW job should have workerType, and this is passed.
10
        And we sometimes compare newestWorker->type() with this job.workerType (as defined in the spec). And we spawn
11
        the SW with this job.workerType. Since Worker already supports "module" evaluation, this is automatically evaluated
12
        as modules if we spawn SW thread with "module" type.
13
14
        When using, we can pass "module" type to the register method as follows.
15
16
            navigator.serviceWorker.register('script.mjs', {
17
                type: "module"
18
            });
19
20
        [1]: https://w3c.github.io/ServiceWorker/
21
22
        * workers/service/ServiceWorker.h:
23
        * workers/service/ServiceWorkerContainer.cpp:
24
        (WebCore::ServiceWorkerContainer::addRegistration):
25
        (WebCore::ServiceWorkerContainer::updateRegistration):
26
        * workers/service/ServiceWorkerJobData.cpp:
27
        (WebCore::ServiceWorkerJobData::isolatedCopy const):
28
        (WebCore::ServiceWorkerJobData::isEquivalent const):
29
        * workers/service/ServiceWorkerJobData.h:
30
        (WebCore::ServiceWorkerJobData::encode const):
31
        (WebCore::ServiceWorkerJobData::decode):
32
        * workers/service/ServiceWorkerRegistration.cpp:
33
        (WebCore::ServiceWorkerRegistration::update):
34
        * workers/service/context/ServiceWorkerThread.cpp:
35
        (WebCore::ServiceWorkerThread::ServiceWorkerThread):
36
        * workers/service/server/SWServer.cpp:
37
        (WebCore::SWServer::softUpdate):
38
        * workers/service/server/SWServerJobQueue.cpp:
39
        (WebCore::SWServerJobQueue::scriptFetchFinished):
40
        (WebCore::SWServerJobQueue::runRegisterJob):
41
        (WebCore::SWServerJobQueue::runUpdateJob):
42
1
2021-02-19  Yusuke Suzuki  <ysuzuki@apple.com>
43
2021-02-19  Yusuke Suzuki  <ysuzuki@apple.com>
2
44
3
        JS Modules in Workers
45
        JS Modules in Workers
- a/Source/WebCore/workers/service/ServiceWorker.h +1 lines
Lines 64-69 class ServiceWorker final : public RefCounted<ServiceWorker>, public EventTarget a/Source/WebCore/workers/service/ServiceWorker.h_sec1
64
64
65
    ServiceWorkerIdentifier identifier() const { return m_data.identifier; }
65
    ServiceWorkerIdentifier identifier() const { return m_data.identifier; }
66
    ServiceWorkerRegistrationIdentifier registrationIdentifier() const { return m_data.registrationIdentifier; }
66
    ServiceWorkerRegistrationIdentifier registrationIdentifier() const { return m_data.registrationIdentifier; }
67
    WorkerType workerType() const { return m_data.type; }
67
68
68
    using RefCounted::ref;
69
    using RefCounted::ref;
69
    using RefCounted::deref;
70
    using RefCounted::deref;
- a/Source/WebCore/workers/service/ServiceWorkerContainer.cpp -1 / +3 lines
Lines 184-189 void ServiceWorkerContainer::addRegistration(const String& relativeScriptURL, co a/Source/WebCore/workers/service/ServiceWorkerContainer.cpp_sec1
184
184
185
    jobData.clientCreationURL = context->url();
185
    jobData.clientCreationURL = context->url();
186
    jobData.topOrigin = context->topOrigin().data();
186
    jobData.topOrigin = context->topOrigin().data();
187
    jobData.workerType = options.type;
187
    jobData.type = ServiceWorkerJobType::Register;
188
    jobData.type = ServiceWorkerJobType::Register;
188
    jobData.registrationOptions = options;
189
    jobData.registrationOptions = options;
189
190
Lines 205-211 void ServiceWorkerContainer::unregisterRegistration(ServiceWorkerRegistrationIde a/Source/WebCore/workers/service/ServiceWorkerContainer.cpp_sec2
205
    });
206
    });
206
}
207
}
207
208
208
void ServiceWorkerContainer::updateRegistration(const URL& scopeURL, const URL& scriptURL, WorkerType, RefPtr<DeferredPromise>&& promise)
209
void ServiceWorkerContainer::updateRegistration(const URL& scopeURL, const URL& scriptURL, WorkerType workerType, RefPtr<DeferredPromise>&& promise)
209
{
210
{
210
    ASSERT(!m_isStopped);
211
    ASSERT(!m_isStopped);
211
212
Lines 221-226 void ServiceWorkerContainer::updateRegistration(const URL& scopeURL, const URL& a/Source/WebCore/workers/service/ServiceWorkerContainer.cpp_sec3
221
    ServiceWorkerJobData jobData(m_swConnection->serverConnectionIdentifier(), contextIdentifier());
222
    ServiceWorkerJobData jobData(m_swConnection->serverConnectionIdentifier(), contextIdentifier());
222
    jobData.clientCreationURL = context.url();
223
    jobData.clientCreationURL = context.url();
223
    jobData.topOrigin = context.topOrigin().data();
224
    jobData.topOrigin = context.topOrigin().data();
225
    jobData.workerType = workerType;
224
    jobData.type = ServiceWorkerJobType::Update;
226
    jobData.type = ServiceWorkerJobType::Update;
225
    jobData.scopeURL = scopeURL;
227
    jobData.scopeURL = scopeURL;
226
    jobData.scriptURL = scriptURL;
228
    jobData.scriptURL = scriptURL;
- a/Source/WebCore/workers/service/ServiceWorkerJobData.cpp -1 / +2 lines
Lines 63-68 ServiceWorkerJobData ServiceWorkerJobData::isolatedCopy() const a/Source/WebCore/workers/service/ServiceWorkerJobData.cpp_sec1
63
    ServiceWorkerJobData result;
63
    ServiceWorkerJobData result;
64
    result.m_identifier = identifier();
64
    result.m_identifier = identifier();
65
    result.sourceContext = sourceContext;
65
    result.sourceContext = sourceContext;
66
    result.workerType = workerType;
66
    result.type = type;
67
    result.type = type;
67
68
68
    result.scriptURL = scriptURL.isolatedCopy();
69
    result.scriptURL = scriptURL.isolatedCopy();
Lines 85-91 bool ServiceWorkerJobData::isEquivalent(const ServiceWorkerJobData& job) const a/Source/WebCore/workers/service/ServiceWorkerJobData.cpp_sec2
85
    case ServiceWorkerJobType::Update:
86
    case ServiceWorkerJobType::Update:
86
        return scopeURL == job.scopeURL
87
        return scopeURL == job.scopeURL
87
            && scriptURL == job.scriptURL
88
            && scriptURL == job.scriptURL
88
            && registrationOptions.type == job.registrationOptions.type
89
            && workerType == job.workerType
89
            && registrationOptions.updateViaCache == job.registrationOptions.updateViaCache;
90
            && registrationOptions.updateViaCache == job.registrationOptions.updateViaCache;
90
    case ServiceWorkerJobType::Unregister:
91
    case ServiceWorkerJobType::Unregister:
91
        return scopeURL == job.scopeURL;
92
        return scopeURL == job.scopeURL;
- a/Source/WebCore/workers/service/ServiceWorkerJobData.h -1 / +4 lines
Lines 52-57 struct ServiceWorkerJobData { a/Source/WebCore/workers/service/ServiceWorkerJobData.h_sec1
52
    SecurityOriginData topOrigin;
52
    SecurityOriginData topOrigin;
53
    URL scopeURL;
53
    URL scopeURL;
54
    ServiceWorkerOrClientIdentifier sourceContext;
54
    ServiceWorkerOrClientIdentifier sourceContext;
55
    WorkerType workerType;
55
    ServiceWorkerJobType type;
56
    ServiceWorkerJobType type;
56
57
57
    ServiceWorkerRegistrationOptions registrationOptions;
58
    ServiceWorkerRegistrationOptions registrationOptions;
Lines 72-78 struct ServiceWorkerJobData { a/Source/WebCore/workers/service/ServiceWorkerJobData.h_sec2
72
template<class Encoder>
73
template<class Encoder>
73
void ServiceWorkerJobData::encode(Encoder& encoder) const
74
void ServiceWorkerJobData::encode(Encoder& encoder) const
74
{
75
{
75
    encoder << identifier() << scriptURL << clientCreationURL << topOrigin << scopeURL << sourceContext;
76
    encoder << identifier() << scriptURL << clientCreationURL << topOrigin << scopeURL << sourceContext << workerType;
76
    encoder << type;
77
    encoder << type;
77
    switch (type) {
78
    switch (type) {
78
    case ServiceWorkerJobType::Register:
79
    case ServiceWorkerJobType::Register:
Lines 110-115 Optional<ServiceWorkerJobData> ServiceWorkerJobData::decode(Decoder& decoder) a/Source/WebCore/workers/service/ServiceWorkerJobData.h_sec3
110
        return WTF::nullopt;
111
        return WTF::nullopt;
111
    if (!decoder.decode(jobData.sourceContext))
112
    if (!decoder.decode(jobData.sourceContext))
112
        return WTF::nullopt;
113
        return WTF::nullopt;
114
    if (!decoder.decode(jobData.workerType))
115
        return WTF::nullopt;
113
    if (!decoder.decode(jobData.type))
116
    if (!decoder.decode(jobData.type))
114
        return WTF::nullopt;
117
        return WTF::nullopt;
115
118
- a/Source/WebCore/workers/service/ServiceWorkerRegistration.cpp -2 / +1 lines
Lines 148-155 void ServiceWorkerRegistration::update(Ref<DeferredPromise>&& promise) a/Source/WebCore/workers/service/ServiceWorkerRegistration.cpp_sec1
148
        return;
148
        return;
149
    }
149
    }
150
150
151
    // FIXME: Support worker types.
151
    m_container->updateRegistration(m_registrationData.scopeURL, newestWorker->scriptURL(), newestWorker->workerType(), WTFMove(promise));
152
    m_container->updateRegistration(m_registrationData.scopeURL, newestWorker->scriptURL(), WorkerType::Classic, WTFMove(promise));
153
}
152
}
154
153
155
void ServiceWorkerRegistration::unregister(Ref<DeferredPromise>&& promise)
154
void ServiceWorkerRegistration::unregister(Ref<DeferredPromise>&& promise)
- a/Source/WebCore/workers/service/context/ServiceWorkerThread.cpp -3 / +1 lines
Lines 73-82 class DummyServiceWorkerThreadProxy : public WorkerObjectProxy { a/Source/WebCore/workers/service/context/ServiceWorkerThread.cpp_sec1
73
// FIXME: Use a valid WorkerObjectProxy
73
// FIXME: Use a valid WorkerObjectProxy
74
// FIXME: Use valid runtime flags
74
// FIXME: Use valid runtime flags
75
75
76
// FIXME: Support modules in service-workers.
77
// https://bugs.webkit.org/show_bug.cgi?id=222155
78
ServiceWorkerThread::ServiceWorkerThread(const ServiceWorkerContextData& data, String&& userAgent, const Settings::Values& settingsValues, WorkerLoaderProxy& loaderProxy, WorkerDebuggerProxy& debuggerProxy, IDBClient::IDBConnectionProxy* idbConnectionProxy, SocketProvider* socketProvider)
76
ServiceWorkerThread::ServiceWorkerThread(const ServiceWorkerContextData& data, String&& userAgent, const Settings::Values& settingsValues, WorkerLoaderProxy& loaderProxy, WorkerDebuggerProxy& debuggerProxy, IDBClient::IDBConnectionProxy* idbConnectionProxy, SocketProvider* socketProvider)
79
    : WorkerThread({ data.scriptURL, emptyString(), "serviceworker:" + Inspector::IdentifiersFactory::createIdentifier(), WTFMove(userAgent), platformStrategies()->loaderStrategy()->isOnLine(), data.contentSecurityPolicy, false, MonotonicTime::now(), { }, WorkerType::Classic, FetchRequestCredentials::SameOrigin, settingsValues }, data.script, loaderProxy, debuggerProxy, DummyServiceWorkerThreadProxy::shared(), WorkerThreadStartMode::Normal, data.registration.key.topOrigin().securityOrigin().get(), idbConnectionProxy, socketProvider, JSC::RuntimeFlags::createAllEnabled())
77
    : WorkerThread({ data.scriptURL, emptyString(), "serviceworker:" + Inspector::IdentifiersFactory::createIdentifier(), WTFMove(userAgent), platformStrategies()->loaderStrategy()->isOnLine(), data.contentSecurityPolicy, false, MonotonicTime::now(), { }, data.workerType, FetchRequestCredentials::Omit, settingsValues }, data.script, loaderProxy, debuggerProxy, DummyServiceWorkerThreadProxy::shared(), WorkerThreadStartMode::Normal, data.registration.key.topOrigin().securityOrigin().get(), idbConnectionProxy, socketProvider, JSC::RuntimeFlags::createAllEnabled())
80
    , m_data(data.isolatedCopy())
78
    , m_data(data.isolatedCopy())
81
    , m_workerObjectProxy(DummyServiceWorkerThreadProxy::shared())
79
    , m_workerObjectProxy(DummyServiceWorkerThreadProxy::shared())
82
    , m_heartBeatTimeout(SWContextManager::singleton().connection()->shouldUseShortTimeout() ? heartBeatTimeoutForTest : heartBeatTimeout)
80
    , m_heartBeatTimeout(SWContextManager::singleton().connection()->shouldUseShortTimeout() ? heartBeatTimeoutForTest : heartBeatTimeout)
- a/Source/WebCore/workers/service/server/SWServer.cpp +7 lines
Lines 1095-1104 bool SWServer::canHandleScheme(StringView scheme) const a/Source/WebCore/workers/service/server/SWServer.cpp_sec1
1095
// https://w3c.github.io/ServiceWorker/#soft-update
1095
// https://w3c.github.io/ServiceWorker/#soft-update
1096
void SWServer::softUpdate(SWServerRegistration& registration)
1096
void SWServer::softUpdate(SWServerRegistration& registration)
1097
{
1097
{
1098
    // Let newestWorker be the result of running Get Newest Worker algorithm passing registration as its argument.
1099
    // If newestWorker is null, abort these steps.
1100
    auto* newestWorker = registration.getNewestWorker();
1101
    if (!newestWorker)
1102
        return;
1103
1098
    ServiceWorkerJobData jobData(Process::identifier(), ServiceWorkerIdentifier::generate());
1104
    ServiceWorkerJobData jobData(Process::identifier(), ServiceWorkerIdentifier::generate());
1099
    jobData.scriptURL = registration.scriptURL();
1105
    jobData.scriptURL = registration.scriptURL();
1100
    jobData.topOrigin = registration.key().topOrigin();
1106
    jobData.topOrigin = registration.key().topOrigin();
1101
    jobData.scopeURL = registration.scopeURLWithoutFragment();
1107
    jobData.scopeURL = registration.scopeURLWithoutFragment();
1108
    jobData.workerType = newestWorker->type();
1102
    jobData.type = ServiceWorkerJobType::Update;
1109
    jobData.type = ServiceWorkerJobType::Update;
1103
    scheduleJob(WTFMove(jobData));
1110
    scheduleJob(WTFMove(jobData));
1104
}
1111
}
- a/Source/WebCore/workers/service/server/SWServerJobQueue.cpp -5 / +4 lines
Lines 100-106 void SWServerJobQueue::scriptFetchFinished(const ServiceWorkerFetchResult& resul a/Source/WebCore/workers/service/server/SWServerJobQueue.cpp_sec1
100
    // If newestWorker is not null, newestWorker's script url equals job's script url with the exclude fragments
100
    // If newestWorker is not null, newestWorker's script url equals job's script url with the exclude fragments
101
    // flag set, and script's source text is a byte-for-byte match with newestWorker's script resource's source
101
    // flag set, and script's source text is a byte-for-byte match with newestWorker's script resource's source
102
    // text, then:
102
    // text, then:
103
    if (newestWorker && equalIgnoringFragmentIdentifier(newestWorker->scriptURL(), job.scriptURL) && result.script == newestWorker->script() && doCertificatesMatch(result.certificateInfo, newestWorker->certificateInfo())) {
103
    if (newestWorker && equalIgnoringFragmentIdentifier(newestWorker->scriptURL(), job.scriptURL) && newestWorker->type() == job.workerType && result.script == newestWorker->script() && doCertificatesMatch(result.certificateInfo, newestWorker->certificateInfo())) {
104
        RELEASE_LOG(ServiceWorker, "%p - SWServerJobQueue::scriptFetchFinished, script and certificate are matching for registrationID=%llu", this, registration->identifier().toUInt64());
104
        RELEASE_LOG(ServiceWorker, "%p - SWServerJobQueue::scriptFetchFinished, script and certificate are matching for registrationID=%llu", this, registration->identifier().toUInt64());
105
        // FIXME: for non classic scripts, check the script’s module record's [[ECMAScriptCode]].
105
        // FIXME: for non classic scripts, check the script’s module record's [[ECMAScriptCode]].
106
106
Lines 114-121 void SWServerJobQueue::scriptFetchFinished(const ServiceWorkerFetchResult& resul a/Source/WebCore/workers/service/server/SWServerJobQueue.cpp_sec2
114
114
115
    // FIXME: Update all the imported scripts as per spec. For now, we just do as if there is none.
115
    // FIXME: Update all the imported scripts as per spec. For now, we just do as if there is none.
116
116
117
    // FIXME: Support the proper worker type (classic vs module)
117
    m_server.updateWorker(job.identifier(), *registration, job.scriptURL, result.script, result.certificateInfo, result.contentSecurityPolicy, result.referrerPolicy, job.workerType, { });
118
    m_server.updateWorker(job.identifier(), *registration, job.scriptURL, result.script, result.certificateInfo, result.contentSecurityPolicy, result.referrerPolicy, WorkerType::Classic, { });
119
}
118
}
120
119
121
// https://w3c.github.io/ServiceWorker/#update-algorithm
120
// https://w3c.github.io/ServiceWorker/#update-algorithm
Lines 287-293 void SWServerJobQueue::runRegisterJob(const ServiceWorkerJobData& job) a/Source/WebCore/workers/service/server/SWServerJobQueue.cpp_sec3
287
    // If registration is not null (in our parlance "empty"), then:
286
    // If registration is not null (in our parlance "empty"), then:
288
    if (auto* registration = m_server.getRegistration(m_registrationKey)) {
287
    if (auto* registration = m_server.getRegistration(m_registrationKey)) {
289
        auto* newestWorker = registration->getNewestWorker();
288
        auto* newestWorker = registration->getNewestWorker();
290
        if (newestWorker && equalIgnoringFragmentIdentifier(job.scriptURL, newestWorker->scriptURL()) && job.registrationOptions.updateViaCache == registration->updateViaCache()) {
289
        if (newestWorker && equalIgnoringFragmentIdentifier(job.scriptURL, newestWorker->scriptURL()) && job.workerType == newestWorker->type() && job.registrationOptions.updateViaCache == registration->updateViaCache()) {
291
            RELEASE_LOG(ServiceWorker, "%p - SWServerJobQueue::runRegisterJob: Found directly reusable registration %llu for job %s (DONE)", this, registration->identifier().toUInt64(), job.identifier().loggingString().utf8().data());
290
            RELEASE_LOG(ServiceWorker, "%p - SWServerJobQueue::runRegisterJob: Found directly reusable registration %llu for job %s (DONE)", this, registration->identifier().toUInt64(), job.identifier().loggingString().utf8().data());
292
            m_server.resolveRegistrationJob(job, registration->data(), ShouldNotifyWhenResolved::No);
291
            m_server.resolveRegistrationJob(job, registration->data(), ShouldNotifyWhenResolved::No);
293
            finishCurrentJob();
292
            finishCurrentJob();
Lines 350-356 void SWServerJobQueue::runUpdateJob(const ServiceWorkerJobData& job) a/Source/WebCore/workers/service/server/SWServerJobQueue.cpp_sec4
350
    auto* newestWorker = registration->getNewestWorker();
349
    auto* newestWorker = registration->getNewestWorker();
351
350
352
    // If job's type is update, and newestWorker's script url does not equal job's script url with the exclude fragments flag set, then:
351
    // If job's type is update, and newestWorker's script url does not equal job's script url with the exclude fragments flag set, then:
353
    if (job.type == ServiceWorkerJobType::Update && newestWorker && !equalIgnoringFragmentIdentifier(job.scriptURL, newestWorker->scriptURL()))
352
    if (job.type == ServiceWorkerJobType::Update && newestWorker && (!equalIgnoringFragmentIdentifier(job.scriptURL, newestWorker->scriptURL()) || job.workerType != newestWorker->type()))
354
        return rejectCurrentJob(ExceptionData { TypeError, "Cannot update a service worker with a requested script URL whose newest worker has a different script URL"_s });
353
        return rejectCurrentJob(ExceptionData { TypeError, "Cannot update a service worker with a requested script URL whose newest worker has a different script URL"_s });
355
354
356
    // Set request's cache mode to "no-cache" if any of the following are true:
355
    // Set request's cache mode to "no-cache" if any of the following are true:
- a/LayoutTests/imported/w3c/ChangeLog +15 lines
Lines 1-3 a/LayoutTests/imported/w3c/ChangeLog_sec1
1
2021-02-20  Yusuke Suzuki  <ysuzuki@apple.com>
2
3
        Support modules in service workers
4
        https://bugs.webkit.org/show_bug.cgi?id=222155
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        * web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/json-module-service-worker-test.https.tentative-expected.txt:
9
        * web-platform-tests/service-workers/service-worker/clients-matchall-client-types.https-expected.txt:
10
        * web-platform-tests/service-workers/service-worker/import-module-scripts.https-expected.txt:
11
        * web-platform-tests/service-workers/service-worker/performance-timeline.https-expected.txt:
12
        * web-platform-tests/service-workers/service-worker/update-registration-with-type.https-expected.txt:
13
        * web-platform-tests/service-workers/service-worker/update.https-expected.txt:
14
        * web-platform-tests/service-workers/service-worker/worker-client-id.https-expected.txt:
15
1
2021-02-19  Yusuke Suzuki  <ysuzuki@apple.com>
16
2021-02-19  Yusuke Suzuki  <ysuzuki@apple.com>
2
17
3
        JS Modules in Workers
18
        JS Modules in Workers
- a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/json-module-service-worker-test.https.tentative-expected.txt -1 / +1 lines
Lines 1-5 a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/json-module-service-worker-test.https.tentative-expected.txt_sec1
1
1
2
FAIL Javascript importing JSON Module should load within the context of a service worker promise_test: Unhandled rejection with value: object "TypeError: SyntaxError: Unexpected string literal './module.json'. import call expects exactly one argument."
2
FAIL Javascript importing JSON Module should load within the context of a service worker promise_test: Unhandled rejection with value: object "TypeError: TypeError: 'application/json' is not a valid JavaScript MIME type."
3
FAIL JSON Modules should load within the context of a service worker promise_test: Unhandled rejection with value: object "SecurityError: MIME Type is not a JavaScript MIME type"
3
FAIL JSON Modules should load within the context of a service worker promise_test: Unhandled rejection with value: object "SecurityError: MIME Type is not a JavaScript MIME type"
4
PASS JSON Module dynamic import should not load within the context of a service worker
4
PASS JSON Module dynamic import should not load within the context of a service worker
5
5
- a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-matchall-client-types.https-expected.txt -1 lines
Lines 1-5 a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-matchall-client-types.https-expected.txt_sec1
1
1
2
3
PASS Verify matchAll() with window client type
2
PASS Verify matchAll() with window client type
4
FAIL Verify matchAll() with {window, sharedworker, worker} client types promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: SharedWorker"
3
FAIL Verify matchAll() with {window, sharedworker, worker} client types promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: SharedWorker"
5
4
- a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/import-module-scripts.https-expected.txt -3 / +3 lines
Lines 1-7 a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/import-module-scripts.https-expected.txt_sec1
1
1
2
FAIL Static import. promise_test: Unhandled rejection with value: object "TypeError: SyntaxError: Unexpected token '*'. import call expects exactly one argument."
2
PASS Static import.
3
FAIL Nested static import. promise_test: Unhandled rejection with value: object "TypeError: SyntaxError: Unexpected token '*'. import call expects exactly one argument."
3
PASS Nested static import.
4
FAIL Static import and then dynamic import. promise_test: Unhandled rejection with value: object "TypeError: SyntaxError: Unexpected token '*'. import call expects exactly one argument."
4
PASS Static import and then dynamic import.
5
PASS Dynamic import.
5
PASS Dynamic import.
6
PASS Nested dynamic import.
6
PASS Nested dynamic import.
7
PASS Dynamic import and then static import.
7
PASS Dynamic import and then static import.
- a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/performance-timeline.https-expected.txt -2 / +2 lines
Lines 1-7 a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/performance-timeline.https-expected.txt_sec1
1
1
2
2
3
PASS Test Performance Timeline API in Service Worker
3
PASS Test Performance Timeline API in Service Worker
4
FAIL empty service worker fetch event included in performance timings assert_greater_than: Slow service worker request should measure increased delay. expected a number greater than 1012 but got 12
4
FAIL empty service worker fetch event included in performance timings assert_greater_than: Slow service worker request should measure increased delay. expected a number greater than 1174 but got 111
5
PASS User Timing
5
PASS User Timing
6
FAIL Resource Timing assert_equals: expected 2 but got 1
6
PASS Resource Timing
7
7
- a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-registration-with-type.https-expected.txt -4 / +4 lines
Lines 1-9 a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-registration-with-type.https-expected.txt_sec1
1
1
2
FAIL Update the registration with a different script type (classic => module). promise_test: Unhandled rejection with value: object "TypeError: null is not an object (evaluating 'secondWorker.postMessage')"
2
PASS Update the registration with a different script type (classic => module).
3
FAIL Update the registration with a different script type (module => classic). promise_test: Unhandled rejection with value: object "TypeError: SyntaxError: Unexpected token '*'. import call expects exactly one argument."
3
PASS Update the registration with a different script type (module => classic).
4
PASS Update the registration with a different script type (classic => module) and with a same main script.
4
PASS Update the registration with a different script type (classic => module) and with a same main script.
5
PASS Update the registration with a different script type (module => classic) and with a same main script.
5
PASS Update the registration with a different script type (module => classic) and with a same main script.
6
PASS Does not update the registration with the same script type and the same main script.
6
PASS Does not update the registration with the same script type and the same main script.
7
FAIL Update the registration with a different script type (classic => module) and with a same main script. Expect evaluation failed. assert_unreached: Should have rejected: Registering with invalid evaluation should be failed. Reached unreachable code
7
PASS Update the registration with a different script type (classic => module) and with a same main script. Expect evaluation failed.
8
FAIL Update the registration with a different script type (module => classic) and with a same main script. Expect evaluation failed. promise_test: Unhandled rejection with value: object "TypeError: SyntaxError: Unexpected token '*'. import call expects exactly one argument."
8
PASS Update the registration with a different script type (module => classic) and with a same main script. Expect evaluation failed.
9
9
- a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update.https-expected.txt -1 / +3 lines
Lines 1-7 a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update.https-expected.txt_sec1
1
1
2
PASS update() should succeed when new script is available.
2
PASS update() should succeed when new script is available.
3
PASS update() should fail when mime type is invalid.
3
PASS update() should fail when mime type is invalid.
4
FAIL update() should fail when a response for the main script is redirect. assert_throws: function "function () { throw e }" threw object "SecurityError: Script https://localhost:9443/service-workers/service-worker/resources/update-worker.py?Key=53187c6b-e588-48ee-ad9b-272fe38aa9b8&Mode=redirect load failed" ("SecurityError") expected object "TypeError" ("TypeError")
4
FAIL update() should fail when a response for the main script is redirect. promise_rejects_js: function "function () { throw e }" threw object "SecurityError: Script https://localhost:9443/service-workers/service-worker/resources/update-worker.py?Key=52943ca3-56b3-4ba5-a1c9-13ed8114fcff&Mode=redirect load failed" ("SecurityError") expected instance of function "function TypeError() {
5
    [native code]
6
}" ("TypeError")
5
PASS update() should fail when a new script contains a syntax error.
7
PASS update() should fail when a new script contains a syntax error.
6
PASS update() should resolve when the install event throws.
8
PASS update() should resolve when the install event throws.
7
PASS update() should fail when the pending uninstall flag is set.
9
PASS update() should fail when the pending uninstall flag is set.
- a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/worker-client-id.https-expected.txt -1 / +1 lines
Lines 1-3 a/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/worker-client-id.https-expected.txt_sec1
1
1
2
FAIL Verify workers have a unique client id separate from their owning documents window assert_not_equals: frame and worker client ids should be different got disallowed value "102-1083"
2
FAIL Verify workers have a unique client id separate from their owning documents window assert_not_equals: frame and worker client ids should be different got disallowed value "11-530"
3
3

Return to Bug 222155