idlharness.https.window.js (647B)
1 // META: script=/resources/WebIDLParser.js 2 // META: script=/resources/idlharness.js 3 // META: timeout=long 4 5 // https://w3c.github.io/mediacapture-image/ 6 7 'use strict'; 8 9 idl_test( 10 ['image-capture'], 11 ['mediacapture-streams', 'html', 'dom'], 12 idl_array => { 13 idl_array.add_objects({ 14 ImageCapture : ['capture'], 15 }); 16 17 const canvas = document.createElement('canvas'); 18 document.body.appendChild(canvas); 19 const context = canvas.getContext("2d"); 20 context.fillStyle = "red"; 21 context.fillRect(0, 0, 10, 10); 22 const track = canvas.captureStream().getVideoTracks()[0]; 23 self.capture = new ImageCapture(track); 24 } 25 );