Bug 178976

Summary: self.ExtendableEvent / Client / Clients / WindowClient do not exist in a Service Worker
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebCore Misc.Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: beidson, buildbot, commit-queue, esprehn+autocc, ggaren, kondapallykalyan, sam, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from ews126 for ios-simulator-wk2
none
Patch none

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>