Bug 1851099 - Remove dom.media.mediasession.enabled pref r=alwu,geckoview-reviewers,webidl,smaug,m_kato

Differential Revision: https://phabricator.services.mozilla.com/D187347
This commit is contained in:
Gregory Pappas 2023-09-15 18:31:44 +00:00
parent 1d467636de
commit e93d3dafd9
15 changed files with 12 additions and 55 deletions

View File

@ -19,10 +19,7 @@ const videoId = "video";
*/
add_task(async function setupTestingPref() {
await SpecialPowers.pushPrefEnv({
set: [
["dom.media.mediasession.enabled", true],
["media.mediacontrol.testingevents.enabled", true],
],
set: [["media.mediacontrol.testingevents.enabled", true]],
});
});

View File

@ -8,10 +8,7 @@ const frame2 = "frame2";
add_task(async function setupTestingPref() {
await SpecialPowers.pushPrefEnv({
set: [
["media.mediacontrol.testingevents.enabled", true],
["dom.media.mediasession.enabled", true],
],
set: [["media.mediacontrol.testingevents.enabled", true]],
});
});

View File

@ -11,10 +11,7 @@ const testVideoId = "video";
add_task(async function setupTestingPref() {
await SpecialPowers.pushPrefEnv({
set: [
["media.mediacontrol.testingevents.enabled", true],
["dom.media.mediasession.enabled", true],
],
set: [["media.mediacontrol.testingevents.enabled", true]],
});
});

View File

@ -8,10 +8,7 @@ const defaultFaviconName = "defaultFavicon.svg";
add_task(async function setupTestingPref() {
await SpecialPowers.pushPrefEnv({
set: [
["media.mediacontrol.testingevents.enabled", true],
["dom.media.mediasession.enabled", true],
],
set: [["media.mediacontrol.testingevents.enabled", true]],
});
});

View File

@ -5,10 +5,7 @@ const testVideoId = "video";
add_task(async function setupTestingPref() {
await SpecialPowers.pushPrefEnv({
set: [
["media.mediacontrol.testingevents.enabled", true],
["dom.media.mediasession.enabled", true],
],
set: [["media.mediacontrol.testingevents.enabled", true]],
});
});

View File

@ -7,10 +7,7 @@ const testVideoId = "video";
add_task(async function setupTestingPref() {
await SpecialPowers.pushPrefEnv({
set: [
["media.mediacontrol.testingevents.enabled", true],
["dom.media.mediasession.enabled", true],
],
set: [["media.mediacontrol.testingevents.enabled", true]],
});
});

View File

@ -5,10 +5,7 @@ const testVideoId = "video";
add_task(async function setupTestingPref() {
await SpecialPowers.pushPrefEnv({
set: [
["media.mediacontrol.testingevents.enabled", true],
["dom.media.mediasession.enabled", true],
],
set: [["media.mediacontrol.testingevents.enabled", true]],
});
});

View File

@ -6,10 +6,7 @@ const sDefaultSupportedKeys = ["focus", "play", "pause", "playpause", "stop"];
add_task(async function setupTestingPref() {
await SpecialPowers.pushPrefEnv({
set: [
["media.mediacontrol.testingevents.enabled", true],
["dom.media.mediasession.enabled", true],
],
set: [["media.mediacontrol.testingevents.enabled", true]],
});
});

View File

@ -8,10 +8,7 @@ const ACTION = "previoustrack";
add_task(async function setupTestingPref() {
await SpecialPowers.pushPrefEnv({
set: [
["dom.media.mediasession.enabled", true],
["media.mediacontrol.testingevents.enabled", true],
],
set: [["media.mediacontrol.testingevents.enabled", true]],
});
});

View File

@ -23,8 +23,6 @@ const ACTIONS = [
];
(async function testSetActionHandler() {
await setupPreference();
for (const action of ACTIONS) {
info(`Test setActionHandler for '${action}'`);
generateAction(action);
@ -46,12 +44,6 @@ const ACTIONS = [
SimpleTest.finish();
})();
function setupPreference() {
return SpecialPowers.pushPrefEnv({"set": [
["dom.media.mediasession.enabled", true],
]});
}
function generateAction(action) {
let details = generateActionDetails(action);
SpecialPowers.wrap(navigator.mediaSession).notifyHandler(details);

View File

@ -32,7 +32,6 @@ const testCases = [
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({"set": [
["dom.media.mediasession.enabled", true],
["media.mediacontrol.testingevents.enabled", true],
]}, startTest());

View File

@ -27,7 +27,7 @@ enum MediaSessionAction {
callback MediaSessionActionHandler = undefined(MediaSessionActionDetails details);
[Exposed=Window, Pref="dom.media.mediasession.enabled"]
[Exposed=Window]
interface MediaSession {
attribute MediaMetadata? metadata;
@ -43,7 +43,7 @@ interface MediaSession {
undefined notifyHandler(MediaSessionActionDetails details);
};
[Exposed=Window, Pref="dom.media.mediasession.enabled"]
[Exposed=Window]
interface MediaMetadata {
[Throws]
constructor(optional MediaMetadataInit init = {});

View File

@ -334,7 +334,7 @@ dictionary ShareData {
// https://w3c.github.io/mediasession/#idl-index
[Exposed=Window]
partial interface Navigator {
[Pref="dom.media.mediasession.enabled", SameObject]
[SameObject]
readonly attribute MediaSession mediaSession;
};

View File

@ -68,7 +68,6 @@ class MediaSessionTest : BaseSessionTest() {
sessionRule.setPrefsUntilTestEnd(
mapOf(
"media.mediacontrol.stopcontrol.aftermediaends" to false,
"dom.media.mediasession.enabled" to true,
),
)
}

View File

@ -3078,12 +3078,6 @@
value: true
mirror: always
# Media Session API
- name: dom.media.mediasession.enabled
type: bool
value: true
mirror: always
# WebCodecs API
- name: dom.media.webcodecs.enabled
type: RelaxedAtomicBool