Backed out 3 changesets (bug 1620077, bug 1580623) for causing mochitest failures CLOSED TREE

Backed out changeset 981e37f4d18d (bug 1620077)
Backed out changeset 0333485a02ed (bug 1580623)
Backed out changeset d729f6a0050b (bug 1580623)
This commit is contained in:
Ciure Andrei 2020-03-18 01:24:26 +02:00
Родитель 3342f3308e
Коммит 35bf0da2a1
8 изменённых файлов: 16 добавлений и 31 удалений

Просмотреть файл

@ -66,19 +66,15 @@ void PlaybackController::Pause() {
}
void PlaybackController::SeekBackward() {
const MediaSessionAction action = MediaSessionAction::Seekbackward;
if (RefPtr<MediaSession> session = GetMediaSession();
session && session->IsSupportedAction(action)) {
session->NotifyHandler(action);
}
// TODO : use media session's action handler if it exists. MediaSessionAction
// doesn't support `seekbackward` yet.
return;
}
void PlaybackController::SeekForward() {
const MediaSessionAction action = MediaSessionAction::Seekforward;
if (RefPtr<MediaSession> session = GetMediaSession();
session && session->IsSupportedAction(action)) {
session->NotifyHandler(action);
}
// TODO : use media session's action handler if it exists. MediaSessionAction
// doesn't support `seekforward` yet.
return;
}
void PlaybackController::PreviousTrack() {

Просмотреть файл

@ -96,19 +96,21 @@ void MediaSession::DispatchNotifyHandler(
const MediaSessionActionDetails& aDetails)
: mozilla::Runnable("MediaSession::DispatchNotifyHandler"),
mSession(aSession),
mDetails(aDetails) {}
mAction(aDetails.mAction) {}
MOZ_CAN_RUN_SCRIPT_BOUNDARY NS_IMETHOD Run() override {
if (RefPtr<MediaSessionActionHandler> handler =
mSession->GetActionHandler(mDetails.mAction)) {
handler->Call(mDetails);
mSession->GetActionHandler(mAction)) {
MediaSessionActionDetails details;
details.mAction = mAction;
handler->Call(details);
}
return NS_OK;
}
private:
RefPtr<const MediaSession> mSession;
MediaSessionActionDetails mDetails;
MediaSessionAction mAction;
};
RefPtr<nsIRunnable> runnable = new Runnable(this, aDetails);

Просмотреть файл

@ -1,8 +1,6 @@
const gMediaSessionActions = [
"play",
"pause",
"seekbackward",
"seekforward",
"previoustrack",
"nexttrack",
"stop",

Просмотреть файл

@ -11,8 +11,6 @@
const MediaSessionActions = [
"play",
"pause",
"seekbackward",
"seekforward",
"previoustrack",
"nexttrack",
"stop",

Просмотреть файл

@ -13,8 +13,6 @@ SimpleTest.waitForExplicitFinish();
const ACTIONS = [
"play",
"pause",
"seekbackward",
"seekforward",
"previoustrack",
"nexttrack",
"stop",
@ -57,9 +55,6 @@ function generateAction(action) {
function generateActionDetails(action) {
let details = { action };
if (action == "seekbackward" || action == "seekforward") {
details.seekOffset = 3.14159;
}
return details;
}

Просмотреть файл

@ -13,12 +13,10 @@ enum MediaSessionPlaybackState {
"playing"
};
// TODO: Implement the missing seekto (bug 1621403) and skipad (bug 1582569) actions
// TODO: Implement the missing seek* (bug 1580623) and skipad (bug 1582569) actions
enum MediaSessionAction {
"play",
"pause",
"seekbackward",
"seekforward",
"previoustrack",
"nexttrack",
"stop",
@ -70,9 +68,6 @@ dictionary MediaImage {
dictionary MediaSessionActionDetails {
required MediaSessionAction action;
// Merge MediaSessionSeekActionDetails here:
// https://github.com/w3c/mediasession/issues/234
double seekOffset;
};
// TODO: Implement MediaPositionState (bug 1582509)

Просмотреть файл

@ -1992,7 +1992,7 @@
# Media Session API
- name: dom.media.mediasession.enabled
type: bool
value: @IS_NIGHTLY_BUILD@
value: false
mirror: always
# Enable meta-viewport support in remote APZ-enabled frames.

Просмотреть файл

@ -1,4 +1,5 @@
prefs: [dom.media.mediasession.enabled:true]
[setactionhandler.html] # Bug 1621403
[setactionhandler.html] # Bug 1580623
[Test that setActionHandler() can be executed for supported actions]
expected: FAIL