gecko-dev/testing/web-platform/tests/webrtc/RTCPeerConnection-idl.html

108 строки
5.0 KiB
HTML

<!doctype html>
<html>
<head>
<meta charset=utf-8>
<title>IDL check of RTCPeerConnection</title>
<link rel="author" title="Harald Alvestrand" href="mailto:hta@google.com"/>
<link rel="help" href="http://w3c.github.io/webrtc-pc/#rtcpeerconnection-interface">
</head>
<body>
<h1 class="instructions">Description</h1>
<p class="instructions">This test verifies the availability of the RTCPeerConnection interface.</p>
<div id='log'></div>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/resources/WebIDLParser.js></script>
<script src=/resources/idlharness.js></script>
<!-- The IDL is copied from the 22 September 2015 editors' draft. -->
<script type="text/plain">
interface EventTarget {
// Only a dummy definition is needed here.
};
[ Constructor (optional RTCConfiguration configuration)]
interface RTCPeerConnection : EventTarget {
Promise<RTCSessionDescription> createOffer (optional RTCOfferOptions options);
Promise<RTCSessionDescription> createAnswer (optional RTCAnswerOptions options);
Promise<void> setLocalDescription (RTCSessionDescription description);
readonly attribute RTCSessionDescription? localDescription;
readonly attribute RTCSessionDescription? currentLocalDescription;
readonly attribute RTCSessionDescription? pendingLocalDescription;
Promise<void> setRemoteDescription (RTCSessionDescription description);
readonly attribute RTCSessionDescription? remoteDescription;
readonly attribute RTCSessionDescription? currentRemoteDescription;
readonly attribute RTCSessionDescription? pendingRemoteDescription;
Promise<void> addIceCandidate (RTCIceCandidate candidate);
readonly attribute RTCSignalingState signalingState;
readonly attribute RTCIceGatheringState iceGatheringState;
readonly attribute RTCIceConnectionState iceConnectionState;
readonly attribute boolean? canTrickleIceCandidates;
RTCConfiguration getConfiguration ();
void setConfiguration (RTCConfiguration configuration);
void close ();
attribute EventHandler onnegotiationneeded;
attribute EventHandler onicecandidate;
attribute EventHandler onsignalingstatechange;
attribute EventHandler oniceconnectionstatechange;
attribute EventHandler onicegatheringstatechange;
};
partial interface RTCPeerConnection {
void createOffer (RTCSessionDescriptionCallback successCallback, RTCPeerConnectionErrorCallback failureCallback, optional RTCOfferOptions options);
void setLocalDescription (RTCSessionDescription description, VoidFunction successCallback, RTCPeerConnectionErrorCallback failureCallback);
void createAnswer (RTCSessionDescriptionCallback successCallback, RTCPeerConnectionErrorCallback failureCallback);
void setRemoteDescription (RTCSessionDescription description, VoidFunction successCallback, RTCPeerConnectionErrorCallback failureCallback);
void addIceCandidate (RTCIceCandidate candidate, VoidFunction successCallback, RTCPeerConnectionErrorCallback failureCallback);
void getStats (MediaStreamTrack? selector, RTCStatsCallback successCallback, RTCPeerConnectionErrorCallback failureCallback);
};
partial interface RTCPeerConnection {
static Promise<RTCCertificate> generateCertificate (AlgorithmIdentifier keygenAlgorithm);
};
partial interface RTCPeerConnection {
sequence<RTCRtpSender> getSenders ();
sequence<RTCRtpReceiver> getReceivers ();
RTCRtpSender addTrack (MediaStreamTrack track, MediaStream... streams);
void removeTrack (RTCRtpSender sender);
attribute EventHandler ontrack;
};
partial interface RTCPeerConnection {
RTCDataChannel createDataChannel ([TreatNullAs=EmptyString] DOMString label, optional RTCDataChannelInit dataChannelDict);
attribute EventHandler ondatachannel;
};
partial interface RTCPeerConnection {
readonly attribute RTCDTMFSender? dtmf;
};
partial interface RTCPeerConnection {
Promise<RTCStatsReport> getStats (optional MediaStreamTrack? selector);
};
partial interface RTCPeerConnection {
void setIdentityProvider (DOMString provider, optional DOMString protocol, optional DOMString usernameHint);
Promise<DOMString> getIdentityAssertion ();
readonly attribute Promise<RTCIdentityAssertion> peerIdentity;
readonly attribute DOMString? idpLoginUrl;
};
</script>
<script>
(function() {
var idl_array = new IdlArray();
[].forEach.call(document.querySelectorAll("script[type=text\\/plain]"),
function(node) {
idl_array.add_idls(node.textContent);
});
window.pc = new RTCPeerConnection(null);
idl_array.add_objects({"RTCPeerConnection": ["pc"]});
idl_array.test();
done();
})();
</script>
</body>
</html>