mirror of
https://github.com/servo/servo.git
synced 2025-09-01 02:28:21 +01:00
Update web-platform-tests to revision 4333a1d2f109795547fc5e22ebfc8481fa649de7
This commit is contained in:
parent
728ebcc932
commit
8c46b67f8e
456 changed files with 10561 additions and 5108 deletions
|
@ -12,76 +12,11 @@
|
|||
</head>
|
||||
<body>
|
||||
<canvas id='canvas' width=10 height=10/>
|
||||
|
||||
<pre id="untested_idl" style="display: none">
|
||||
interface Event {};
|
||||
interface EventHandler {};
|
||||
interface EventTarget {};
|
||||
interface MediaStream {};
|
||||
</pre>
|
||||
<pre id="idl" style="display: none">
|
||||
// https://w3c.github.io/mediacapture-record/MediaRecorder.html
|
||||
|
||||
[Constructor(MediaStream stream, optional MediaRecorderOptions options)]
|
||||
interface MediaRecorder : EventTarget {
|
||||
readonly attribute MediaStream stream;
|
||||
readonly attribute DOMString mimeType;
|
||||
readonly attribute RecordingState state;
|
||||
attribute EventHandler onstart;
|
||||
attribute EventHandler onstop;
|
||||
attribute EventHandler ondataavailable;
|
||||
attribute EventHandler onpause;
|
||||
attribute EventHandler onresume;
|
||||
attribute EventHandler onerror;
|
||||
readonly attribute unsigned long videoBitsPerSecond;
|
||||
readonly attribute unsigned long audioBitsPerSecond;
|
||||
|
||||
void start(optional long timeslice);
|
||||
void stop();
|
||||
void pause();
|
||||
void resume();
|
||||
void requestData();
|
||||
|
||||
static boolean isTypeSupported(DOMString type);
|
||||
};
|
||||
|
||||
dictionary MediaRecorderOptions {
|
||||
DOMString mimeType;
|
||||
unsigned long audioBitsPerSecond;
|
||||
unsigned long videoBitsPerSecond;
|
||||
unsigned long bitsPerSecond;
|
||||
};
|
||||
|
||||
enum RecordingState {
|
||||
"inactive",
|
||||
"recording",
|
||||
"paused"
|
||||
};
|
||||
|
||||
[Constructor(DOMString type, BlobEventInit eventInitDict)]
|
||||
interface BlobEvent : Event {
|
||||
[SameObject] readonly attribute Blob data;
|
||||
readonly attribute DOMHighResTimeStamp timecode;
|
||||
};
|
||||
|
||||
dictionary BlobEventInit {
|
||||
required Blob data;
|
||||
DOMHighResTimeStamp timecode;
|
||||
};
|
||||
|
||||
dictionary MediaRecorderErrorEventInit : EventInit {
|
||||
required DOMException error;
|
||||
};
|
||||
|
||||
[Exposed=Window, Constructor(DOMString type, MediaRecorderErrorEventInit eventInitDict)]
|
||||
interface MediaRecorderErrorEvent : Event {
|
||||
[SameObject] readonly attribute DOMException error;
|
||||
};
|
||||
|
||||
</pre>
|
||||
<script>
|
||||
promise_test(async function() {
|
||||
const dom = await fetch('/interfaces/dom.idl').then(r => r.text());
|
||||
promise_test(async () => {
|
||||
const srcs = ['mediacapture-record', 'mediacapture-main', 'html', 'dom'];
|
||||
const [idl, main, html, dom] = await Promise.all(
|
||||
srcs.map(i => fetch(`/interfaces/${i}.idl`).then(r => r.text())));
|
||||
|
||||
var canvas = document.getElementById('canvas');
|
||||
var context = canvas.getContext("2d");
|
||||
|
@ -90,9 +25,10 @@
|
|||
var stream = canvas.captureStream();
|
||||
|
||||
var idl_array = new IdlArray();
|
||||
idl_array.add_untested_idls(dom, { only: ['EventInit'] });
|
||||
idl_array.add_untested_idls(document.getElementById("untested_idl").textContent);
|
||||
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);
|
||||
idl_array.add_objects({
|
||||
MediaRecorder: [new MediaRecorder(stream)],
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue