-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1925952 - Implement attribute waitingforkey on audio/video elemen…
…ts. r=smaug IDL attribute was added in bug 1304247 but we are missing corresponding content attribute: https://w3c.github.io/encrypted-media/#attributes-3 Differential Revision: https://phabricator.services.mozilla.com/D226298
- Loading branch information
Showing
5 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
testing/web-platform/tests/encrypted-media/media-element-event-handler-attributes.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>Test setting EventHandler attributes</title> | ||
<link rel="help" href="https://w3c.github.io/encrypted-media/#attributes-3"> | ||
|
||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
|
||
<body> | ||
<audio id="testElement" | ||
onencrypted="window.onencryptedHandlerSetFromParserWasFired()" | ||
onwaitingforkey="window.onwaitingforkeyHandlerSetFromParserWasFired()"> | ||
</audio> | ||
<script> | ||
["encrypted", "waitingforkey"].forEach(eventName => { | ||
promise_test(() => { | ||
return new Promise(resolve => { | ||
window[`on${eventName}HandlerSetFromParserWasFired`] = resolve; | ||
testElement.dispatchEvent(new Event(eventName)); | ||
}); | ||
}, `on${eventName} handler set from parser`); | ||
|
||
promise_test(() => { | ||
const el = document.createElement("audio"); | ||
el.setAttribute(`on${eventName}`, `window.on${eventName}HandlerSetViaSetAttributeWasFired()`); | ||
document.body.append(el); | ||
|
||
return new Promise(resolve => { | ||
window[`on${eventName}HandlerSetViaSetAttributeWasFired`] = resolve; | ||
el.dispatchEvent(new Event(eventName)); | ||
}); | ||
}, `on${eventName} handler set via setAttribute()`); | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters