mirror of
https://github.com/servo/servo.git
synced 2025-09-03 03:28:20 +01:00
Update web-platform-tests to revision 58eb04cecbbec2e18531ab440225e38944a9c444
This commit is contained in:
parent
25e8bf69e6
commit
665817d2a6
35333 changed files with 1818077 additions and 16036 deletions
|
@ -0,0 +1,99 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset=utf-8>
|
||||
<title>Media Recorder IDL test</title>
|
||||
<link rel="help" href="https://w3c.github.io/mediacapture-record/MediaRecorder.html">
|
||||
<link rel="idl" href="https://w3c.github.io/mediacapture-record/MediaRecorder.html#idl-index">
|
||||
<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>
|
||||
<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>
|
||||
var canvas = document.getElementById('canvas');
|
||||
var context = canvas.getContext("2d");
|
||||
context.fillStyle = "red";
|
||||
context.fillRect(0, 0, 10, 10);
|
||||
var stream = canvas.captureStream();
|
||||
|
||||
var idl_array = new IdlArray();
|
||||
idl_array.add_untested_idls(document.getElementById("untested_idl").textContent);
|
||||
idl_array.add_idls(document.getElementById("idl").textContent);
|
||||
idl_array.add_objects({
|
||||
MediaRecorder: [new MediaRecorder(stream)],
|
||||
});
|
||||
idl_array.test();
|
||||
</script>
|
||||
<div id="log"></div>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue