Bug 1335266: In test_fragments.html, don't set iframe src attribute until *after* we've set up its load handler. r?longsonr
This will hopefully fix some intermittent timeouts that we're hitting in this
test. (The theory is that without this patch, maybe we're firing the iframe's
load event before we've set up the load handler.)
MozReview-Commit-ID: 183ogex73SX
--- a/dom/svg/test/test_fragments.html
+++ b/dom/svg/test/test_fragments.html
@@ -8,17 +8,17 @@ https://bugzilla.mozilla.org/show_bug.cg
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=759124">Mozilla Bug 759124</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
-<iframe id="svg" src="fragments-helper.svg"></iframe>
+<iframe id="svg"></iframe>
<pre id="test">
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
function Test(svgFragmentIdentifier, valid, viewBoxString,
preserveAspectRatioString, zoomAndPanString)
{
@@ -105,12 +105,13 @@ function runTests()
rootElement.setAttribute("zoomAndPan", "disable");
rootElement.setAttribute("transform", "translate(10,10)");
}
SimpleTest.finish();
}
$(svg).addEventListener("load", runTests);
+$(svg).setAttribute("src", "fragments-helper.svg");
</script>
</pre>
</body>
</html>