From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../web-platform/tests/picture-in-picture/META.yml | 4 + .../tests/picture-in-picture/WEB_FEATURES.yml | 3 + .../tests/picture-in-picture/css-selector.html | 34 ++++++++ .../disable-picture-in-picture.html | 74 +++++++++++++++++ .../enter-picture-in-picture.html | 30 +++++++ .../exit-picture-in-picture.html | 21 +++++ .../tests/picture-in-picture/idlharness.window.js | 28 +++++++ .../leave-picture-in-picture.html | 56 +++++++++++++ .../tests/picture-in-picture/mediastream.html | 24 ++++++ .../picture-in-picture-element.html | 24 ++++++ .../picture-in-picture-window.html | 96 ++++++++++++++++++++++ .../picture-in-picture/removed-from-document.html | 24 ++++++ .../request-picture-in-picture-twice.html | 29 +++++++ .../request-picture-in-picture.html | 37 +++++++++ .../resources/picture-in-picture-helpers.js | 15 ++++ .../tests/picture-in-picture/shadow-dom.html | 88 ++++++++++++++++++++ 16 files changed, 587 insertions(+) create mode 100644 testing/web-platform/tests/picture-in-picture/META.yml create mode 100644 testing/web-platform/tests/picture-in-picture/WEB_FEATURES.yml create mode 100644 testing/web-platform/tests/picture-in-picture/css-selector.html create mode 100644 testing/web-platform/tests/picture-in-picture/disable-picture-in-picture.html create mode 100644 testing/web-platform/tests/picture-in-picture/enter-picture-in-picture.html create mode 100644 testing/web-platform/tests/picture-in-picture/exit-picture-in-picture.html create mode 100644 testing/web-platform/tests/picture-in-picture/idlharness.window.js create mode 100644 testing/web-platform/tests/picture-in-picture/leave-picture-in-picture.html create mode 100644 testing/web-platform/tests/picture-in-picture/mediastream.html create mode 100644 testing/web-platform/tests/picture-in-picture/picture-in-picture-element.html create mode 100644 testing/web-platform/tests/picture-in-picture/picture-in-picture-window.html create mode 100644 testing/web-platform/tests/picture-in-picture/removed-from-document.html create mode 100644 testing/web-platform/tests/picture-in-picture/request-picture-in-picture-twice.html create mode 100644 testing/web-platform/tests/picture-in-picture/request-picture-in-picture.html create mode 100644 testing/web-platform/tests/picture-in-picture/resources/picture-in-picture-helpers.js create mode 100644 testing/web-platform/tests/picture-in-picture/shadow-dom.html (limited to 'testing/web-platform/tests/picture-in-picture') diff --git a/testing/web-platform/tests/picture-in-picture/META.yml b/testing/web-platform/tests/picture-in-picture/META.yml new file mode 100644 index 0000000000..8df9be5e5b --- /dev/null +++ b/testing/web-platform/tests/picture-in-picture/META.yml @@ -0,0 +1,4 @@ +spec: https://w3c.github.io/picture-in-picture/ +suggested_reviewers: + - beaufortfrancois + - mounirlamouri diff --git a/testing/web-platform/tests/picture-in-picture/WEB_FEATURES.yml b/testing/web-platform/tests/picture-in-picture/WEB_FEATURES.yml new file mode 100644 index 0000000000..e895260b8b --- /dev/null +++ b/testing/web-platform/tests/picture-in-picture/WEB_FEATURES.yml @@ -0,0 +1,3 @@ +features: +- name: picture-in-picture + files: "**" diff --git a/testing/web-platform/tests/picture-in-picture/css-selector.html b/testing/web-platform/tests/picture-in-picture/css-selector.html new file mode 100644 index 0000000000..bf64a1421f --- /dev/null +++ b/testing/web-platform/tests/picture-in-picture/css-selector.html @@ -0,0 +1,34 @@ + +Test CSS selector :picture-in-picture + + + + + + + + + diff --git a/testing/web-platform/tests/picture-in-picture/disable-picture-in-picture.html b/testing/web-platform/tests/picture-in-picture/disable-picture-in-picture.html new file mode 100644 index 0000000000..a6b757477a --- /dev/null +++ b/testing/web-platform/tests/picture-in-picture/disable-picture-in-picture.html @@ -0,0 +1,74 @@ + +Test disable Picture-in-Picture + + + + + + + + diff --git a/testing/web-platform/tests/picture-in-picture/enter-picture-in-picture.html b/testing/web-platform/tests/picture-in-picture/enter-picture-in-picture.html new file mode 100644 index 0000000000..a9d7b5c048 --- /dev/null +++ b/testing/web-platform/tests/picture-in-picture/enter-picture-in-picture.html @@ -0,0 +1,30 @@ + +Test enterpictureinpicture event + + + + + + + + diff --git a/testing/web-platform/tests/picture-in-picture/exit-picture-in-picture.html b/testing/web-platform/tests/picture-in-picture/exit-picture-in-picture.html new file mode 100644 index 0000000000..520293b5aa --- /dev/null +++ b/testing/web-platform/tests/picture-in-picture/exit-picture-in-picture.html @@ -0,0 +1,21 @@ + +Test exit Picture-in-Picture + + + + + + + + diff --git a/testing/web-platform/tests/picture-in-picture/idlharness.window.js b/testing/web-platform/tests/picture-in-picture/idlharness.window.js new file mode 100644 index 0000000000..8977588478 --- /dev/null +++ b/testing/web-platform/tests/picture-in-picture/idlharness.window.js @@ -0,0 +1,28 @@ +// META: script=/common/media.js +// META: script=/resources/WebIDLParser.js +// META: script=/resources/idlharness.js +// META: script=/resources/testdriver.js +// META: script=/resources/testdriver-vendor.js +// META: script=resources/picture-in-picture-helpers.js +// META: timeout=long + +'use strict'; + +// https://wicg.github.io/picture-in-picture/ + +idl_test( + ['picture-in-picture'], + ['html', 'dom'], + async idl_array => { + idl_array.add_objects({ + Document: ['document'], + DocumentOrShadowRoot: ['document'], + HTMLVideoElement: ['video'], + PictureInPictureWindow: ['pipw'], + PictureInPictureEvent: ['new PictureInPictureEvent("type", { pictureInPictureWindow: pipw })'], + }); + + self.video = await loadVideo(); + self.pipw = await requestPictureInPictureWithTrustedClick(video); + } +); diff --git a/testing/web-platform/tests/picture-in-picture/leave-picture-in-picture.html b/testing/web-platform/tests/picture-in-picture/leave-picture-in-picture.html new file mode 100644 index 0000000000..a0fbcb23e5 --- /dev/null +++ b/testing/web-platform/tests/picture-in-picture/leave-picture-in-picture.html @@ -0,0 +1,56 @@ + +Test leavepictureinpicture event + + + + + + + + + diff --git a/testing/web-platform/tests/picture-in-picture/mediastream.html b/testing/web-platform/tests/picture-in-picture/mediastream.html new file mode 100644 index 0000000000..116a0f7dd4 --- /dev/null +++ b/testing/web-platform/tests/picture-in-picture/mediastream.html @@ -0,0 +1,24 @@ + +Test mediastream video in Picture-in-Picture + + + + + + + diff --git a/testing/web-platform/tests/picture-in-picture/picture-in-picture-element.html b/testing/web-platform/tests/picture-in-picture/picture-in-picture-element.html new file mode 100644 index 0000000000..2763eca476 --- /dev/null +++ b/testing/web-platform/tests/picture-in-picture/picture-in-picture-element.html @@ -0,0 +1,24 @@ + +Test Picture-in-Picture element + + + + + + + + diff --git a/testing/web-platform/tests/picture-in-picture/picture-in-picture-window.html b/testing/web-platform/tests/picture-in-picture/picture-in-picture-window.html new file mode 100644 index 0000000000..ed1ad8e2cc --- /dev/null +++ b/testing/web-platform/tests/picture-in-picture/picture-in-picture-window.html @@ -0,0 +1,96 @@ + +Test Picture-in-Picture window + + + + + + + + + diff --git a/testing/web-platform/tests/picture-in-picture/removed-from-document.html b/testing/web-platform/tests/picture-in-picture/removed-from-document.html new file mode 100644 index 0000000000..2c363a0eec --- /dev/null +++ b/testing/web-platform/tests/picture-in-picture/removed-from-document.html @@ -0,0 +1,24 @@ + +Test Picture-in-Picture when removed from document + + + + + + + + diff --git a/testing/web-platform/tests/picture-in-picture/request-picture-in-picture-twice.html b/testing/web-platform/tests/picture-in-picture/request-picture-in-picture-twice.html new file mode 100644 index 0000000000..c1369ee8c3 --- /dev/null +++ b/testing/web-platform/tests/picture-in-picture/request-picture-in-picture-twice.html @@ -0,0 +1,29 @@ + +Test request Picture-in-Picture on two videos + + + + + + + + + diff --git a/testing/web-platform/tests/picture-in-picture/request-picture-in-picture.html b/testing/web-platform/tests/picture-in-picture/request-picture-in-picture.html new file mode 100644 index 0000000000..d8383ecbe9 --- /dev/null +++ b/testing/web-platform/tests/picture-in-picture/request-picture-in-picture.html @@ -0,0 +1,37 @@ + +Test request Picture-in-Picture + + + + + + + + diff --git a/testing/web-platform/tests/picture-in-picture/resources/picture-in-picture-helpers.js b/testing/web-platform/tests/picture-in-picture/resources/picture-in-picture-helpers.js new file mode 100644 index 0000000000..7561944a18 --- /dev/null +++ b/testing/web-platform/tests/picture-in-picture/resources/picture-in-picture-helpers.js @@ -0,0 +1,15 @@ +function loadVideo(activeDocument, sourceUrl) { + return new Promise((resolve, reject) => { + const document = activeDocument || window.document; + const video = document.createElement('video'); + video.src = sourceUrl || getVideoURI('/media/movie_5'); + video.onloadedmetadata = () => { resolve(video); }; + video.onerror = error => { reject(error); }; + }); +} + +// Calls requestPictureInPicture() in a context that's 'allowed to request PiP'. +async function requestPictureInPictureWithTrustedClick(videoElement) { + await test_driver.bless('request Picture-in-Picture'); + return videoElement.requestPictureInPicture(); +} diff --git a/testing/web-platform/tests/picture-in-picture/shadow-dom.html b/testing/web-platform/tests/picture-in-picture/shadow-dom.html new file mode 100644 index 0000000000..adcd659762 --- /dev/null +++ b/testing/web-platform/tests/picture-in-picture/shadow-dom.html @@ -0,0 +1,88 @@ + +Test for Picture-In-Picture and Shadow DOM + + + + + + + + + +
+ +
+ +
+
+ + -- cgit v1.2.3