mirror of
https://github.com/servo/servo.git
synced 2025-06-30 12:03:38 +01:00
52 lines
1.9 KiB
HTML
52 lines
1.9 KiB
HTML
<!doctype html>
|
|
<title>MediaStreamTrack IDL tests</title>
|
|
<link rel="help" href="https://w3c.github.io/mediacapture-main/#media-stream-track-interface-definition">
|
|
<script src=/resources/testharness.js></script>
|
|
<script src=/resources/testharnessreport.js></script>
|
|
<script src=/resources/WebIDLParser.js></script>
|
|
<script src=/resources/idlharness.js></script>
|
|
<script>
|
|
function idl_test([dom_idl, stream]) {
|
|
const idl_array = new IdlArray();
|
|
|
|
idl_array.add_untested_idls(dom_idl);
|
|
idl_array.add_untested_idls('interface EventHandler {};');
|
|
idl_array.add_idls("interface MediaStreamTrack : EventTarget {\
|
|
readonly attribute DOMString kind;\
|
|
readonly attribute DOMString id;\
|
|
readonly attribute DOMString label;\
|
|
attribute boolean enabled;\
|
|
readonly attribute boolean muted;\
|
|
attribute EventHandler onmute;\
|
|
attribute EventHandler onunmute;\
|
|
readonly attribute MediaStreamTrackState readyState;\
|
|
attribute EventHandler onended;\
|
|
attribute EventHandler onoverconstrained;\
|
|
MediaStreamTrack clone ();\
|
|
void stop ();\
|
|
MediaTrackCapabilities getCapabilities ();\
|
|
MediaTrackConstraints getConstraints ();\
|
|
MediaTrackSettings getSettings ();\
|
|
Promise<void> applyConstraints (optional MediaTrackConstraints constraints);\
|
|
};\
|
|
\
|
|
enum MediaStreamTrackState {\
|
|
\"live\",\
|
|
\"ended\"\
|
|
};");
|
|
|
|
self.track = stream.getTracks()[0];
|
|
idl_array.add_objects({MediaStreamTrack: ["track"]});
|
|
|
|
idl_array.test();
|
|
}
|
|
|
|
promise_test(() => {
|
|
return Promise.all([
|
|
fetch("/interfaces/dom.idl").then(response => response.text()),
|
|
navigator.mediaDevices.getUserMedia({audio: true}),
|
|
]).then(idl_test);
|
|
}, "Test driver")
|
|
</script>
|
|
</body>
|
|
</html>
|