1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/media/tests/mochitest/test_peerConnection_toJSON.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,47 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=872377 1.8 +--> 1.9 +<head> 1.10 + <meta charset="utf-8"> 1.11 + <title>Test for Bug 872377 and Bug 928304</title> 1.12 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 1.13 + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.14 + <script type="application/javascript" src="head.js"></script> 1.15 +</head> 1.16 +<body> 1.17 +<pre id="test"> 1.18 +<script type="application/javascript"> 1.19 + createHTML({ 1.20 + bug: "928304", 1.21 + title: "test toJSON() on mozRTCSessionDescription and mozRTCIceCandidate" 1.22 + }); 1.23 + 1.24 + runTest(function () { 1.25 + /** Test for Bug 872377 **/ 1.26 + 1.27 + var rtcSession = new mozRTCSessionDescription({ sdp: "Picklechips!", 1.28 + type: "offer" }); 1.29 + var jsonCopy = JSON.parse(JSON.stringify(rtcSession)); 1.30 + for (key in rtcSession) { 1.31 + if (typeof(rtcSession[key]) == "function") continue; 1.32 + is(rtcSession[key], jsonCopy[key], "key " + key + " should match."); 1.33 + } 1.34 + 1.35 + /** Test for Bug 928304 **/ 1.36 + 1.37 + var rtcIceCandidate = new mozRTCIceCandidate({ candidate: "dummy", 1.38 + sdpMid: "test", 1.39 + sdpMLineIndex: 3 }); 1.40 + jsonCopy = JSON.parse(JSON.stringify(rtcIceCandidate)); 1.41 + for (key in rtcIceCandidate) { 1.42 + if (typeof(rtcIceCandidate[key]) == "function") continue; 1.43 + is(rtcIceCandidate[key], jsonCopy[key], "key " + key + " should match."); 1.44 + } 1.45 + SimpleTest.finish(); 1.46 + }); 1.47 +</script> 1.48 +</pre> 1.49 +</body> 1.50 +</html>