Bug 1335266: In test_fragments.html, don't set iframe src attribute until *after* we've set up its load handler. r?longsonr draft
authorDaniel Holbert <dholbert@cs.stanford.edu>
Wed, 21 Mar 2018 10:50:19 -0700
changeset 770675 55d0fce134dc804552e6aa033fdbf64dd4bb6285
parent 770671 c6193142bbcf6dbd7e7562243282f543310a0ea1
push id103468
push userdholbert@mozilla.com
push dateWed, 21 Mar 2018 17:50:42 +0000
reviewerslongsonr
bugs1335266
milestone61.0a1
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
dom/svg/test/test_fragments.html
--- 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>