<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<title>Media Capture from DOM Elements IDL test</title>
<link rel="help" href="https://w3c.github.io/mediacapture-fromelement/">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/WebIDLParser.js"></script>
<script src="/resources/idlharness.js"></script>
</head>
<body>
<media id='media' width=10 height=10/>
<canvas id='canvas' width=10 height=10/>
<script>
'use strict';
promise_test(async () => {
const srcs = ['mediacapture-fromelement', 'mediacapture-main', 'html', 'dom'];
const [idl, main, html, dom] = await Promise.all(
srcs.map(i => fetch(`/interfaces/${i}.idl`).then(r => r.text())));
var idl_array = new IdlArray();
idl_array.add_idls(idl);
idl_array.add_dependency_idls(main);
idl_array.add_dependency_idls(html);
idl_array.add_dependency_idls(dom);
idl_array.add_objects({
HTMLMediaElement: ['document.getElementById("media")'],
HTMLCanvasElement: ['document.getElementById("canvas")'],
CanvasCaptureMediaStreamTrack: ['canvas.captureStream().getTracks()[0]'],
});
idl_array.test();
}, 'Test mediacapture-fromelement IDL interfaces');
</script>
<div id="log"></div>
</body>
</html>