Bug 1096724 - Fix intermittent test_base-uri.html failures. r=ryanvm
authorChristoph Kerschbaumer <mozilla@christophkerschbaumer.com>
Wed, 29 Jul 2015 14:16:37 -0700
changeset 287578 203279f9588fa05ef81c2a8c0e9b09210cbd252b
parent 287577 c2b099fa12eeffe0e5322e19f7f73e7d9e46be39
child 287579 2ee3ba67281f2ad55c7a5e4c6228b546d6a637e3
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersryanvm
bugs1096724
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1096724 - Fix intermittent test_base-uri.html failures. r=ryanvm
dom/security/test/csp/test_base-uri.html
--- a/dom/security/test/csp/test_base-uri.html
+++ b/dom/security/test/csp/test_base-uri.html
@@ -49,21 +49,26 @@ examiner.prototype  = {
     }
   },
   remove: function() {
     SpecialPowers.removeObserver(this, "csp-on-violate-policy");
   }
 }
 window.BaseURIExaminer = new examiner();
 
+function finishTest() {
+  window.BaseURIExaminer.remove();
+  SimpleTest.finish();
+}
+
 function loadNextTest() {
   counter++;
   if (counter == testPolicies.length) {
-    window.BaseURIExaminer.remove();
-    SimpleTest.finish();
+    finishTest();
+    return;
   }
   var src = "http://example.com/tests/dom/security/test/csp/file_testserver.sjs";
   // append the file that should be served
   src += "?file=" + escape("tests/dom/security/test/csp/file_base-uri.html");
   // append the CSP that should be used to serve the file
   src += "&csp=" + escape(testPolicies[counter]);
   document.getElementById("testframe").src = src;
 }