summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl.html
blob: 298cfb5cae58532a0eb0fab69ba790e833064e25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<!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>