Make captureCanvas-webrtc.html more robust
[WebKit-https.git] / LayoutTests / webrtc / legacy-api.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3     <head>
4         <script src="../resources/testharness.js"></script>
5     </head>
6     <body>
7         <script>
8 if (window.testRunner)
9     testRunner.setWebRTCLegacyAPIEnabled(false);
10
11 promise_test(function() {
12     var pc1 = new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});
13     var pc2 = new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});
14     assert_equals(pc1.getLocalStreams, undefined);
15     assert_equals(pc1.getRemoteStreams, undefined);
16     assert_equals(pc1.getStreamById, undefined);
17     assert_equals(pc1.addStream, undefined);
18     assert_equals(pc1.removeStream, undefined);
19     assert_equals(pc1.onaddstream, undefined);
20
21     var channel = pc1.createDataChannel("test");
22     return pc1.createOffer({ }, assert_unreached, assert_unreached).then((offer) => {
23         return pc1.setLocalDescription(offer, assert_unreached, assert_unreached).then(() => { return offer; }); 
24     }).then((offer) => {
25         return pc2.setRemoteDescription(offer, assert_unreached, assert_unreached); 
26     }).then(() => {
27         return pc2.createAnswer({ }, assert_unreached, assert_unreached);
28     });
29 }, "Testing legacy API is not defined when legacy flag is turned off");
30         </script>
31         <script src="../resources/testharnessreport.js"></script>
32     </body>
33 </html>