OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <meta charset="utf-8"> | 2 <meta charset="utf-8"> |
3 <title>RTCPeerConnectionIceEvent constructor</title> | 3 <title>RTCPeerConnectionIceEvent constructor</title> |
4 <script src="../../resources/testharness.js"></script> | 4 <script src="/resources/testharness.js"></script> |
5 <script src="../../resources/testharnessreport.js"></script> | 5 <script src="/resources/testharnessreport.js"></script> |
6 <script> | 6 <script> |
7 test(function() { | 7 test(function() { |
8 assert_equals(RTCPeerConnectionIceEvent.length, 1); | 8 assert_equals(RTCPeerConnectionIceEvent.length, 1); |
9 var e = new RTCPeerConnectionIceEvent('type'); | 9 var e = new RTCPeerConnectionIceEvent('type'); |
10 assert_equals(e.candidate, null); | 10 assert_equals(e.candidate, null); |
11 assert_false(e.bubbles); | 11 assert_false(e.bubbles); |
12 assert_false(e.cancelable); | 12 assert_false(e.cancelable); |
13 }, 'RTCPeerConnectionIceEvent constructor with no candidate attribute provided')
; | 13 }, 'RTCPeerConnectionIceEvent constructor with no candidate provided.'); |
14 | 14 |
15 test(function() { | 15 test(function() { |
16 var e = new RTCPeerConnectionIceEvent('type', { candidate: null }); | 16 var e = new RTCPeerConnectionIceEvent('type', { candidate: null }); |
17 assert_equals(e.candidate, null); | 17 assert_equals(e.candidate, null); |
18 }, 'RTCPeerConnectionIceEvent constructor with cnadidate passed as null.'); | 18 }, 'RTCPeerConnectionIceEvent constructor with candidate passed as null.'); |
19 | 19 |
20 test(function() { | 20 test(function() { |
21 var e = new RTCPeerConnectionIceEvent('type', { candidate: undefined }); | 21 var e = new RTCPeerConnectionIceEvent('type', { candidate: undefined }); |
22 assert_equals(e.candidate, null); | 22 assert_equals(e.candidate, null); |
23 }, 'RTCPeerConnectionIceEvent constructor with candidate passed as "undefined".'
); | 23 }, 'RTCPeerConnectionIceEvent constructor with candidate passed as undefined.'); |
24 | 24 |
25 test(function() { | 25 test(function() { |
26 var c = new RTCIceCandidate({ candidate: 'candidate', sdpMid: 'sdpMid', sdpMLi
neIndex: 1 }); | 26 var c = new RTCIceCandidate({ candidate: 'candidate', sdpMid: 'sdpMid', sdpMLi
neIndex: 1 }); |
27 var e = new RTCPeerConnectionIceEvent('type', { candidate: c, url: 'url', bubb
les: true, cancelable: true}); | 27 var e = new RTCPeerConnectionIceEvent('type', { candidate: c, url: 'url', bubb
les: true, cancelable: true}); |
28 assert_equals(e.type, 'type'); | 28 assert_equals(e.type, 'type'); |
29 assert_equals(e.candidate, c); | 29 assert_equals(e.candidate, c); |
30 // TODO(lunalu): When url is added to RTCPeerConnectionIceEventInitializer, | 30 // assert_equals(e.url, 'url'); |
31 // update the assertion to be: "assert_equals(e.url, 'url);". | |
32 assert_equals(e.url, undefined); | |
33 assert_true(e.bubbles); | 31 assert_true(e.bubbles); |
34 assert_true(e.cancelable); | 32 assert_true(e.cancelable); |
35 }, 'RTCPeerConnectionIceEvent constructor with full arguments.'); | 33 }, 'RTCPeerConnectionIceEvent constructor with full arguments.'); |
36 </script> | 34 </script> |
OLD | NEW |