dom/media/tests/mochitest/test_peerConnection_toJSON.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=872377
     5 -->
     6 <head>
     7   <meta charset="utf-8">
     8   <title>Test for Bug 872377 and Bug 928304</title>
     9   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    10   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    11   <script type="application/javascript" src="head.js"></script>
    12 </head>
    13 <body>
    14 <pre id="test">
    15 <script type="application/javascript">
    16   createHTML({
    17     bug: "928304",
    18     title: "test toJSON() on mozRTCSessionDescription and mozRTCIceCandidate"
    19   });
    21   runTest(function () {
    22     /** Test for Bug 872377 **/
    24     var rtcSession = new mozRTCSessionDescription({ sdp: "Picklechips!",
    25                                                     type: "offer" });
    26     var jsonCopy = JSON.parse(JSON.stringify(rtcSession));
    27     for (key in rtcSession) {
    28       if (typeof(rtcSession[key]) == "function") continue;
    29       is(rtcSession[key], jsonCopy[key], "key " + key + " should match.");
    30     }
    32     /** Test for Bug 928304 **/
    34     var rtcIceCandidate = new mozRTCIceCandidate({ candidate: "dummy",
    35                                                    sdpMid: "test",
    36                                                    sdpMLineIndex: 3 });
    37     jsonCopy = JSON.parse(JSON.stringify(rtcIceCandidate));
    38     for (key in rtcIceCandidate) {
    39       if (typeof(rtcIceCandidate[key]) == "function") continue;
    40       is(rtcIceCandidate[key], jsonCopy[key], "key " + key + " should match.");
    41     }
    42     SimpleTest.finish();
    43   });
    44 </script>
    45 </pre>
    46 </body>
    47 </html>

mercurial