dom/media/tests/mochitest/test_peerConnection_bug834153.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/media/tests/mochitest/test_peerConnection_bug834153.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,48 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<head>
     1.7 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     1.8 +  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     1.9 +  <script type="application/javascript" src="head.js"></script>
    1.10 +</head>
    1.11 +<body>
    1.12 +<pre id="test">
    1.13 +<script type="application/javascript">
    1.14 +  createHTML({
    1.15 +    bug: "834153",
    1.16 +    title: "Queue CreateAnswer in PeerConnection.js"
    1.17 +  });
    1.18 +
    1.19 +  function croak(msg) {
    1.20 +    ok(0, msg);
    1.21 +    pc1.close();
    1.22 +    pc2.close();
    1.23 +    SimpleTest.finish();
    1.24 +  }
    1.25 +
    1.26 +  runTest(function () {
    1.27 +    var pc1 = new mozRTCPeerConnection();
    1.28 +
    1.29 +    pc1.createOffer(function (d) {
    1.30 +      var pc2 = new mozRTCPeerConnection();
    1.31 +
    1.32 +      // The whole point of this test is not to wait for the
    1.33 +      // setRemoteDescription call to succesfully complete, so we
    1.34 +      // don't do anything in its callbacks.
    1.35 +      pc2.setRemoteDescription(d, function (x) {}, function (x) {});
    1.36 +      pc2.createAnswer(function (d) {
    1.37 +        is(d.type,"answer","CreateAnswer created an answer");
    1.38 +        pc1.close();
    1.39 +        pc2.close();
    1.40 +        SimpleTest.finish();
    1.41 +      }, function (err) {
    1.42 +        croak("createAnswer failed: " + err);
    1.43 +      });
    1.44 +    }, function (err) {
    1.45 +        croak("createOffer failed: " + err);
    1.46 +    },  { mandatory: { OfferToReceiveAudio: true} });
    1.47 +  });
    1.48 +</script>
    1.49 +</pre>
    1.50 +</body>
    1.51 +</html>

mercurial