mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +01:00
Update web-platform-tests to revision 3137d1d2d7757366a69f8a449b458b5057e0e81e
This commit is contained in:
parent
81ca858678
commit
d6ba94ca28
2339 changed files with 89274 additions and 9328 deletions
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>RTCDataChannelEvent constructor</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(RTCDataChannelEvent.length, 2);
|
||||
assert_throws(
|
||||
new TypeError(),
|
||||
function() { new RTCDataChannelEvent('type'); }
|
||||
);
|
||||
}, 'RTCDataChannelEvent constructor without a required argument.');
|
||||
|
||||
test(function() {
|
||||
assert_throws(
|
||||
new TypeError(),
|
||||
function() { new RTCDataChannelEvent('type', { channel: null }); }
|
||||
);
|
||||
}, 'RTCDataChannelEvent constructor with channel passed as null.');
|
||||
|
||||
test(function() {
|
||||
assert_throws(
|
||||
new TypeError(),
|
||||
function() { new RTCDataChannelEvent('type', { channel: undefined }); }
|
||||
);
|
||||
}, 'RTCDataChannelEvent constructor with a channel passed as undefined.');
|
||||
|
||||
test(function() {
|
||||
var pc = new RTCPeerConnection();
|
||||
var c = pc.createDataChannel('');
|
||||
var e = new RTCDataChannelEvent('type', { channel: c });
|
||||
assert_true(e instanceof RTCDataChannelEvent);
|
||||
assert_equals(e.channel, c);
|
||||
}, 'RTCDataChannelEvent constructor with full arguments.');
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue