Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/webrtc/RTCDataChannelEvent-constructor.html

Issue 2509983007: Upstream RTCDataChannelEvent and RTCPeerConnectionIceEvent ctor tests (Closed)
Patch Set: update MANIFEST.json Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <meta charset="utf-8"> 2 <meta charset="utf-8">
3 <title>RTCDataChannelEvent constructor</title> 3 <title>RTCDataChannelEvent 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(RTCDataChannelEvent.length, 2); 8 assert_equals(RTCDataChannelEvent.length, 2);
9 assert_throws( 9 assert_throws(
10 new TypeError(), 10 new TypeError(),
11 function() { new RTCDataChannelEvent('type'); } 11 function() { new RTCDataChannelEvent('type'); }
12 ); 12 );
13 }, 'RTCDataChannelEvent constructor without a required argument.'); 13 }, 'RTCDataChannelEvent constructor without a required argument.');
14 14
15 test(function() { 15 test(function() {
16 assert_throws( 16 assert_throws(
17 new TypeError(), 17 new TypeError(),
18 function() { new RTCDataChannelEvent('type', { channel: null }); } 18 function() { new RTCDataChannelEvent('type', { channel: null }); }
19 ); 19 );
20 }, 'RTCDataChannelEvent constructor with channel passed as "null".'); 20 }, 'RTCDataChannelEvent constructor with channel passed as null.');
21 21
22 test(function() { 22 test(function() {
23 assert_throws( 23 assert_throws(
24 new TypeError(), 24 new TypeError(),
25 function() { new RTCDataChannelEvent('type', { channel: undefined }); } 25 function() { new RTCDataChannelEvent('type', { channel: undefined }); }
26 ); 26 );
27 }, 'RTCDataChannelEvent constructor with a channel passed as "undefined".'); 27 }, 'RTCDataChannelEvent constructor with a channel passed as undefined.');
28 28
29 test(function() { 29 test(function() {
30 var pc = new RTCPeerConnection(); 30 var pc = new RTCPeerConnection();
31 var c = pc.createDataChannel(''); 31 var c = pc.createDataChannel('');
32 var e = new RTCDataChannelEvent('type', { channel: c }); 32 var e = new RTCDataChannelEvent('type', { channel: c });
33 assert_true(e instanceof RTCDataChannelEvent); 33 assert_true(e instanceof RTCDataChannelEvent);
34 assert_equals(e.channel, c); 34 assert_equals(e.channel, c);
35 }, 'RTCDataChannelEvent constructor with full arguments.'); 35 }, 'RTCDataChannelEvent constructor with full arguments.');
36 </script> 36 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698