1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/base/test/test_bug927196.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,56 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=426308 1.8 +--> 1.9 +<head> 1.10 + <title>Test for Bug 426308</title> 1.11 + <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.12 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 1.13 +</head> 1.14 +<body> 1.15 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=927196">Mozilla Bug 927196</a> 1.16 +<p id="display"></p> 1.17 +<div id="content" style="display: none"> 1.18 + 1.19 +</div> 1.20 +<pre id="test"> 1.21 +<script class="testbody" type="text/javascript"> 1.22 + 1.23 +/** Test for Bug 927196 **/ 1.24 + 1.25 +function startTest() { 1.26 + req = new XMLHttpRequest({mozSystem: true}); 1.27 + is(req.mozAnon, true, "XMLHttpRequest should be mozAnon"); 1.28 + 1.29 + req = new XMLHttpRequest({mozAnon: true}); 1.30 + is(req.mozAnon, true, "XMLHttpRequest should be mozAnon"); 1.31 + is(req.mozSystem, false, "XMLHttpRequest should not be mozSystem"); 1.32 + 1.33 + req = new XMLHttpRequest({mozAnon: true, mozSystem: true}); 1.34 + is(req.mozAnon, true, "XMLHttpRequest should be mozAnon"); 1.35 + is(req.mozSystem, true, "XMLHttpRequest should be mozSystem"); 1.36 + 1.37 + req = new XMLHttpRequest({mozAnon: false, mozSystem: true}); 1.38 + is(req.mozAnon, true, "XMLHttpRequest should be mozAnon"); 1.39 + 1.40 + SimpleTest.finish(); 1.41 +} 1.42 + 1.43 +SimpleTest.waitForExplicitFinish(); 1.44 + 1.45 +var req = new XMLHttpRequest({mozAnon: true}); 1.46 +is(req.mozAnon, true, "XMLHttpRequest should be mozAnon"); 1.47 +is(req.mozSystem, false, "XMLHttpRequest should not be mozSystem"); 1.48 + 1.49 +req = new XMLHttpRequest({mozAnon: true, mozSystem: true}); 1.50 +is(req.mozAnon, false, "XMLHttpRequest should be mozAnon"); 1.51 +is(req.mozSystem, false, "XMLHttpRequest should not be mozSystem"); 1.52 + 1.53 +addLoadEvent(function() { 1.54 + SpecialPowers.pushPermissions([{'type': 'systemXHR', 'allow': true, 'context': document}], startTest); 1.55 +}); 1.56 +</script> 1.57 +</pre> 1.58 +</body> 1.59 +</html>