WPT /encrypted-media/idlharness.html fails with wrong value for MediaKeyMessageEvent.length expected 0 but got 1

RESOLVED FIXED in Firefox 52

Status

()

Core
DOM: Core & HTML
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: cpearce, Assigned: cpearce)

Tracking

(Blocks: 1 bug)

unspecified
mozilla52
Points:
---

Firefox Tracking Flags

(firefox52 fixed)

Details

(URL)

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Assignee)

Description

a year ago
If you run http://w3c-test.org/encrypted-media/idlharness.html in Nightly, it fails on 1 case with:

Fail
MediaKeyMessageEvent interface object length
assert_equals: wrong value for MediaKeyMessageEvent.length expected 0 but got 1

IdlInterface.prototype.test_self/<@http://web-platform.test:8000/resources/idlharness.js:876:13
Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:1401:20
test@http://web-platform.test:8000/resources/testharness.js:501:9
IdlInterface.prototype.test_self@http://web-platform.test:8000/resources/idlharness.js:854:9
IdlInterface.prototype.test@http://web-platform.test:8000/resources/idlharness.js:731:9
IdlArray.prototype.test@http://web-platform.test:8000/resources/idlharness.js:398:9
@http://web-platform.test:8000/encrypted-media/idlharness.html:42:17
Async*@http://web-platform.test:8000/encrypted-media/idlharness.html:25:13
Tests.prototype.setup@http://web-platform.test:8000/resources/testharness.js:1786:17
setup@http://web-platform.test:8000/resources/testharness.js:632:9
@http://web-platform.test:8000/encrypted-media/idlharness.html:23:9

The tests on MediaEncryptedEvent are passing, so I don't understand why MediaKeyMessageEvent would fail.

Maybe this is a problem with the WebIDL codegen?
(Assignee)

Comment 1

a year ago
bz/smaug: Any idea what's going on here?
Flags: needinfo?(bzbarsky)
Flags: needinfo?(bugs)
> assert_equals: wrong value for MediaKeyMessageEvent.length expected 0 but got 1

Er... I'm seeing:

  assert_equals: wrong value for MediaKeyMessageEvent.length expected 2 but got 1

