Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html> |
michael@0 | 3 | <head> |
michael@0 | 4 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
michael@0 | 5 | <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 6 | <script type="application/javascript" src="head.js"></script> |
michael@0 | 7 | </head> |
michael@0 | 8 | <body> |
michael@0 | 9 | <pre id="test"> |
michael@0 | 10 | <script type="application/javascript"> |
michael@0 | 11 | createHTML({ |
michael@0 | 12 | bug: "834153", |
michael@0 | 13 | title: "Queue CreateAnswer in PeerConnection.js" |
michael@0 | 14 | }); |
michael@0 | 15 | |
michael@0 | 16 | function croak(msg) { |
michael@0 | 17 | ok(0, msg); |
michael@0 | 18 | pc1.close(); |
michael@0 | 19 | pc2.close(); |
michael@0 | 20 | SimpleTest.finish(); |
michael@0 | 21 | } |
michael@0 | 22 | |
michael@0 | 23 | runTest(function () { |
michael@0 | 24 | var pc1 = new mozRTCPeerConnection(); |
michael@0 | 25 | |
michael@0 | 26 | pc1.createOffer(function (d) { |
michael@0 | 27 | var pc2 = new mozRTCPeerConnection(); |
michael@0 | 28 | |
michael@0 | 29 | // The whole point of this test is not to wait for the |
michael@0 | 30 | // setRemoteDescription call to succesfully complete, so we |
michael@0 | 31 | // don't do anything in its callbacks. |
michael@0 | 32 | pc2.setRemoteDescription(d, function (x) {}, function (x) {}); |
michael@0 | 33 | pc2.createAnswer(function (d) { |
michael@0 | 34 | is(d.type,"answer","CreateAnswer created an answer"); |
michael@0 | 35 | pc1.close(); |
michael@0 | 36 | pc2.close(); |
michael@0 | 37 | SimpleTest.finish(); |
michael@0 | 38 | }, function (err) { |
michael@0 | 39 | croak("createAnswer failed: " + err); |
michael@0 | 40 | }); |
michael@0 | 41 | }, function (err) { |
michael@0 | 42 | croak("createOffer failed: " + err); |
michael@0 | 43 | }, { mandatory: { OfferToReceiveAudio: true} }); |
michael@0 | 44 | }); |
michael@0 | 45 | </script> |
michael@0 | 46 | </pre> |
michael@0 | 47 | </body> |
michael@0 | 48 | </html> |