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..f2745dbdc15f6b03054b2eef336fdf55f7892264 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnectionIceEvent-constructor.html |
@@ -0,0 +1,36 @@ |
+<!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); |
+ // TODO(lunalu): default for e.url should be "null" instead of "undefined". |
foolip
2016/11/11 21:22:05
I think this is OK so that this test must be updat
lunalu1
2016/11/15 18:09:24
Done.
|
+ assert_equals(e.url, undefined); |
+ assert_false(e.bubbles); |
+ assert_false(e.cancelable); |
+}, 'RTCPeerConnectionIceEvent constructor with no candidate attribute provivded'); |
+ |
+test(function() { |
+ var e = new RTCPeerConnectionIceEvent('type', { candidate: null }); |
+ assert_equals(e.candidate, null); |
+}, 'RTCPeerConnectionIceEvent constructor with cnadidate paased as "null".'); |
+ |
+test(function() { |
+ var e = new RTCPeerConnectionIceEvent('type', { candidate: undefined }); |
+ // TODO(lunalu): should be "undefined" instead of "null". |
foolip
2016/11/11 21:22:05
Actually, null is correct. The reason is a bit nua
lunalu1
2016/11/15 18:09:24
Done.
|
+ assert_equals(e.candidate, null); |
+}, 'RTCPeerConnectionIceEvent constructor with candidate paased as "undefined".'); |
+ |
+test(function() { |
+ var c = new RTCIceCandidate({ candidate: 'candidate', sdpMid: 'sdpMid', sdpMLineIndex: 1 }); |
foolip
2016/11/11 21:22:05
Unrelated: A look at RTCIceCandidate.idl shows tha
lunalu1
2016/11/15 18:09:24
Done.
|
+ var e = new RTCPeerConnectionIceEvent('type', { candidate: c, url: 'url', bubbles: true, cancelable: true}); |
+ assert_equals(e.candidate, c); |
+ assert_equals(e.url, undefined); |
+ assert_true(e.bubbles); |
+ assert_true(e.cancelable); |
+}, 'RTCPeerConnectionIceEvent constructor with full arguments.'); |
+</script> |