In any case, our IDL here is:

  [Constructor(DOMString type, optional MediaKeyMessageEventInit eventInitDict)]
  interface MediaKeyMessageEvent : Event {

and the test's IDL (from <http://w3c-test.org/encrypted-media/EncryptedMediaExtensions.idl>) is:

  [Constructor(DOMString type, MediaKeyMessageEventInit eventInitDict)]
  interface MediaKeyMessageEvent : Event {

note the difference in the second argument.  The IDL in the spec draft, at <http://w3c.github.io/encrypted-media/#mediakeymessageevent> is:

  [SecureContext,
   Constructor(DOMString type, MediaKeyMessageEventInit eventInitDict)]
  interface MediaKeyMessageEvent : Event {

so the test matches the spec and our IDL does not.  The IDL we have for the MediaKeyMessageEventInit itself also differs from the spec.  We have:

  dictionary MediaKeyMessageEventInit : EventInit {
    MediaKeyMessageType messageType = "license-request";
    ArrayBuffer message;
  };

and the spec draft has:

  dictionary MediaKeyMessageEventInit : EventInit {
    required MediaKeyMessageType messageType;
    required ArrayBuffer         message;
  };

Note that this means we accept inputs that per current spec draft should throw, like:

  { message: someArrayBuffer }

for this dictionary....  Presumably the spec draft has changed since we originally implemented it?
Flags: needinfo?(bzbarsky)
Flags: needinfo?(bugs)
Flags: needinfo?(cpearce)
(Assignee)

Comment 3

a year ago
That is indeed it. Thanks for lending your eyes!
Flags: needinfo?(cpearce)
Comment hidden (mozreview-request)

Comment 5

a year ago
mozreview-review
Comment on attachment 8802415 [details]
Bug 1311252 - Make MediaKeyMessageEvent.webidl patch spec.

https://reviewboard.mozilla.org/r/86812/#review85882

Why not fix the test to follow the spec?

::: testing/web-platform/meta/encrypted-media/idlharness.html.ini:3
(Diff revision 1)
> +[idlharness.html]
> +  type: testharness
> +  [MediaKeyMessageEvent interface object length]

Ah, the idl in the test isn't following the spec yet.
Attachment #8802415 - Flags: review?(bugs) → review+
> Unfortunately our local copy is out of date

Just change our local copy to match the upstream copy?  What's the drawback of doing that?
Please don't use "mark it disabled" if you mean "mark it as failing"; those mean significantly different things.

It might not be possible to make the test pass without changing idlharness.js to support required dictionaries; if so, please file an issue (or a PR!) on <https://github.com/w3c/testharness.js>.
The test is clearly correctly supporting/using required dictionaries as deployed on the w3c server.  So that's not an issue.
(Assignee)

Comment 9

a year ago
OK. I'll update EncryptedMediaExtensions.idl to match upstream.
Comment hidden (mozreview-request)

Comment 11

a year ago
Pushed by cpearce@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/38a2c93c7c84
Make MediaKeyMessageEvent.webidl patch spec. r=smaug
Backed out for failing mochitest test_all_synthetic_events.html:

https://hg.mozilla.org/integration/autoland/rev/39b93a343b1be0e8214be4beb0df0b9903d273cb

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=38a2c93c7c844e18a3d255b4ce1d1dad43e630fc
Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=5347294&repo=autoland

[task 2016-10-19T21:24:29.709906Z] 21:24:29     INFO -  1604 INFO TEST-PASS | dom/events/test/test_all_synthetic_events.html | Creating TimeEvent...
[task 2016-10-19T21:24:29.711468Z] 21:24:29     INFO -  1605 INFO TEST-PASS | dom/events/test/test_all_synthetic_events.html | Creating HashChangeEvent...
[task 2016-10-19T21:24:29.713237Z] 21:24:29     INFO -  1606 INFO TEST-PASS | dom/events/test/test_all_synthetic_events.html | Creating DeviceOrientationEvent...
[task 2016-10-19T21:24:29.715964Z] 21:24:29     INFO -  1607 INFO TEST-PASS | dom/events/test/test_all_synthetic_events.html | Creating ScrollAreaEvent...
[task 2016-10-19T21:24:29.717559Z] 21:24:29     INFO -  1608 INFO TEST-PASS | dom/events/test/test_all_synthetic_events.html | Creating CommandEvent...
[task 2016-10-19T21:24:29.719087Z] 21:24:29     INFO -  1609 INFO TEST-PASS | dom/events/test/test_all_synthetic_events.html | Creating ProgressEvent...
[task 2016-10-19T21:24:29.721113Z] 21:24:29     INFO -  1610 INFO TEST-PASS | dom/events/test/test_all_synthetic_events.html | Creating GamepadButtonEvent...
[task 2016-10-19T21:24:29.723686Z] 21:24:29     INFO -  1611 INFO TEST-PASS | dom/events/test/test_all_synthetic_events.html | Creating ErrorEvent...
[task 2016-10-19T21:24:29.725378Z] 21:24:29     INFO -  1612 INFO TEST-PASS | dom/events/test/test_all_synthetic_events.html | Creating AnimationEvent...
[task 2016-10-19T21:24:29.727385Z] 21:24:29     INFO -  1613 INFO TEST-PASS | dom/events/test/test_all_synthetic_events.html | Creating MediaKeyMessageEvent...
[task 2016-10-19T21:24:29.729522Z] 21:24:29     INFO -  1614 INFO TEST-UNEXPECTED-FAIL | dom/events/test/test_all_synthetic_events.html | uncaught exception - TypeError: Missing required 'message' member of MediaKeyMessageEventInit. at kEventConstructors.MediaKeyMessageEvent.create@http://mochi.test:8888/tests/dom/events/test/test_all_synthetic_events.html:279:65
[task 2016-10-19T21:24:29.731569Z] 21:24:29     INFO -  @http://mochi.test:8888/tests/dom/events/test/test_all_synthetic_events.html:586:15
[task 2016-10-19T21:24:29.733372Z] 21:24:29     INFO -      simpletestOnerror@SimpleTest/SimpleTest.js:1582:11
[task 2016-10-19T21:24:29.736206Z] 21:24:29     INFO -      OnErrorEventHandlerNonNull*@SimpleTest/SimpleTest.js:1562:1
[task 2016-10-19T21:24:29.737982Z] 21:24:29     INFO -  JavaScript error: http://mochi.test:8888/tests/dom/events/test/test_all_synthetic_events.html, line 279: TypeError: Missing required 'message' member of MediaKeyMessageEventInit.
Flags: needinfo?(cpearce)
(Assignee)

Comment 13

a year ago
Will need to add dummy dictionary values for the required dict fields in order to pass the test.
Flags: needinfo?(cpearce)
Assignee: nobody → cpearce

Comment 15

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/5ac0f277944c
Status: NEW → RESOLVED
Last Resolved: a year ago
status-firefox52: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in before you can comment on or make changes to this bug.