Bug 1345600 - Remove the empty script element workaround in jstests' browser.js. r=sfink
authorAndré Bargull <andre.bargull@gmail.com>
Sat, 11 Nov 2017 04:55:45 -0800
changeset 444698 ab5332419d2f090906270941a77e81ad0b4d40b5
parent 444685 e2dc5d006fc76e2e013d0d07a9707c20c2b3227c
child 444699 d1ce4244570bd03a297131804dc58494e203b736
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1345600
milestone58.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 1345600 - Remove the empty script element workaround in jstests' browser.js. r=sfink
js/src/tests/browser.js
--- a/js/src/tests/browser.js
+++ b/js/src/tests/browser.js
@@ -511,17 +511,18 @@
       // No error is expected.
       expectedError = "Unknown";
     }
 
     if (properties.gczeal) {
       gczeal(Number(properties.gczeal));
     }
 
-    document.write(`<title>${ properties.test }<\/title>`);
+    // Display the test path in the title.
+    document.title = properties.test;
 
     // Output script tags for shell.js, then browser.js, at each level of the
     // test path hierarchy.
     var prepath = "";
     var scripts = [];
     for (var i = 0; i < testpathparts.length - 1; i++) {
       prepath += testpathparts[i] + "/";
 
@@ -532,20 +533,16 @@
     // Output the test script itself.
     var moduleTest = !!properties.module;
     scripts.push({src: prepath + testFileName, module: moduleTest});
 
     // Finally output the driver-end script to advance to the next test.
     scripts.push({src: "js-test-driver-end.js", module: false});
 
     if (!moduleTest) {
-      // XXX bc - the first document.written script is ignored if the protocol
-      // is file:. insert an empty script tag, to work around it.
-      document.write("<script></script>");
-
       var key, value;
       if (properties.language !== "type") {
         key = "language";
         value = "javascript";
         if (properties.version) {
           value += properties.version;
         }
       } else {