Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / fast / mediastream / RTCPeerConnection.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <script>
8 description("Tests the RTCPeerConnection constructor.");
9
10 shouldNotThrow("new webkitRTCPeerConnection(null);");
11 shouldNotThrow("new webkitRTCPeerConnection(null, null);");
12 shouldNotThrow("new webkitRTCPeerConnection(undefined);");
13 shouldNotThrow("new webkitRTCPeerConnection(undefined, undefined);");
14 shouldThrow("new webkitRTCPeerConnection();");
15 shouldThrow("new webkitRTCPeerConnection('');");
16 shouldThrow("new webkitRTCPeerConnection(null, '');");
17
18 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[]}, null);");
19 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url:'stun:foo.com'}]}, null);");
20 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', credential:'x'}]}, null);");
21 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', credential:'x'},{url:'stun:bar.com'}]}, null);");
22 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}, null);");
23 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:['stun:foo.com', 'turn:foo.com']}]}, null);");
24
25 shouldThrow("new webkitRTCPeerConnection({fooServers:[]}, null);");
26 shouldThrow("new webkitRTCPeerConnection({iceServers:true}, null);");
27 shouldThrow("new webkitRTCPeerConnection({iceServers:[1, 2, 3]}, null);");
28 shouldThrow("new webkitRTCPeerConnection({iceServers:[{}]}, null);");
29 shouldThrow("new webkitRTCPeerConnection({iceServers:[{url:'foo'}]}, null);");
30 shouldThrow("new webkitRTCPeerConnection({iceServers:[{urls:[1, 'turn:foo.com']}]}, null);");
31
32 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'none'}, null);");
33 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'relay'}, null);");
34 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'all'}, null);");
35 shouldThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'foo'}, null);");
36
37 shouldNotThrow("new webkitRTCPeerConnection(null, {mandatory:{valid_and_supported_1:1}});");
38 shouldNotThrow("new webkitRTCPeerConnection(null, {mandatory:{valid_and_supported_1:1, valid_and_supported_2:1}});");
39 shouldNotThrow("new webkitRTCPeerConnection(null, {optional:[{valid_and_supported_1:0}]});");
40 shouldNotThrow("new webkitRTCPeerConnection(null, {optional:[{valid_and_supported_1:0},{valid_and_supported_2:0}]});");
41 shouldNotThrow("new webkitRTCPeerConnection(null, {optional:[{valid_but_unsupported_1:0},{valid_but_unsupported_2:0}]});");
42 shouldThrow("new webkitRTCPeerConnection(null, {mandatory:{valid_and_supported_1:66}});");
43 shouldThrow("new webkitRTCPeerConnection(null, {mandatory:{invalid:1}});");
44 shouldThrow("new webkitRTCPeerConnection(null, {mandatory:{valid_but_unsupported_1:1}});");
45 shouldThrow("new webkitRTCPeerConnection(null, {mandatory:{valid_but_unsupported_1:1, valid_and_supported_1:1}});");
46 shouldThrow("new webkitRTCPeerConnection(null, {optional:{valid_and_supported_1:0}});");
47 shouldThrow("new webkitRTCPeerConnection(null, {optional:[{valid_and_supported_1:0,valid_and_supported_2:0}]});");
48 shouldThrow("new webkitRTCPeerConnection(null, {optional:[{invalid:0}]});");
49 shouldThrow("new webkitRTCPeerConnection(null, {valid_and_supported_1:1});");
50 shouldThrow("new webkitRTCPeerConnection(null, {valid_but_unsupported_1:1});");
51 shouldThrow("new webkitRTCPeerConnection(null, {valid_and_supported_2:1, mandatory:{valid_and_supported_1:1}});");
52 </script>
53 </body>
54 </html>