Bug 1582509 - part2 : modify and enable wpt 'positionstate.html'. r=baku

According to [1], the playback rate can be either positive or negative, the only unsupported value is zero.

[1] https://w3c.github.io/mediasession/#dom-mediapositionstate-playbackrate

Differential Revision: https://phabricator.services.mozilla.com/D66501

--HG--
extra : moz-landing-system : lando
This commit is contained in:
alwu 2020-03-20 16:45:04 +00:00
Родитель 371b11291d
Коммит ac127daa2c
3 изменённых файлов: 7 добавлений и 38 удалений

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

@ -1,10 +0,0 @@
prefs: [dom.media.mediasession.enabled:true]
[idlharness.window.html]
[MediaSession interface: navigator.mediaSession must inherit property "setPositionState(optional MediaPositionState)" with the proper type]
expected: FAIL
[MediaSession interface: operation setPositionState(optional MediaPositionState)]
expected: FAIL
[MediaSession interface: calling setPositionState(optional MediaPositionState) on navigator.mediaSession with too few arguments must throw TypeError]
expected: FAIL

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

@ -1,19 +1,2 @@
prefs: [dom.media.mediasession.enabled:true]
[positionstate.html]
[Test setPositionState with a null value]
expected: FAIL
[Test setPositionState with a valid value for forward playback]
expected: FAIL
[Test setPositionState with optional position]
expected: FAIL
[Test setPositionState with optional playback rate]
expected: FAIL
[Test setPositionState with zero duration]
expected: FAIL
[Test setPositionState with only duration]
expected: FAIL

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

@ -42,16 +42,12 @@ test(() => {
}, 'Test setPositionState with zero duration');
test(() => {
assert_throws_js(
TypeError,
_ => {
window.navigator.mediaSession.setPositionState({
duration: 60.9,
position: 10.1,
playbackRate: -2.0
});
});
}, 'Test setPositionState throws a TypeError if playback rate is negative');
window.navigator.mediaSession.setPositionState({
duration: 60.9,
position: 10.1,
playbackRate: -2.0
});
}, 'Test setPositionState with negative playback rate');
test(() => {
assert_throws_js(