blob: ea2dd2a3df989cc3f30866ad780b77bf7357c7f7 [file] [log] [blame]
Dominique Hazael-Massieux787fd0d2017-01-25 13:01:591<!doctype html>
2<!--
3This test creates a data channel object and compares it with the WebIDL defined interface
4-->
5
6<html>
7<head>
8 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
9 <title>RTCPeerConnection Data Channel Empty String Test</title>
10 <link rel="author" title="Dominique Hazael-Massieux" href="mailto:dom@w3.org"/>
11 <link rel="help" href="http://w3c.github.io/webrtc-pc/#rtcdatachannel">
12</head>
13<body>
14 <div id="log"></div>
15 <!-- These files are in place when executing on W3C. -->
16 <script src="/resources/testharness.js"></script>
17 <script src="/resources/testharnessreport.js"></script>
18 <script src=/resources/WebIDLParser.js></script>
19 <script src=/resources/idlharness.js></script>
20 <!-- The IDL is copied from https://w3c.github.io/webrtc-pc/archives/20161219/webrtc.html -->
21 <script type="text/plain">
22interface RTCDataChannel : EventTarget {
23 readonly attribute USVString label;
24 readonly attribute boolean ordered;
25 readonly attribute unsigned short? maxPacketLifeTime;
26 readonly attribute unsigned short? maxRetransmits;
27 readonly attribute USVString protocol;
28 readonly attribute boolean negotiated;
29 readonly attribute unsigned short id;
30 readonly attribute RTCPriorityType priority;
31 readonly attribute RTCDataChannelState readyState;
32 readonly attribute unsigned long bufferedAmount;
33 attribute unsigned long bufferedAmountLowThreshold;
34 attribute EventHandler onopen;
35 attribute EventHandler onbufferedamountlow;
36 attribute EventHandler onerror;
37 attribute EventHandler onclose;
38 void close();
39 attribute EventHandler onmessage;
40 attribute DOMString binaryType;
41 void send(USVString data);
42 void send(Blob data);
43 void send(ArrayBuffer data);
44 void send(ArrayBufferView data);
45};
46enum RTCPriorityType {
47 "very-low",
48 "low",
49 "medium",
50 "high"
51};
52enum RTCDataChannelState {
53 "connecting",
54 "open",
55 "closing",
56 "closed"
57};
58</script>
59 <script type="text/javascript">
60 (function() {
61 var idl_array = new IdlArray();
62 [].forEach.call(document.querySelectorAll("script[type=text\\/plain]"),
63 function(node) {
64 idl_array.add_idls(node.textContent);
65 });
66 pc = new RTCPeerConnection(null);
67 window.channel = pc.createDataChannel("test");
68 idl_array.add_objects({"RTCDataChannel": ["channel"]});
69 idl_array.test();
70 done();
71})();
72</script>
73</body>
74</html>
75