idlharness.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Media Capabilities IDL tests</title>
<link rel="help" href="https://wicg.github.io/media-capabilities/"/>
<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>
<h1>Media Session IDL tests</h1>
<pre id='untested_idl' style='display:none'>
[PrimaryGlobal]
interface Window {
};
interface Worker {
};
interface Navigator {
};
interface WorkerNavigator {
};
</pre>
<pre id='idl'>
dictionary MediaConfiguration {
required MediaConfigurationType type;
VideoConfiguration video;
AudioConfiguration audio;
};
enum MediaConfigurationType {
"file",
"media-source",
};
dictionary VideoConfiguration {
required DOMString contentType;
required unsigned long width;
required unsigned long height;
required unsigned long bitrate;
required double framerate;
};
dictionary AudioConfiguration {
required DOMString contentType;
DOMString channels;
unsigned long bitrate;
unsigned long samplerate;
};
interface MediaDecodingAbility {
readonly attribute boolean supported;
readonly attribute boolean smooth;
readonly attribute boolean powerEfficient;
};
[Exposed=(Window)]
partial interface Navigator {
[SameObject] readonly attribute MediaCapabilities mediaCapabilities;
};
[Exposed=(Worker)]
partial interface WorkerNavigator {
[SameObject] readonly attribute MediaCapabilities mediaCapabilities;
};
[Exposed=(Window, Worker)]
interface MediaCapabilities {
Promise<MediaDecodingAbility> query(MediaConfiguration configuration);
};
</pre>
<script>
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({
Navigator: ["navigator"]
});
idl_array.test();
</script>
<div id="log"></div>
</body>
</html>