diff --git a/dom/security/test/csp/file_report_chromescript.js b/dom/security/test/csp/file_report_chromescript.js index b9375a4dead5..a87ed258940c 100644 --- a/dom/security/test/csp/file_report_chromescript.js +++ b/dom/security/test/csp/file_report_chromescript.js @@ -46,9 +46,11 @@ var openingObserver = { } sendAsyncMessage('opening-request-completed', message); - Services.obs.removeObserver(openingObserver, 'http-on-opening-request'); } } }; Services.obs.addObserver(openingObserver, 'http-on-opening-request'); +addMessageListener("finish", function() { + Services.obs.removeObserver(openingObserver, 'http-on-opening-request'); +}); diff --git a/dom/security/test/csp/test_blocked_uri_in_reports.html b/dom/security/test/csp/test_blocked_uri_in_reports.html index f68d8c03f23b..7e656509e244 100644 --- a/dom/security/test/csp/test_blocked_uri_in_reports.html +++ b/dom/security/test/csp/test_blocked_uri_in_reports.html @@ -57,6 +57,7 @@ script.addMessageListener('opening-request-completed', function ml(msg) { } script.removeMessageListener('opening-request-completed', ml); + script.sendAsyncMessage("finish"); SimpleTest.finish(); }); diff --git a/dom/security/test/csp/test_report.html b/dom/security/test/csp/test_report.html index e8cfb8778061..7d3bd7dcc085 100644 --- a/dom/security/test/csp/test_report.html +++ b/dom/security/test/csp/test_report.html @@ -84,6 +84,7 @@ script.addMessageListener('opening-request-completed', function ml(msg) { } script.removeMessageListener('opening-request-completed', ml); + script.sendAsyncMessage("finish"); SimpleTest.finish(); });