| <!doctype html> |
| <html> |
| <head> |
| <meta charset="utf-8"> |
| <title>Testing createOffer/createAnswer</title> |
| <script src="../resources/testharness.js"></script> |
| <script src="../resources/testharnessreport.js"></script> |
| </head> |
| <body> |
| <script> |
| |
| var pc1 = new RTCPeerConnection(); |
| var pc1Offer; |
| promise_test((test) => { |
| pc1.addTransceiver("video"); |
| |
| return pc1.createOffer().then((offer) => { |
| pc1Offer = offer; |
| assert_false(offer instanceof RTCSessionDescription); |
| }); |
| }, "Ensuring that offer is a RTCSessionDescriptionInit"); |
| |
| |
| promise_test((test) => { |
| var pc2 = new RTCPeerConnection(); |
| pc2.addTransceiver("video"); |
| |
| return pc2.setRemoteDescription(pc1Offer).then(() => { |
| return pc2.createAnswer(); |
| }).then((answer) => { |
| assert_false(pc1Offer instanceof RTCSessionDescription); |
| pc1Offer.sdp = ""; |
| answer.sdp = ""; |
| }); |
| }, "Ensuring that answer is a RTCSessionDescriptionInit"); |
| |
| </script> |
| </body> |
| </html> |