зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1474984 [wpt PR 11916] - Update the picture-in-picture IDL test, a=testonly
Automatic update from web-platform-testsUpdate the picture-in-picture IDL test (#11916) -- wpt-commits: ab9fce0c39c50afa4e6bb51b1cabfe4ffccc2bf8 wpt-pr: 11916
This commit is contained in:
Родитель
7c40b3381b
Коммит
2230dcbd54
|
@ -591322,7 +591322,7 @@
|
|||
"support"
|
||||
],
|
||||
"interfaces/picture-in-picture.idl": [
|
||||
"3e97112286c64d274a4ecbdb0f41d4700e5448fb",
|
||||
"4051a7f0ba28e984294ca32a5a2aef73b7f9a6bb",
|
||||
"support"
|
||||
],
|
||||
"interfaces/pointerevents-extension.idl": [
|
||||
|
@ -602154,7 +602154,7 @@
|
|||
"testharness"
|
||||
],
|
||||
"picture-in-picture/idlharness.window.js": [
|
||||
"4b24a93a59e290c762969a4f8c33e24ebe37bf9b",
|
||||
"0fecf6b24a57f6ae7ca605782fdd9bc66e3fa562",
|
||||
"testharness"
|
||||
],
|
||||
"picture-in-picture/leave-picture-in-picture.html": [
|
||||
|
|
|
@ -4,19 +4,18 @@
|
|||
// See: https://wicg.github.io/picture-in-picture/
|
||||
|
||||
partial interface HTMLVideoElement {
|
||||
Promise<PictureInPictureWindow> requestPictureInPicture();
|
||||
[NewObject] Promise<PictureInPictureWindow> requestPictureInPicture();
|
||||
|
||||
attribute EventHandler onenterpictureinpicture;
|
||||
attribute EventHandler onleavepictureinpicture;
|
||||
|
||||
[CEReactions]
|
||||
attribute boolean disablePictureInPicture;
|
||||
[CEReactions] attribute boolean disablePictureInPicture;
|
||||
};
|
||||
|
||||
partial interface Document {
|
||||
readonly attribute boolean pictureInPictureEnabled;
|
||||
|
||||
Promise<void> exitPictureInPicture();
|
||||
[NewObject] Promise<void> exitPictureInPicture();
|
||||
};
|
||||
|
||||
partial interface DocumentOrShadowRoot {
|
||||
|
|
|
@ -1,22 +1,31 @@
|
|||
// META: script=/resources/WebIDLParser.js
|
||||
// META: script=/resources/idlharness.js
|
||||
// META: script=resources/picture-in-picture-helpers.js
|
||||
|
||||
'use strict';
|
||||
|
||||
// https://wicg.github.io/picture-in-picture/
|
||||
|
||||
promise_test(async () => {
|
||||
const srcs = ['html', 'dom', 'picture-in-picture'];
|
||||
const [html, dom, pip] = await Promise.all(
|
||||
srcs.map(i => fetch(`/interfaces/${i}.idl`).then(r => r.text())));
|
||||
try {
|
||||
const video = await loadVideo();
|
||||
document.body.appendChild(video);
|
||||
self.video = video;
|
||||
self.pipw = await video.requestPictureInPicture();
|
||||
} catch (e) {
|
||||
// Will be surfaced when video/pipw are undefined below.
|
||||
}
|
||||
|
||||
const idl_array = new IdlArray();
|
||||
idl_array.add_idls(pip);
|
||||
idl_array.add_dependency_idls(dom);
|
||||
idl_array.add_dependency_idls(html);
|
||||
|
||||
idl_array.add_objects({
|
||||
Document: ['document'],
|
||||
});
|
||||
idl_array.test();
|
||||
}, 'picture-in-picture interfaces.');
|
||||
idl_test(
|
||||
['picture-in-picture'],
|
||||
['html', 'dom'],
|
||||
idl_array => {
|
||||
idl_array.add_objects({
|
||||
Document: ['document'],
|
||||
DocumentOrShadowRoot: ['document'],
|
||||
HTMLVideoElement: ['video'],
|
||||
PictureInPictureWindow: ['pipw'],
|
||||
});
|
||||
},
|
||||
'picture-in-picture interfaces.');
|
||||
})
|
||||
|
|
Загрузка…
Ссылка в новой задаче