зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1611021 - part1 : add a method in special power to generate media control key events. r=bzbarsky
It allows us to simulate media control key events in non-privileged context, such as a mochitest running in content process. Differential Revision: https://phabricator.services.mozilla.com/D60783 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
095171a2ea
Коммит
6f60b210f6
|
@ -1293,6 +1293,10 @@ class SpecialPowersChild extends JSWindowActorChild {
|
|||
);
|
||||
}
|
||||
|
||||
async generateMediaControlKeyTestEvent(event) {
|
||||
await this.sendQuery("SPGenerateMediaControlKeyTestEvent", { event });
|
||||
}
|
||||
|
||||
// Note: each call to registerConsoleListener MUST be paired with a
|
||||
// call to postConsoleSentinel; when the callback receives the
|
||||
// sentinel it will unregister itself (_after_ calling the
|
||||
|
|
|
@ -1095,6 +1095,11 @@ class SpecialPowersParent extends JSWindowActorParent {
|
|||
return ServiceWorkerCleanUp.removeFromHost("example.com");
|
||||
}
|
||||
|
||||
case "SPGenerateMediaControlKeyTestEvent": {
|
||||
ChromeUtils.generateMediaControlKeysTestEvent(aMessage.data.event);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
default:
|
||||
throw new SpecialPowersError(
|
||||
`Unrecognized Special Powers API: ${aMessage.name}`
|
||||
|
|
Загрузка…
Ссылка в новой задаче