Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
-
CI results over the last 21 days
- Manifest: dom/media/test/browser/browser.toml
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
"use strict";
// Changing a media.rdd-* pref after startup must not break media in content
async function withNewProcessTab(aTask) {
await SpecialPowers.pushPrefEnv({
set: [["media.rdd-vpx.enabled", false]],
});
await BrowserTestUtils.withNewTab(
{
gBrowser,
forceNewProcess: true,
},
browser => SpecialPowers.spawn(browser, [], aTask)
);
await SpecialPowers.popPrefEnv();
}
add_task(async function test_decodingInfo_after_rdd_pref_change() {
await withNewProcessTab(async () => {
const info = await content.navigator.mediaCapabilities.decodingInfo({
type: "file",
video: {
contentType: 'video/webm; codecs="vp9"',
width: 320,
height: 240,
bitrate: 100000,
framerate: 30,
},
});
ok(info.supported, "VP9 decoding is reported as supported");
});
});
add_task(async function test_video_load_after_rdd_pref_change() {
await withNewProcessTab(async () => {
const video = content.document.createElement("video");
content.document.body.appendChild(video);
video.src = "gizmo.webm";
await new Promise((resolve, reject) => {
video.onloadeddata = resolve;
video.onerror = () => reject(video.error);
});
ok(true, "Video data loaded");
});
});