New issue
Advanced search Search tips

Issue 702352 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

Blocking:
issue 678905



Sign in to add a comment

ExtendableMessageEvent defaults to incorrect `ports` value

Reported by m...@mikepennisi.com, Mar 16 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/56.0.2924.76 Chrome/56.0.2924.76 Safari/537.36

Steps to reproduce the problem:
1. Execute the following code in the context of a service worker:

       new ExtendableMessageEvent('name').ports;

What is the expected behavior?
The expression should evaluate to an Array of length 0

What went wrong?
The expression evaluates to `null`

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 58.0.3029.19  Channel: dev
OS Version: 
Flash Version: 

According to the WebIDL definition [1], the default value of this property
should be an empty array. The same behavior is observable when an
`eventInitDict` without a `ports` property is specified and when the dictionary
specifies the value `undefined` for `ports`:

       new ExtendableMessageEvent('name', {}).ports;
       new ExtendableMessageEvent('name', { ports: undefined }).ports;

[1] https://w3c.github.io/ServiceWorker/#extendablemessageevent-interface

> # 4.8. ExtendableMessageEvent
>
>     dictionary ExtendableMessageEventInit : ExtendableEventInit {
>       any data = null;
>       USVString origin = "";
>       DOMString lastEventId = "";
>       (Client or ServiceWorker or MessagePort)? source = null;
>       sequence<MessagePort> ports = [];
>     };
 
The project currently includes an invalid test that asserts the incorrect
behavior as "expected" [1]. I am currently working to migrate these tests to
the Web Platform Tests project (as per [2]); I am correcting this test and
blacklisting it in the process, see [3].

[1] https://cs.chromium.org/chromium/src/third_party/WebKit/LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/resources/extendable-message-event-constructor-worker.js?sq&l=25
[2] https://bugs.chromium.org/p/chromium/issues/detail?id=688116&desc=2
[3] https://codereview.chromium.org/2751113005/

Comment 2 by ajha@chromium.org, Mar 17 2017

Labels: TE-NeedsTriageHelp

Comment 3 by falken@chromium.org, Mar 17 2017

Blocking: 678905
Status: Available (was: Unconfirmed)

Comment 4 by falken@chromium.org, Mar 17 2017

Labels: -OS-Linux -TE-NeedsTriageHelp OS-All
Project Member

Comment 5 by bugdroid1@chromium.org, Mar 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7d998666c33c0eaaf9c6b2fa874644c1c03f31fc

commit 7d998666c33c0eaaf9c6b2fa874644c1c03f31fc
Author: mike <mike@mikepennisi.com>
Date: Thu Mar 23 16:00:13 2017

Upstream service worker message event tests to WPT

This patch corrects invalid assertions relating to the `ports` property
described by the ExtendableMessageEvent API (see  crbug.com/702352  and
 crbug.com/702361 ). It also re-formats the tests to improve test precision (by
reducing reliance on the `toString` operation) and more closely align with the
patterns used within the Web Platform Tests project.

BUG= 688116 , 702352 , 702361 
R=falken@chromium.org

