Skip to content

Commit

Permalink
Auto-update the mediacapture-fromelement IDL file (#11575)
Browse files Browse the repository at this point in the history
* Add mediacapture-fromelement IDL file
* Change test to use that IDL file
  • Loading branch information
lukebjerring authored and foolip committed Jun 19, 2018
1 parent 432a9ab commit 0b687e0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 21 deletions.
16 changes: 16 additions & 0 deletions interfaces/mediacapture-fromelement.idl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// GENERATED CONTENT - DO NOT EDIT
// Content of this file was automatically extracted from the
// "Media Capture from DOM Elements" spec.
// See: https://w3c.github.io/mediacapture-fromelement/

partial interface HTMLMediaElement {
MediaStream captureStream();
};
partial interface HTMLCanvasElement {
MediaStream captureStream(optional double frameRequestRate);
};
[Exposed=Window]
interface CanvasCaptureMediaStreamTrack : MediaStreamTrack {
readonly attribute HTMLCanvasElement canvas;
void requestFrame();
};
25 changes: 4 additions & 21 deletions mediacapture-fromelement/idlharness.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,16 @@
<media id='media' width=10 height=10/>
<canvas id='canvas' width=10 height=10/>

<pre id="idl" style="display: none">
// https://w3c.github.io/mediacapture-fromelement/

partial interface HTMLMediaElement {
MediaStream captureStream();
};

partial interface HTMLCanvasElement {
MediaStream captureStream(optional double frameRequestRate);
};

interface CanvasCaptureMediaStreamTrack : MediaStreamTrack {
readonly attribute HTMLCanvasElement canvas;
void requestFrame();
};

</pre>
<script>
'use strict';

promise_test(async () => {
const main = await fetch('/interfaces/mediacapture-main.idl').then(r => r.text());
const html = await fetch('/interfaces/html.idl').then(r => r.text());
const dom = await fetch('/interfaces/dom.idl').then(r => r.text());
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(document.getElementById("idl").textContent);
idl_array.add_idls(idl);
idl_array.add_dependency_idls(main);
idl_array.add_dependency_idls(html);
idl_array.add_dependency_idls(dom);
Expand Down

0 comments on commit 0b687e0

Please sign in to comment.