Bug 1237726, part 2 - Don't start running mixedcontentblocker/test_main.html until the page has finished loading. r=tanvi

If the script runs before the page finishes loading, you get an error
about getElementById being null.  This doesn't seem to usually happen
with this particular test, but it looks like it can happen at least
sometimes.
This commit is contained in:
Andrew McCreight 2016-02-08 09:52:19 -08:00
Родитель 164c42ece5
Коммит 4cf4ea2fd9
1 изменённых файлов: 13 добавлений и 11 удалений

Просмотреть файл

@ -161,24 +161,26 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=62178
checkTestsCompleted();
}
//Set the first set of mixed content settings and increment the counter.
//Enable <picture> and <img srcset> for the test.
changePrefs([[ "dom.image.srcset.enabled", true ], [ "dom.image.picture.enabled", true ]],
function() {
//listen for a messages from the mixed content test harness
window.addEventListener("message", receiveMessage, false);
function startTest() {
//Set the first set of mixed content settings and increment the counter.
//Enable <picture> and <img srcset> for the test.
changePrefs([[ "dom.image.srcset.enabled", true ], [ "dom.image.picture.enabled", true ]],
function() {
//listen for a messages from the mixed content test harness
window.addEventListener("message", receiveMessage, false);
//Kick off test
reloadFrame();
}
);
//Kick off test
reloadFrame();
}
);
}
SimpleTest.waitForExplicitFinish();
</script>
</head>
<body>
<body onload='startTest()'>
<div id="framediv"></div>
<pre id="log"></pre>
</body>