diff --git a/testing/web-platform/meta/MANIFEST.json b/testing/web-platform/meta/MANIFEST.json index 244f0d4494ed..2a5d2568a233 100644 --- a/testing/web-platform/meta/MANIFEST.json +++ b/testing/web-platform/meta/MANIFEST.json @@ -353923,9 +353923,9 @@ {} ] ], - "mediacapture-image/idlharness.html": [ + "mediacapture-image/idlharness.window.js": [ [ - "/mediacapture-image/idlharness.html", + "/mediacapture-image/idlharness.window.html", {} ] ], @@ -593998,8 +593998,8 @@ "0e0b75556b814c4d95b6bbefa19597d7f618467d", "support" ], - "mediacapture-image/idlharness.html": [ - "ad2c957734eb67577ef3e50f95984eeb999f4743", + "mediacapture-image/idlharness.window.js": [ + "2a422e686bd462ea9cf1d8718becac291e3da2e9", "testharness" ], "mediacapture-record/BlobEvent-constructor.html": [ diff --git a/testing/web-platform/tests/mediacapture-image/idlharness.html b/testing/web-platform/tests/mediacapture-image/idlharness.html deleted file mode 100644 index 40888f0b59e8..000000000000 --- a/testing/web-platform/tests/mediacapture-image/idlharness.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - Image Capture IDL test - - - - - - - - - - - -
- - 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 000000000000..0c06405aba88 --- /dev/null +++ b/testing/web-platform/tests/mediacapture-image/idlharness.window.js @@ -0,0 +1,27 @@ +// META: script=/resources/WebIDLParser.js +// META: script=/resources/idlharness.js + +// https://w3c.github.io/mediacapture-image/ + +'use strict'; + +idl_test( + ['image-capture'], + ['mediacapture-streams', 'html', 'dom'], + async idl_array => { + idl_array.add_objects({ + ImageCapture : ['capture'], + PhotoCapabilities: ['capabilities'], + }); + + 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); + self.capabilities = await capture.getPhotoCapabilities(); + }, + 'Test mediacapture-image IDL interfaces' +);