Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnectionIceEvent-constructor.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnectionIceEvent-constructor.html b/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnectionIceEvent-constructor.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5c13041654e49825a57a79bd5c4463e9c497dd1e |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnectionIceEvent-constructor.html |
| @@ -0,0 +1,35 @@ |
| +<!DOCTYPE html> |
| +<meta charset="utf-8"> |
| +<title>RTCPeerConnectionIceEvent constructor</title> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| +<script> |
| +test(function() { |
| + assert_equals(RTCPeerConnectionIceEvent.length, 1); |
| + var e = new RTCPeerConnectionIceEvent('type'); |
| + assert_equals(e.candidate, null); |
| + assert_false(e.bubbles); |
| + assert_false(e.cancelable); |
| +}, 'RTCPeerConnectionIceEvent constructor with no candidate attribute provided'); |
| + |
| +test(function() { |
| + var e = new RTCPeerConnectionIceEvent('type', { candidate: null }); |
| + assert_equals(e.candidate, null); |
| +}, 'RTCPeerConnectionIceEvent constructor with cnadidate paased as null.'); |
|
foolip
2016/11/15 19:15:21
s/cnadidate paased/candidate passed/
lunalu1
2016/11/15 19:27:01
Done.
|
| + |
| +test(function() { |
| + var e = new RTCPeerConnectionIceEvent('type', { candidate: undefined }); |
| + assert_equals(e.candidate, null); |
| +}, 'RTCPeerConnectionIceEvent constructor with candidate paased as "undefined".'); |
|
foolip
2016/11/15 19:15:21
s/paased/passed/
lunalu1
2016/11/15 19:27:01
Done.
|
| + |
| +test(function() { |
| + var c = new RTCIceCandidate({ candidate: 'candidate', sdpMid: 'sdpMid', sdpMLineIndex: 1 }); |
| + var e = new RTCPeerConnectionIceEvent('type', { candidate: c, url: 'url', bubbles: true, cancelable: true}); |
| + assert_equals(e.candidate, c); |
|
foolip
2016/11/15 19:15:21
Also assert_equals(e.type, 'type') in at least one
lunalu1
2016/11/15 19:27:01
Done.
|
| + // TODO(lunalu): When url is added to RTCPeerConnectionIceEventInitializer, |
| + // update the assertion to be: "assert_equals(e.url, 'url);". |
| + assert_equals(e.url, undefined); |
| + assert_true(e.bubbles); |
| + assert_true(e.cancelable); |
| +}, 'RTCPeerConnectionIceEvent constructor with full arguments.'); |
| +</script> |