idlharness.window.js (1149B)
1 // META: script=/resources/WebIDLParser.js 2 // META: script=/resources/idlharness.js 3 4 'use strict'; 5 6 // https://w3c.github.io/mediacapture-record/ 7 8 idl_test( 9 ['mediastream-recording'], 10 ['mediacapture-streams', 'FileAPI', 'html', 'dom', 'webidl'], 11 idl_array => { 12 // Ignored errors will be surfaced in idlharness.js's test_object below. 13 let recorder, blob, error; 14 try { 15 const canvas = document.createElement('canvas'); 16 document.body.appendChild(canvas); 17 const context = canvas.getContext("2d"); 18 context.fillStyle = "red"; 19 context.fillRect(0, 0, 10, 10); 20 const stream = canvas.captureStream(); 21 recorder = new MediaRecorder(stream); 22 } catch(e) {} 23 idl_array.add_objects({ MediaRecorder: [recorder] }); 24 25 try { 26 blob = new BlobEvent("type", { 27 data: new Blob(), 28 timecode: performance.now(), 29 }); 30 } catch(e) {} 31 idl_array.add_objects({ BlobEvent: [blob] }); 32 33 try { 34 error = new MediaRecorderErrorEvent("type", { 35 error: new DOMException, 36 }); 37 } catch(e) {} 38 idl_array.add_objects({ MediaRecorderErrorEvent: [error] }); 39 } 40 );