Review-Url: https://codereview.chromium.org/2751113005
Cr-Commit-Position: refs/heads/master@{#459099}

[add] https://crrev.com/7d998666c33c0eaaf9c6b2fa874644c1c03f31fc/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/ServiceWorkerGlobalScope/extendable-message-event-constructor.https-expected.txt
[add] https://crrev.com/7d998666c33c0eaaf9c6b2fa874644c1c03f31fc/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/ServiceWorkerGlobalScope/extendable-message-event-constructor.https.html
[add] https://crrev.com/7d998666c33c0eaaf9c6b2fa874644c1c03f31fc/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/ServiceWorkerGlobalScope/extendable-message-event.https.html
[add] https://crrev.com/7d998666c33c0eaaf9c6b2fa874644c1c03f31fc/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/ServiceWorkerGlobalScope/resources/extendable-message-event-constructor-worker.js
[add] https://crrev.com/7d998666c33c0eaaf9c6b2fa874644c1c03f31fc/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/ServiceWorkerGlobalScope/resources/extendable-message-event-loopback-worker.js
[rename] https://crrev.com/7d998666c33c0eaaf9c6b2fa874644c1c03f31fc/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/ServiceWorkerGlobalScope/resources/extendable-message-event-ping-worker.js
[add] https://crrev.com/7d998666c33c0eaaf9c6b2fa874644c1c03f31fc/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/ServiceWorkerGlobalScope/resources/extendable-message-event-pong-worker.js
[add] https://crrev.com/7d998666c33c0eaaf9c6b2fa874644c1c03f31fc/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/ServiceWorkerGlobalScope/resources/extendable-message-event-utils.js
[add] https://crrev.com/7d998666c33c0eaaf9c6b2fa874644c1c03f31fc/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/ServiceWorkerGlobalScope/resources/extendable-message-event-worker.js
[delete] https://crrev.com/f57859facd3f9b3468693cb4869a4566c6624eb1/third_party/WebKit/LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/extendable-message-event.html
[delete] https://crrev.com/f57859facd3f9b3468693cb4869a4566c6624eb1/third_party/WebKit/LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/resources/extendable-message-event-constructor-worker.js
[delete] https://crrev.com/f57859facd3f9b3468693cb4869a4566c6624eb1/third_party/WebKit/LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/resources/extendable-message-event-loopback-worker.js
[delete] https://crrev.com/f57859facd3f9b3468693cb4869a4566c6624eb1/third_party/WebKit/LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/resources/extendable-message-event-pong-worker.js
[delete] https://crrev.com/f57859facd3f9b3468693cb4869a4566c6624eb1/third_party/WebKit/LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/resources/extendable-message-event-worker.js

Comment 6 by leon....@intel.com, May 24 2017

Owner: leon....@intel.com
Status: Started (was: Available)
Project Member

Comment 7 by bugdroid1@chromium.org, May 25 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2b468e6409c8077f9588eaadd33fa3c493bcaebf

commit 2b468e6409c8077f9588eaadd33fa3c493bcaebf
Author: leon.han <leon.han@intel.com>
Date: Thu May 25 02:25:01 2017

[ServiceWorker] Fix ExtendableMessageEvent idl binding

Spec:
https://w3c.github.io/ServiceWorker/#extendablemessageevent-interface

ExtendableMessageEventInit.ports should NOT allow null,
ExtendableMessageEvent.ports should be empty array by default.

BUG= 702352 ,  702361 
TEST=blink_tests
external/wpt/service-workers/service-worker/ServiceWorkerGlobalScope/extendable-message-event-constructor.https.html

Review-Url: https://codereview.chromium.org/2904563004
Cr-Commit-Position: refs/heads/master@{#474528}

[delete] https://crrev.com/7a6de50a928be5382714446119f704df13973205/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/ServiceWorkerGlobalScope/extendable-message-event-constructor.https-expected.txt
[modify] https://crrev.com/2b468e6409c8077f9588eaadd33fa3c493bcaebf/third_party/WebKit/Source/modules/serviceworkers/ExtendableMessageEvent.cpp
[modify] https://crrev.com/2b468e6409c8077f9588eaadd33fa3c493bcaebf/third_party/WebKit/Source/modules/serviceworkers/ExtendableMessageEvent.h
[modify] https://crrev.com/2b468e6409c8077f9588eaadd33fa3c493bcaebf/third_party/WebKit/Source/modules/serviceworkers/ExtendableMessageEvent.idl
[modify] https://crrev.com/2b468e6409c8077f9588eaadd33fa3c493bcaebf/third_party/WebKit/Source/modules/serviceworkers/ExtendableMessageEventInit.idl

Comment 8 by leon....@intel.com, May 26 2017

Status: Fixed (was: Started)

Comment 9 by falken@chromium.org, May 29 2017

Labels: M-60

Sign in to add a comment