dom/media/tests/mochitest/test_peerConnection_bug834153.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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

mercurial