Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / mediastream / RTCPeerConnection-localDescription.html
blobf5775886c4618a29cec1b657a2f089c15fe9efd1
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 RTCPeerConnection localDescription.");
10 var pc = null;
12 function requestFailed2()
14 testPassed('requestFailed was called.');
16 shouldBeEqualToString('pc.localDescription.type', "offer");
17 shouldBeEqualToString('pc.localDescription.sdp', "local");
18 pc.close();
19 shouldBeEqualToString('pc.localDescription.type', "offer");
20 shouldBeEqualToString('pc.localDescription.sdp', "local");
22 finishJSTest();
25 function requestSucceeded2()
27 testFailed('requestSucceeded was called.');
28 finishJSTest();
31 function requestFailed1()
33 testFailed('requestFailed was called.');
34 finishJSTest();
37 function requestSucceeded1()
39 testPassed('requestSucceeded was called.');
41 sessionDescription = new RTCSessionDescription({type:"answer", sdp:"remote"});
42 shouldNotThrow('pc.setLocalDescription(sessionDescription, requestSucceeded2, requestFailed2);');
45 pc = new webkitRTCPeerConnection(null, null);
46 var sessionDescription = new RTCSessionDescription({type:"offer", sdp:"local"});
47 shouldNotThrow('pc.setLocalDescription(sessionDescription, requestSucceeded1, requestFailed1);');
50 window.jsTestIsAsync = true;
51 window.successfullyParsed = true;
52 </script>
53 </body>
54 </html>