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 --- ...pture-MediaTrackSupportedConstraints.https.html | 29 ++ .../ImageCapture-creation.https.html | 100 ++++++ .../ImageCapture-grabFrame-crash.html | 11 + .../mediacapture-image/ImageCapture-grabFrame.html | 46 +++ .../mediacapture-image/ImageCapture-track.html | 31 ++ .../web-platform/tests/mediacapture-image/META.yml | 4 + .../MediaStreamTrack-applyConstraints-fast.html | 67 ++++ ...amTrack-applyConstraints-getSettings.https.html | 161 +++++++++ ...aStreamTrack-applyConstraints-reject.https.html | 76 +++++ .../MediaStreamTrack-applyConstraints.https.html | 112 +++++++ .../MediaStreamTrack-clone.https.html | 371 +++++++++++++++++++++ .../MediaStreamTrack-getCapabilities-fast.html | 29 ++ .../MediaStreamTrack-getCapabilities.https.html | 159 +++++++++ .../MediaStreamTrack-getConstraints.https.html | 63 ++++ .../MediaStreamTrack-getSettings-fast.html | 29 ++ .../MediaStreamTrack-getSettings.https.html | 89 +++++ .../detached-HTMLCanvasElement.html | 26 ++ .../mediacapture-image/getPhotoCapabilities.html | 73 ++++ .../tests/mediacapture-image/getPhotoSettings.html | 61 ++++ .../mediacapture-image/getusermedia.https.html | 26 ++ .../tests/mediacapture-image/idlharness.window.js | 25 ++ .../resources/imagecapture-helpers.js | 55 +++ .../tests/mediacapture-image/takePhoto-reject.html | 51 +++ .../takePhoto-with-PhotoSettings.html | 63 ++++ ...Photo-without-PhotoCapabilities.https.window.js | 6 + .../tests/mediacapture-image/takePhoto.html | 61 ++++ 26 files changed, 1824 insertions(+) create mode 100644 testing/web-platform/tests/mediacapture-image/ImageCapture-MediaTrackSupportedConstraints.https.html create mode 100644 testing/web-platform/tests/mediacapture-image/ImageCapture-creation.https.html create mode 100644 testing/web-platform/tests/mediacapture-image/ImageCapture-grabFrame-crash.html create mode 100644 testing/web-platform/tests/mediacapture-image/ImageCapture-grabFrame.html create mode 100644 testing/web-platform/tests/mediacapture-image/ImageCapture-track.html create mode 100644 testing/web-platform/tests/mediacapture-image/META.yml create mode 100644 testing/web-platform/tests/mediacapture-image/MediaStreamTrack-applyConstraints-fast.html create mode 100644 testing/web-platform/tests/mediacapture-image/MediaStreamTrack-applyConstraints-getSettings.https.html create mode 100644 testing/web-platform/tests/mediacapture-image/MediaStreamTrack-applyConstraints-reject.https.html create mode 100644 testing/web-platform/tests/mediacapture-image/MediaStreamTrack-applyConstraints.https.html create mode 100644 testing/web-platform/tests/mediacapture-image/MediaStreamTrack-clone.https.html create mode 100644 testing/web-platform/tests/mediacapture-image/MediaStreamTrack-getCapabilities-fast.html create mode 100644 testing/web-platform/tests/mediacapture-image/MediaStreamTrack-getCapabilities.https.html create mode 100644 testing/web-platform/tests/mediacapture-image/MediaStreamTrack-getConstraints.https.html create mode 100644 testing/web-platform/tests/mediacapture-image/MediaStreamTrack-getSettings-fast.html create mode 100644 testing/web-platform/tests/mediacapture-image/MediaStreamTrack-getSettings.https.html create mode 100644 testing/web-platform/tests/mediacapture-image/detached-HTMLCanvasElement.html create mode 100644 testing/web-platform/tests/mediacapture-image/getPhotoCapabilities.html create mode 100644 testing/web-platform/tests/mediacapture-image/getPhotoSettings.html create mode 100644 testing/web-platform/tests/mediacapture-image/getusermedia.https.html create mode 100644 testing/web-platform/tests/mediacapture-image/idlharness.window.js create mode 100644 testing/web-platform/tests/mediacapture-image/resources/imagecapture-helpers.js create mode 100644 testing/web-platform/tests/mediacapture-image/takePhoto-reject.html create mode 100644 testing/web-platform/tests/mediacapture-image/takePhoto-with-PhotoSettings.html create mode 100644 testing/web-platform/tests/mediacapture-image/takePhoto-without-PhotoCapabilities.https.window.js create mode 100644 testing/web-platform/tests/mediacapture-image/takePhoto.html (limited to 'testing/web-platform/tests/mediacapture-image') diff --git a/testing/web-platform/tests/mediacapture-image/ImageCapture-MediaTrackSupportedConstraints.https.html b/testing/web-platform/tests/mediacapture-image/ImageCapture-MediaTrackSupportedConstraints.https.html new file mode 100644 index 0000000000..fddeb60d0c --- /dev/null +++ b/testing/web-platform/tests/mediacapture-image/ImageCapture-MediaTrackSupportedConstraints.https.html @@ -0,0 +1,29 @@ + + + + diff --git a/testing/web-platform/tests/mediacapture-image/ImageCapture-creation.https.html b/testing/web-platform/tests/mediacapture-image/ImageCapture-creation.https.html new file mode 100644 index 0000000000..81a503893a --- /dev/null +++ b/testing/web-platform/tests/mediacapture-image/ImageCapture-creation.https.html @@ -0,0 +1,100 @@ + + + + + + + diff --git a/testing/web-platform/tests/mediacapture-image/ImageCapture-grabFrame-crash.html b/testing/web-platform/tests/mediacapture-image/ImageCapture-grabFrame-crash.html new file mode 100644 index 0000000000..d4bf57f0fa --- /dev/null +++ b/testing/web-platform/tests/mediacapture-image/ImageCapture-grabFrame-crash.html @@ -0,0 +1,11 @@ + + +Repro of https://crbug.com/1374294 + + diff --git a/testing/web-platform/tests/mediacapture-image/ImageCapture-grabFrame.html b/testing/web-platform/tests/mediacapture-image/ImageCapture-grabFrame.html new file mode 100644 index 0000000000..a9a6930aaf --- /dev/null +++ b/testing/web-platform/tests/mediacapture-image/ImageCapture-grabFrame.html @@ -0,0 +1,46 @@ + + + + + + + + diff --git a/testing/web-platform/tests/mediacapture-image/ImageCapture-track.html b/testing/web-platform/tests/mediacapture-image/ImageCapture-track.html new file mode 100644 index 0000000000..774970ad0c --- /dev/null +++ b/testing/web-platform/tests/mediacapture-image/ImageCapture-track.html @@ -0,0 +1,31 @@ + + +ImageCapture track + + + + + + diff --git a/testing/web-platform/tests/mediacapture-image/META.yml b/testing/web-platform/tests/mediacapture-image/META.yml new file mode 100644 index 0000000000..1b4fef5e5a --- /dev/null +++ b/testing/web-platform/tests/mediacapture-image/META.yml @@ -0,0 +1,4 @@ +spec: https://w3c.github.io/mediacapture-image/ +suggested_reviewers: + - yellowdoge + - reillyeon diff --git a/testing/web-platform/tests/mediacapture-image/MediaStreamTrack-applyConstraints-fast.html b/testing/web-platform/tests/mediacapture-image/MediaStreamTrack-applyConstraints-fast.html new file mode 100644 index 0000000000..7921798017 --- /dev/null +++ b/testing/web-platform/tests/mediacapture-image/MediaStreamTrack-applyConstraints-fast.html @@ -0,0 +1,67 @@ + + + + + + + diff --git a/testing/web-platform/tests/mediacapture-image/MediaStreamTrack-applyConstraints-getSettings.https.html b/testing/web-platform/tests/mediacapture-image/MediaStreamTrack-applyConstraints-getSettings.https.html new file mode 100644 index 0000000000..e18480aae1 --- /dev/null +++ b/testing/web-platform/tests/mediacapture-image/MediaStreamTrack-applyConstraints-getSettings.https.html @@ -0,0 +1,161 @@ + + + + + + + diff --git a/testing/web-platform/tests/mediacapture-image/MediaStreamTrack-applyConstraints-reject.https.html b/testing/web-platform/tests/mediacapture-image/MediaStreamTrack-applyConstraints-reject.https.html new file mode 100644 index 0000000000..0bb4c9f74e --- /dev/null +++ b/testing/web-platform/tests/mediacapture-image/MediaStreamTrack-applyConstraints-reject.https.html @@ -0,0 +1,76 @@ + + + + + + + diff --git a/testing/web-platform/tests/mediacapture-image/MediaStreamTrack-applyConstraints.https.html b/testing/web-platform/tests/mediacapture-image/MediaStreamTrack-applyConstraints.https.html new file mode 100644 index 0000000000..bfbf04afdb --- /dev/null +++ b/testing/web-platform/tests/mediacapture-image/MediaStreamTrack-applyConstraints.https.html @@ -0,0 +1,112 @@ + + + + + + + diff --git a/testing/web-platform/tests/mediacapture-image/MediaStreamTrack-clone.https.html b/testing/web-platform/tests/mediacapture-image/MediaStreamTrack-clone.https.html new file mode 100644 index 0000000000..8945c1d9ea --- /dev/null +++ b/testing/web-platform/tests/mediacapture-image/MediaStreamTrack-clone.https.html @@ -0,0 +1,371 @@ + + + + + + + diff --git a/testing/web-platform/tests/mediacapture-image/MediaStreamTrack-getCapabilities-fast.html b/testing/web-platform/tests/mediacapture-image/MediaStreamTrack-getCapabilities-fast.html new file mode 100644 index 0000000000..391dbb58f0 --- /dev/null +++ b/testing/web-platform/tests/mediacapture-image/MediaStreamTrack-getCapabilities-fast.html @@ -0,0 +1,29 @@ + + + + + + + diff --git a/testing/web-platform/tests/mediacapture-image/MediaStreamTrack-getCapabilities.https.html b/testing/web-platform/tests/mediacapture-image/MediaStreamTrack-getCapabilities.https.html new file mode 100644 index 0000000000..6a4835a475 --- /dev/null +++ b/testing/web-platform/tests/mediacapture-image/MediaStreamTrack-getCapabilities.https.html @@ -0,0 +1,159 @@ + + + + + + + diff --git a/testing/web-platform/tests/mediacapture-image/MediaStreamTrack-getConstraints.https.html b/testing/web-platform/tests/mediacapture-image/MediaStreamTrack-getConstraints.https.html new file mode 100644 index 0000000000..70cd2f2b07 --- /dev/null +++ b/testing/web-platform/tests/mediacapture-image/MediaStreamTrack-getConstraints.https.html @@ -0,0 +1,63 @@ + + + + + + + diff --git a/testing/web-platform/tests/mediacapture-image/MediaStreamTrack-getSettings-fast.html b/testing/web-platform/tests/mediacapture-image/MediaStreamTrack-getSettings-fast.html new file mode 100644 index 0000000000..91c308622c --- /dev/null +++ b/testing/web-platform/tests/mediacapture-image/MediaStreamTrack-getSettings-fast.html @@ -0,0 +1,29 @@ + + + + + + + diff --git a/testing/web-platform/tests/mediacapture-image/MediaStreamTrack-getSettings.https.html b/testing/web-platform/tests/mediacapture-image/MediaStreamTrack-getSettings.https.html new file mode 100644 index 0000000000..bd8a1ea100 --- /dev/null +++ b/testing/web-platform/tests/mediacapture-image/MediaStreamTrack-getSettings.https.html @@ -0,0 +1,89 @@ + + + + + + + diff --git a/testing/web-platform/tests/mediacapture-image/detached-HTMLCanvasElement.html b/testing/web-platform/tests/mediacapture-image/detached-HTMLCanvasElement.html new file mode 100644 index 0000000000..9ccc51f7b1 --- /dev/null +++ b/testing/web-platform/tests/mediacapture-image/detached-HTMLCanvasElement.html @@ -0,0 +1,26 @@ + + + + + + diff --git a/testing/web-platform/tests/mediacapture-image/getPhotoCapabilities.html b/testing/web-platform/tests/mediacapture-image/getPhotoCapabilities.html new file mode 100644 index 0000000000..8b6ab891ff --- /dev/null +++ b/testing/web-platform/tests/mediacapture-image/getPhotoCapabilities.html @@ -0,0 +1,73 @@ + + + + + + + + diff --git a/testing/web-platform/tests/mediacapture-image/getPhotoSettings.html b/testing/web-platform/tests/mediacapture-image/getPhotoSettings.html new file mode 100644 index 0000000000..04a7a5395f --- /dev/null +++ b/testing/web-platform/tests/mediacapture-image/getPhotoSettings.html @@ -0,0 +1,61 @@ + + + + + + + + diff --git a/testing/web-platform/tests/mediacapture-image/getusermedia.https.html b/testing/web-platform/tests/mediacapture-image/getusermedia.https.html new file mode 100644 index 0000000000..033501cf64 --- /dev/null +++ b/testing/web-platform/tests/mediacapture-image/getusermedia.https.html @@ -0,0 +1,26 @@ + + +getUserMedia + + + diff --git a/testing/web-platform/tests/mediacapture-image/idlharness.window.js b/testing/web-platform/tests/mediacapture-image/idlharness.window.js new file mode 100644 index 0000000000..2977138647 --- /dev/null +++ b/testing/web-platform/tests/mediacapture-image/idlharness.window.js @@ -0,0 +1,25 @@ +// META: script=/resources/WebIDLParser.js +// META: script=/resources/idlharness.js +// META: timeout=long + +// https://w3c.github.io/mediacapture-image/ + +'use strict'; + +idl_test( + ['image-capture'], + ['mediacapture-streams', 'html', 'dom'], + idl_array => { + idl_array.add_objects({ + ImageCapture : ['capture'], + }); + + const canvas = document.createElement('canvas'); + document.body.appendChild(canvas); + const context = canvas.getContext("2d"); + context.fillStyle = "red"; + context.fillRect(0, 0, 10, 10); + const track = canvas.captureStream().getVideoTracks()[0]; + self.capture = new ImageCapture(track); + } +); diff --git a/testing/web-platform/tests/mediacapture-image/resources/imagecapture-helpers.js b/testing/web-platform/tests/mediacapture-image/resources/imagecapture-helpers.js new file mode 100644 index 0000000000..8f142cff41 --- /dev/null +++ b/testing/web-platform/tests/mediacapture-image/resources/imagecapture-helpers.js @@ -0,0 +1,55 @@ +'use strict'; + +// These tests rely on the User Agent providing an implementation of +// platform image capture backends. +// +// In Chromium-based browsers this implementation is provided by a polyfill +// in order to reduce the amount of test-only code shipped to users. To enable +// these tests the browser must be run with these options: +// +// --enable-blink-features=MojoJS,MojoJSTest + +async function loadChromiumResources() { + await import('/resources/chromium/mock-imagecapture.js'); +} + +async function initialize_image_capture_tests() { + if (typeof ImageCaptureTest === 'undefined') { + const script = document.createElement('script'); + script.src = '/resources/test-only-api.js'; + script.async = false; + const p = new Promise((resolve, reject) => { + script.onload = () => { resolve(); }; + script.onerror = e => { reject(e); }; + }) + document.head.appendChild(script); + await p; + + if (isChromiumBased) { + await loadChromiumResources(); + } + } + assert_implements(ImageCaptureTest, 'ImageCaptureTest is unavailable'); + let imageCaptureTest = new ImageCaptureTest(); + await imageCaptureTest.initialize(); + return imageCaptureTest; +} + +function image_capture_test(func, name, properties) { + promise_test(async (t) => { + let imageCaptureTest = await initialize_image_capture_tests(); + try { + await func(t, imageCaptureTest); + } finally { + await imageCaptureTest.reset(); + }; + }, name, properties); +} + +function assert_point2d_array_approx_equals(actual, expected, epsilon) { + assert_equals(actual.length, expected.length, 'length'); + for (var i = 0; i < actual.length; ++i) { + assert_approx_equals(actual[i].x, expected[i].x, epsilon, 'x'); + assert_approx_equals(actual[i].y, expected[i].y, epsilon, 'y'); + } +} diff --git a/testing/web-platform/tests/mediacapture-image/takePhoto-reject.html b/testing/web-platform/tests/mediacapture-image/takePhoto-reject.html new file mode 100644 index 0000000000..fff36e1a3b --- /dev/null +++ b/testing/web-platform/tests/mediacapture-image/takePhoto-reject.html @@ -0,0 +1,51 @@ + + + + + + + + diff --git a/testing/web-platform/tests/mediacapture-image/takePhoto-with-PhotoSettings.html b/testing/web-platform/tests/mediacapture-image/takePhoto-with-PhotoSettings.html new file mode 100644 index 0000000000..2946e782d0 --- /dev/null +++ b/testing/web-platform/tests/mediacapture-image/takePhoto-with-PhotoSettings.html @@ -0,0 +1,63 @@ + + + + + + + + diff --git a/testing/web-platform/tests/mediacapture-image/takePhoto-without-PhotoCapabilities.https.window.js b/testing/web-platform/tests/mediacapture-image/takePhoto-without-PhotoCapabilities.https.window.js new file mode 100644 index 0000000000..96eb253ccd --- /dev/null +++ b/testing/web-platform/tests/mediacapture-image/takePhoto-without-PhotoCapabilities.https.window.js @@ -0,0 +1,6 @@ +promise_test(async t => { + const track = new MediaStreamTrackGenerator('video'); + const capturer = new ImageCapture(track); + const settings = await capturer.getPhotoSettings(); + await promise_rejects_dom(t, 'UnknownError', capturer.takePhoto(settings)); +}, 'exercise takePhoto() on a track without PhotoCapabilities'); diff --git a/testing/web-platform/tests/mediacapture-image/takePhoto.html b/testing/web-platform/tests/mediacapture-image/takePhoto.html new file mode 100644 index 0000000000..44586406c4 --- /dev/null +++ b/testing/web-platform/tests/mediacapture-image/takePhoto.html @@ -0,0 +1,61 @@ + + + + + + + + -- cgit v1.2.3