Bug 1433618 - Ensure that resource_initiator_types test is only run once, r=ato

It's not obvious to me how this can run more than once, but it seems there's a
race condition; this is intended to bandaid that

MozReview-Commit-ID: LWAW6xEaJ5w
This commit is contained in:
James Graham 2018-01-29 18:04:12 +00:00
parent 4d99fd04a4
commit d831c68730

View File

@ -17,6 +17,7 @@ let page_loaded = false;
let ol_font_loaded = false;
let ul_font_loaded = false;
let xhr_loaded = false;
let tests_run = false;
function check_finished() {
if (!ul_font_loaded) {
@ -64,6 +65,10 @@ function onload_test() {
}
function perform_test() {
if (tests_run) {
return;
}
tests_run = true;
const context = new PerformanceContext(document.getElementById('frameContext').contentWindow.performance);
const entries = context.getEntriesByType('resource');