Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
<?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
<!--
-->
<window title="Mozilla Bug 817284"
<!-- test results are displayed in the html:body -->
target="_blank">Mozilla Bug 817284</a>
</body>
<!-- test code goes here -->
<script type="application/javascript">
<![CDATA[
/** Test for Bug 817284 **/
var sb = Cu.Sandbox("http://example.com", { wantGlobalProperties: ["XMLHttpRequest"] });
// Test event handler calls
var xhr = Cu.evalInSandbox(
'var xhr = new XMLHttpRequest();\
var called = false;\
xhr.onload = function() { called = true; };\
xhr', sb);
var e = document.createEvent("Events");
e.initEvent("load", false, false);
xhr.dispatchEvent(e);
is(Cu.evalInSandbox('called', sb), true, "Event handler should have been called");
]]>
</script>
</window>