зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1656398 - part6 : use 'controller.playbackState' in test. r=chunmin
Differential Revision: https://phabricator.services.mozilla.com/D86627
This commit is contained in:
Родитель
0b9d0ae82c
Коммит
e27e44aff0
|
@ -95,12 +95,15 @@ function setGuessedPlaybackState(tab, state) {
|
|||
return Promise.resolve();
|
||||
}
|
||||
|
||||
function isActualPlaybackStateEqualTo(tab, expectedState) {
|
||||
const currentState = MediaControlService.getCurrentMediaSessionPlaybackState();
|
||||
async function isActualPlaybackStateEqualTo(tab, expectedState) {
|
||||
const controller = tab.linkedBrowser.browsingContext.mediaController;
|
||||
if (controller.playbackState != expectedState) {
|
||||
await new Promise(r => (controller.onplaybackstatechange = r));
|
||||
}
|
||||
is(
|
||||
currentState,
|
||||
controller.playbackState,
|
||||
expectedState,
|
||||
`current state '${currentState}'' is equal to '${expectedState}'`
|
||||
`current state '${controller.playbackState}' is equal to '${expectedState}'`
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче