Closed
Bug 1309299
Opened 9 years ago
Closed 9 years ago
[EME] navigator.requestMediaKeySystemAccess should reject with TypeError on empty keySystem string or configs
Categories
(Core :: Audio/Video: Playback, defect)
Core
Audio/Video: Playback
Tracking
()
RESOLVED
FIXED
mozilla52
Tracking | Status | |
---|---|---|
firefox52 | --- | fixed |
People
(Reporter: cpearce, Assigned: cpearce)
References
Details
Attachments
(1 file)
The EME spec says we should reject requestMediaKeySystemAccess('', []) with TypeError, but we're rejecting with InvalidAccessError.
https://www.w3.org/TR/encrypted-media/#navigator-extension-requestmediakeysystemaccess
This causes http://www.w3c-test.org/encrypted-media/drm-mp4-syntax-mediakeysystemaccess.html to fail.
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → cpearce
Assignee | ||
Comment 1•9 years ago
|
||
Once I fix this, we start failing with:
navigator.requestMediaKeySystemAccess(new Uint8Array(0), [{}]); }" expected "NotSupportedError" but got "TypeError"
It seems that |new Uint8Array(0)| is being converted to the empty string (''), which we'll reject now.
The web platform test claims that toString() is called on the first argument passed to navigator.requestMediaKeySystemAccess. However when I call toString(new Uint8Array(0)) in Firefox that returns "undefined", not the empty string, and in Chrome it returns "[object Undefined]"
bz: do you know what a Uint8Array is supposed to be converted into when it's passed as the first argument to navigator.requestMediaKeySystemAccess()?
Flags: needinfo?(bzbarsky)
![]() |
||
Comment 2•9 years ago
|
||
> However when I call toString(new Uint8Array(0)) in Firefox that returns "undefined"
> not the empty string, and in Chrome it returns "[object Undefined]"
The right thing to check is what String(new Uint8Array(0)) returns, which is the same thing as what (new Uint8Array(0)).toString() returns. And it should return "" in all browsers. That's because it calls https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.tostring which calls https://tc39.github.io/ecma262/#sec-array.prototype.tostring which does join() (with no args), which for an empty array will return an empty string.
> do you know what a Uint8Array is supposed to be converted into when it's passed as
> the first argument to navigator.requestMediaKeySystemAccess()?
Given the IDL for it, empty string.
Flags: needinfo?(bzbarsky)
![]() |
||
Comment 3•9 years ago
|
||
Note that Chrome also rejects requestMediaKeySystemAccess('', []) with NotSupportedError. So maybe the spec just needs to change to align with implementations... Either way, the test is buggy; behavior for "" and new Uint8Array(0) should be identical.
Comment hidden (mozreview-request) |
Comment 5•9 years ago
|
||
mozreview-review |
Comment on attachment 8799945 [details]
Bug 1309299 - make navigator.requestMediaKeySystemAccess() reject with TypeError for empty keysystem string or config.
https://reviewboard.mozilla.org/r/84998/#review83558
Attachment #8799945 -
Flags: review?(gsquelart) → review+
Pushed by cpearce@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8559d0b32326
make navigator.requestMediaKeySystemAccess() reject with TypeError for empty keysystem string or config. r=gerald
I backed this out for wpt failures: https://hg.mozilla.org/integration/autoland/rev/fac9c1da5d81a2d0f7ff8fb721ddebc2fbb16b61
https://treeherder.mozilla.org/logviewer.html#?job_id=4888981&repo=autoland
Flags: needinfo?(cpearce)
It's been pointed out that this was expected. When you re-land, can you either adjust the test's expectations for the new reality or disable the test until it can be fixed upstream?
![]() |
||
Comment 9•9 years ago
|
||
Just fix the test in our tree and then the fix for it will get upstreamed...
Assignee | ||
Comment 10•9 years ago
|
||
(In reply to Boris Zbarsky [:bz] (still a bit busy) from comment #9)
> Just fix the test in our tree and then the fix for it will get upstreamed...
Upstream is fixed and the version of the EME tests in our tree is out of date. I'll mark the test as expected fail, and we'll pickup the fixed test in the next pull from upstream.
Comment 11•9 years ago
|
||
Pushed by cpearce@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/aa789d732c6c
make navigator.requestMediaKeySystemAccess() reject with TypeError for empty keysystem string or config. r=gerald
Comment 12•9 years ago
|
||
sorry had to back this out for failures in windows wpt-4 tests like https://treeherder.mozilla.org/logviewer.html#?job_id=37436623&repo=mozilla-inbound
Comment 13•9 years ago
|
||
Backout by cbook@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/e9cae5f43de9
Backed out changeset aa789d732c6c for wpt-4 test failures on own test
Comment 14•9 years ago
|
||
Pushed by cpearce@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/4ea2b81e7ffc
make navigator.requestMediaKeySystemAccess() reject with TypeError for empty keysystem string or config. r=gerald
Comment 15•9 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox52:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Assignee | ||
Updated•9 years ago
|
Flags: needinfo?(cpearce)
You need to log in
before you can comment on or make changes to this bug.
Description
•