Bug 1547784 - Add crashtest for moving media element with media keys to inactive doc. r=alwu

Differential Revision: https://phabricator.services.mozilla.com/D40481

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Bryce Seager van Dyk 2019-08-02 21:54:03 +00:00
parent 9bd8db2016
commit 07a2753dbb
2 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,29 @@
<html class="reftest-wait">
<head>
<script>
const doc = new Document();
const video = document.createElementNS('http://www.w3.org/1999/xhtml', 'video');
const source = new MediaSource();
navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{ '': [{ '': '' }] }])
.then(keySystemAccess => {
return keySystemAccess.createMediaKeys();
}).then(_ => {
video.src = URL.createObjectURL(source);
source.addEventListener('sourceopen', () => {
doc.adoptNode(video);
});
});
navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{ '': [{ '': '' }] }])
.then(keySystemAccess => {
return keySystemAccess.createMediaKeys();
}).then(mediaKeys => {
return video.setMediaKeys(mediaKeys);
}).then(() => {
video.src = URL.createObjectURL(source);
document.documentElement.removeAttribute("class");
});
</script>
</head>
</html>

View File

@ -127,4 +127,5 @@ load empty-samples.webm # Bug 1540580
test-pref(media.autoplay.block-webaudio,false) load 1545133.html
load track-with-zero-dimensions.mp4 # Bug 1542539
load 1560215.html
load 1547784.html
load 1547899.html