1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/base/test/chrome/test_bug765993.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,62 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=765993 1.8 +--> 1.9 +<head> 1.10 + <title>Test for Bug 765993</title> 1.11 + <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 1.12 + <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script> 1.13 + <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/ChromeUtils.js"></script> 1.14 + <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/> 1.15 +</head> 1.16 +<body> 1.17 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=765993">Mozilla Bug 765993</a> 1.18 +<style type="text/css"> 1.19 +#link1 a { -moz-user-select:none; } 1.20 +</style> 1.21 +<div id="link1"><a href="http://www.mozilla.org/">link1</a></div> 1.22 +<div id="link2"><a href="http://www.mozilla.org/">link2</a></div> 1.23 +<p id="display"></p> 1.24 +<div id="content" style="display: none"> 1.25 + 1.26 +</div> 1.27 +<pre id="test"> 1.28 +<script type="application/javascript"> 1.29 + 1.30 +/** Test for Bug 765993 **/ 1.31 + 1.32 +Components.utils.import("resource://gre/modules/jsdebugger.jsm"); 1.33 +addDebuggerToGlobal(this); 1.34 + 1.35 +window.onload = function () { 1.36 + SimpleTest.waitForExplicitFinish(); 1.37 + 1.38 + var iframe = document.createElement("iframe"); 1.39 + iframe.src = "http://mochi.test:8888/tests/content/base/test/chrome/nochrome_bug765993.html"; 1.40 + iframe.onload = function () { 1.41 + var script = iframe.contentWindow.document.createElement("script"); 1.42 + script.src = "http://mochi.test:8888/tests/content/base/test/chrome/nochrome_bug765993.js"; 1.43 + script.onload = function () { 1.44 + var dbg = new Debugger(iframe.contentWindow); 1.45 + ok(dbg, "Should be able to create debugger"); 1.46 + 1.47 + var scripts = dbg.findScripts({ 1.48 + url: "http://mochi.test:8888/tests/content/base/test/chrome/nochrome_bug765993.js" 1.49 + }); 1.50 + ok(scripts.length > 0, "Should be able to find script"); 1.51 + 1.52 + is(scripts[0].sourceMapURL, "foo.js.map"); 1.53 + SimpleTest.finish(); 1.54 + } 1.55 + 1.56 + iframe.contentWindow.document.body.appendChild(script); 1.57 + }; 1.58 + 1.59 + document.body.appendChild(iframe); 1.60 +}; 1.61 + 1.62 +</script> 1.63 +</pre> 1.64 +</body> 1.65 +</html>