test_XHRResponseURL.html (1656B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=998076 5 --> 6 <head> 7 <meta charset="utf-8"> 8 <title>Test for Bug 998076</title> 9 <script src="/tests/SimpleTest/SimpleTest.js"></script> 10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 11 <script type="application/javascript" src="file_XHRResponseURL.js"></script> 12 <script type="application/javascript"> 13 14 /** Test for Bug 998076 */ 15 "use strict"; 16 17 window.addEventListener("message", function (aEvent) { 18 var data = aEvent.data; 19 if (data === "done") { 20 SimpleTest.finish(); 21 return; 22 } 23 if (data === "start") { 24 return; 25 } 26 if (data.type === "is") { 27 SimpleTest.is(data.actual, data.expected, data.message); 28 window.postMessage("pong", "*"); 29 return; 30 } 31 if (data.type === "ok") { 32 SimpleTest.ok(data.bool, data.message); 33 window.postMessage("pong", "*"); 34 return; 35 } 36 if (data.type === "info") { 37 SimpleTest.info(data.message); 38 window.postMessage("pong", "*"); 39 return; 40 } 41 if (data.type === "todo") { 42 SimpleTest.todo(data.bool, data.message); 43 window.postMessage("pong", "*"); 44 return; 45 } 46 if (data.type === "todo_is") { 47 SimpleTest.todo_is(data.actual, data.expected, data.message); 48 window.postMessage("pong", "*"); 49 50 } 51 }); 52 53 function runTests() { 54 SimpleTest.waitForExplicitFinish(); 55 window.postMessage("start", "*"); 56 } 57 58 </script> 59 </head> 60 <body onload="runTests()"> 61 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=998076">Mozilla Bug 998076</a> 62 <p id="display"></p> 63 <div id="content" style="display: none"> 64 65 </div> 66 <pre id="test"> 67 </pre> 68 </body> 69 </html>