3 <title>RTCPeerConnection.prototype.ondatachannel
</title>
4 <script src=
"/resources/testharness.js"></script>
5 <script src=
"/resources/testharnessreport.js"></script>
6 <script src=
"../webrtc/RTCPeerConnection-helper.js"></script>
10 promise_test(async (t
) => {
11 const resolver
= new Resolver();
12 const pc1
= new RTCPeerConnection();
13 const pc2
= new RTCPeerConnection();
14 t
.add_cleanup(() => pc1
.close());
15 t
.add_cleanup(() => pc2
.close());
17 const dc1
= pc1
.createDataChannel('test', {
24 assert_equals(dc1
.priority
, 'high');
26 pc2
.ondatachannel
= t
.step_func((event
) => {
27 const dc2
= event
.channel
;
29 assert_equals(dc2
.priority
, 'high');
34 exchangeIceCandidates(pc1
, pc2
);
35 await
exchangeOfferAnswer(pc1
, pc2
);
38 }, 'In-band negotiated channel created on remote peer should match the same configuration as local ' +
41 promise_test(async (t
) => {
42 const resolver
= new Resolver();
43 const pc1
= new RTCPeerConnection();
44 const pc2
= new RTCPeerConnection();
45 t
.add_cleanup(() => pc1
.close());
46 t
.add_cleanup(() => pc2
.close());
48 const dc1
= pc1
.createDataChannel('');
50 assert_equals(dc1
.priority
, 'low');
52 pc2
.ondatachannel
= t
.step_func((event
) => {
53 const dc2
= event
.channel
;
54 assert_equals(dc2
.priority
, 'low');
59 exchangeIceCandidates(pc1
, pc2
);
60 await
exchangeOfferAnswer(pc1
, pc2
);
63 }, 'In-band negotiated channel created on remote peer should match the same (default) ' +
64 'configuration as local peer');