Bug 178976 - self.ExtendableEvent / Client / Clients / WindowClient do not exist in a Service Worker
Summary: self.ExtendableEvent / Client / Clients / WindowClient do not exist in a Serv...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-10-27 21:06 PDT by Chris Dumez
Modified: 2017-11-15 12:35 PST (History)
9 users (show)

See Also:


Attachments
Patch (8.75 KB, patch)
2017-10-27 21:11 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews126 for ios-simulator-wk2 (1.08 MB, application/zip)
2017-10-27 23:56 PDT, Build Bot
no flags Details
Patch (9.78 KB, patch)
2017-10-28 10:04 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2017-10-27 21:06:18 PDT
self.ExtendableEvent / Client / Clients / WindowClient do not exist in a Service Worker.
Comment 1 Chris Dumez 2017-10-27 21:11:29 PDT
Created attachment 325239 [details]
Patch
Comment 2 Build Bot 2017-10-27 23:56:49 PDT
Comment on attachment 325239 [details]
Patch

Attachment 325239 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/5020644

New failing tests:
http/tests/workers/service/ServiceWorkerGlobalScope-properties.html
Comment 3 Build Bot 2017-10-27 23:56:50 PDT
Created attachment 325251 [details]
Archive of layout-test-results from ews126 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews126  Port: ios-simulator-wk2  Platform: Mac OS X 10.12.6
Comment 4 Sam Weinig 2017-10-28 07:07:41 PDT
Comment on attachment 325239 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=325239&action=review

> LayoutTests/http/tests/workers/service/resources/ServiceWorkerGlobalScope-properties-worker.js:9
> +self.addEventListener("message", (event) => {
> +    if (event.data === "LIST") {
> +        let properties = Object.getOwnPropertyNames(self);
> +        properties.sort()
> +        for (let p of properties)
> +            event.source.postMessage(p);
> +        event.source.postMessage("DONE");
> +    }
> +});

I'm not a big fan of this type of test, as it tends to be hard to keep one set of expected results as some platforms enable some features (I recently removed a similar set of tests for windows).  Can we have a more targeted test, rather than one that iterates all of the global object?
Comment 5 Sam Weinig 2017-10-28 07:08:37 PDT
Comment on attachment 325239 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=325239&action=review

>> LayoutTests/http/tests/workers/service/resources/ServiceWorkerGlobalScope-properties-worker.js:9
>> +self.addEventListener("message", (event) => {
>> +    if (event.data === "LIST") {
>> +        let properties = Object.getOwnPropertyNames(self);
>> +        properties.sort()
>> +        for (let p of properties)
>> +            event.source.postMessage(p);
>> +        event.source.postMessage("DONE");
>> +    }
>> +});
> 
> I'm not a big fan of this type of test, as it tends to be hard to keep one set of expected results as some platforms enable some features (I recently removed a similar set of tests for windows).  Can we have a more targeted test, rather than one that iterates all of the global object?

I'm not a big fan of this type of test, as it tends to be hard to keep one set of expected results as some platforms enable some features (I recently removed a similar set of tests for windows).  Can we have a more targeted test, rather than one that iterates all of the global object?
Comment 6 Chris Dumez 2017-10-28 09:27:49 PDT
(In reply to Sam Weinig from comment #5)
> Comment on attachment 325239 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=325239&action=review
> 
> >> LayoutTests/http/tests/workers/service/resources/ServiceWorkerGlobalScope-properties-worker.js:9
> >> +self.addEventListener("message", (event) => {
> >> +    if (event.data === "LIST") {
> >> +        let properties = Object.getOwnPropertyNames(self);
> >> +        properties.sort()
> >> +        for (let p of properties)
> >> +            event.source.postMessage(p);
> >> +        event.source.postMessage("DONE");
> >> +    }
> >> +});
> > 
> > I'm not a big fan of this type of test, as it tends to be hard to keep one set of expected results as some platforms enable some features (I recently removed a similar set of tests for windows).  Can we have a more targeted test, rather than one that iterates all of the global object?
> 
> I'm not a big fan of this type of test, as it tends to be hard to keep one
> set of expected results as some platforms enable some features (I recently
> removed a similar set of tests for windows).  Can we have a more targeted
> test, rather than one that iterates all of the global object?

Sure, I can make one that is more targeted.
Comment 7 Chris Dumez 2017-10-28 10:04:17 PDT
Created attachment 325263 [details]
Patch
Comment 8 Chris Dumez 2017-10-28 10:04:50 PDT
Comment on attachment 325263 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=325263&action=review

> LayoutTests/http/tests/workers/service/ServiceWorkerGlobalScope-properties-expected.txt:8
> +Object.getOwnPropertyDescriptor(self, 'ExtendableMessageEvent') returned {"writable":true,"enumerable":false,"configurable":true}

More targeted testing.
Comment 9 WebKit Commit Bot 2017-10-28 10:40:58 PDT
Comment on attachment 325263 [details]
Patch

Clearing flags on attachment: 325263

Committed r224153: <https://trac.webkit.org/changeset/224153>
Comment 10 WebKit Commit Bot 2017-10-28 10:40:59 PDT
All reviewed patches have been landed.  Closing bug.
Comment 11 Radar WebKit Bug Importer 2017-11-15 12:35:09 PST
<rdar://problem/35567819>