Bug 1346234 - Part 44: Skip browser-only tests when running in the shell. r=sfink
authorAndré Bargull <andre.bargull@gmail.com>
Tue, 31 Oct 2017 08:03:04 -0700
changeset 689749 917e3724bdedd26a62dd542f38469f6a8ff4d1f1
parent 689748 6b6102b5d8bff6a7c0a3848efeec2232c2dd5512
child 689750 0f94f91d14f4e073b5df98b47c00371fc3017e23
push id87097
push userdholbert@mozilla.com
push dateTue, 31 Oct 2017 22:39:07 +0000
reviewerssfink
bugs1346234
milestone58.0a1
Bug 1346234 - Part 44: Skip browser-only tests when running in the shell. r=sfink
js/src/tests/js1_5/GC/regress-319980-01.js
js/src/tests/js1_5/Regress/regress-233483-2.js
js/src/tests/js1_5/Regress/regress-233483.js
js/src/tests/js1_5/Regress/regress-314401.js
js/src/tests/js1_5/Regress/regress-341360.js
js/src/tests/js1_5/Regress/regress-418540.js
js/src/tests/js1_5/Regress/regress-425360.js
js/src/tests/js1_5/Regress/regress-453024.js
js/src/tests/js1_5/Regress/regress-466747.js
js/src/tests/js1_5/extensions/regress-327608.js
js/src/tests/js1_5/extensions/regress-367121.js
js/src/tests/js1_5/extensions/regress-367589.js
js/src/tests/js1_5/extensions/regress-369404.js
js/src/tests/js1_5/extensions/regress-372309.js
js/src/tests/js1_5/extensions/regress-407720.js
js/src/tests/js1_5/extensions/regress-443569.js
js/src/tests/js1_5/extensions/regress-454704.js
js/src/tests/js1_7/iterable/regress-341815.js
js/src/tests/js1_7/iterable/regress-341821.js
--- a/js/src/tests/js1_5/GC/regress-319980-01.js
+++ b/js/src/tests/js1_5/GC/regress-319980-01.js
@@ -1,9 +1,9 @@
-// |reftest| skip-if(!xulRuntime.shell) slow
+// |reftest| skip slow
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 319980;
 var summary = 'GC not called during non-fatal out of memory';
@@ -18,31 +18,21 @@ print ('This test should never fail expl
 
 var timeOut  = 45 * 1000;
 var interval = 0.01  * 1000;
 var testFuncWatcherId;
 var testFuncTimerId;
 var maxTests = 5;
 var currTest = 0;
 
-if (typeof setTimeout == 'undefined')
-{
-  setTimeout = function() {};
-  clearTimeout = function() {};
-  actual = 'Normal Exit';
-  reportCompare(expect, actual, summary);
-}
-else
-{
-  // delay start until after js-test-driver-end runs.
-  // delay test driver end
-  gDelayTestDriverEnd = true;
+// delay start until after js-test-driver-end runs.
+// delay test driver end
+gDelayTestDriverEnd = true;
 
-  setTimeout(testFuncWatcher, 1000);
-}
+setTimeout(testFuncWatcher, 1000);
 
 function testFuncWatcher()
 {
   a = null;
 
   gc();
 
   clearTimeout(testFuncTimerId);
--- a/js/src/tests/js1_5/Regress/regress-233483-2.js
+++ b/js/src/tests/js1_5/Regress/regress-233483-2.js
@@ -1,34 +1,28 @@
+// |reftest| skip-if(xulRuntime.shell)
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 233483;
 var summary = 'Don\'t crash with null properties - Browser only';
 var actual = 'No Crash';
 var expect = 'No Crash';
 
 printBugNumber(BUGNUMBER);
 printStatus (summary);
 
-if (typeof document == 'undefined')
-{
-  reportCompare(expect, actual, summary);
-}
-else
-{ 
-  // delay test driver end
-  gDelayTestDriverEnd = true;
+// delay test driver end
+gDelayTestDriverEnd = true;
 
-  actual = 'Crash';
-  window.onload = onLoad;
-}
+actual = 'Crash';
+window.onload = onLoad;
 
 function onLoad()
 {
   var a = new Array();
   var pe;
   var x;
   var s;
 
--- a/js/src/tests/js1_5/Regress/regress-233483.js
+++ b/js/src/tests/js1_5/Regress/regress-233483.js
@@ -1,33 +1,26 @@
+// |reftest| skip-if(xulRuntime.shell)
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 233483;
 var summary = 'Don\'t crash with null properties - Browser only';
 var actual = 'Crash';
 var expect = 'No Crash';
 
 printBugNumber(BUGNUMBER);
 printStatus (summary);
 
-if (typeof document != 'undefined')
-{ 
-  // delay test driver end
-  gDelayTestDriverEnd = true;
-  window.onload = onLoad;
-}
-else
-{
-  actual = 'No Crash';
-  reportCompare(expect, actual, summary);
-}
+// delay test driver end
+gDelayTestDriverEnd = true;
+window.onload = onLoad;
 
 function onLoad() {
   setform();
   var a=new Array();
   var forms = document.getElementsByTagName('form');
   a[a.length]=forms[0];
   var s=a.toString();
 
--- a/js/src/tests/js1_5/Regress/regress-314401.js
+++ b/js/src/tests/js1_5/Regress/regress-314401.js
@@ -1,31 +1,25 @@
-// |reftest| skip-if(xulRuntime.OS=="WINNT"&&isDebugBuild) slow
+// |reftest| skip-if(xulRuntime.shell||(xulRuntime.OS=="WINNT"&&isDebugBuild)) slow
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 314401;
 var summary = 'setTimeout(eval,0,"",null)|setTimeout(Script,0,"",null) should not crash';
 var actual = 'No Crash';
 var expect = 'No Crash';
 
 printBugNumber(BUGNUMBER);
 printStatus (summary);
 
-if (typeof setTimeout == 'undefined')
-{
-  reportCompare(expect, actual, 'Test Skipped.');
-}
-else
-{
-  gDelayTestDriverEnd = true;
-  window.onerror = null;
+gDelayTestDriverEnd = true;
+window.onerror = null;
 
   try
   {
     setTimeout(eval, 0, '', null);
   }
   catch(ex)
   {
     printStatus(ex+'');
@@ -64,9 +58,8 @@ else
     }
     catch(ex)
     {
       printStatus(ex+'');
     } 
     reportCompare(expect, actual, 'setInterval(Script, 0, "", null)');
   }
   setTimeout('gDelayTestDriverEnd = false; jsTestDriverEnd();', 0);
-}
--- a/js/src/tests/js1_5/Regress/regress-341360.js
+++ b/js/src/tests/js1_5/Regress/regress-341360.js
@@ -1,9 +1,9 @@
-// |reftest| skip-if(xulRuntime.OS=="WINNT"&&isDebugBuild) slow
+// |reftest| skip-if(xulRuntime.shell||(xulRuntime.OS=="WINNT"&&isDebugBuild)) slow
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 341360;
 var summary = 'clearInterval broken';
@@ -36,20 +36,11 @@ function yyy()
 {
   print('Checking result...');
   actual = 'Ok';
   gDelayTestDriverEnd = false;
   reportCompare(expect, actual, summary);
   jsTestDriverEnd();
 }
 
-if (typeof window == 'undefined')
-{
-  expect = actual = 'Not tested';
-  reportCompare(expect, actual, summary);
-}
-else
-{
-  print('Start...');
-  gDelayTestDriverEnd = true;
-  var t = window.setInterval(xxx, 1000);
-}
-
+print('Start...');
+gDelayTestDriverEnd = true;
+var t = window.setInterval(xxx, 1000);
--- a/js/src/tests/js1_5/Regress/regress-418540.js
+++ b/js/src/tests/js1_5/Regress/regress-418540.js
@@ -1,9 +1,9 @@
-// |reftest| skip-if(xulRuntime.OS=="WINNT"&&isDebugBuild) slow
+// |reftest| skip-if(xulRuntime.shell||(xulRuntime.OS=="WINNT"&&isDebugBuild)) slow
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 418540;
 var summary = 'Do not assert: OBJ_IS_NATIVE(obj)';
@@ -15,26 +15,18 @@ var expect = 'No Crash';
 test();
 //-----------------------------------------------------------------------------
 
 function test()
 {
   printBugNumber(BUGNUMBER);
   printStatus (summary);
 
-  if (typeof window == 'undefined')
-  {
-    expect = actual = 'Browser test only - skipped';
-    reportCompare(expect, actual, summary);
-  }
-  else
-  {
-    gDelayTestDriverEnd = true;
-    window.onload = boom;
-  }
+  gDelayTestDriverEnd = true;
+  window.onload = boom;
 }
 
 function boom()
 {
   var p;
   var b = document.createElement("body");
   var v = document.createElement("div");
   b.getAttribute("id")
--- a/js/src/tests/js1_5/Regress/regress-425360.js
+++ b/js/src/tests/js1_5/Regress/regress-425360.js
@@ -1,9 +1,9 @@
-// |reftest| skip-if(xulRuntime.OS=="WINNT"&&isDebugBuild) slow
+// |reftest| skip-if(xulRuntime.shell||(xulRuntime.OS=="WINNT"&&isDebugBuild)) slow
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 425360;
 var summary = 'Do not assert: !cx->throwing';
@@ -19,24 +19,14 @@ function finishtest()
 
 function throwBlah()
 {
   throw 'blah';
 }
 
 printBugNumber(BUGNUMBER);
 printStatus (summary);
- 
-if (typeof window == 'undefined')
-{
-  expect = actual = 'Not tested. Requires browser.';
-  reportCompare(expect, actual, summary);
-}
-else
-{
-  gDelayTestDriverEnd = true;
-  window.onerror = null;
-  setTimeout('finishtest()', 1000);
-  window.onload = (function () { setInterval('throwBlah()', 0); });
-  setInterval('foo(', 0);
-}
 
-
+gDelayTestDriverEnd = true;
+window.onerror = null;
+setTimeout('finishtest()', 1000);
+window.onload = (function () { setInterval('throwBlah()', 0); });
+setInterval('foo(', 0);
--- a/js/src/tests/js1_5/Regress/regress-453024.js
+++ b/js/src/tests/js1_5/Regress/regress-453024.js
@@ -1,42 +1,35 @@
+// |reftest| skip-if(xulRuntime.shell)
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 453024;
 var summary = 'Do not assert: vp + 2 + argc <= (jsval *) cx->stackPool.current->avail';
 var actual = 'No Crash';
 var expect = 'No Crash';
 
-if (typeof window == 'undefined')
-{
-  reportCompare(true, true, summary + ': test requires browser.');
-}
-else
+gDelayTestDriverEnd = true;
+var j = 0;
+
+function test()
 {
-  gDelayTestDriverEnd = true;
-  var j = 0;
-
-  function test()
-  {
     printBugNumber(BUGNUMBER);
     printStatus (summary);
  
     for (var i = 0; i < 2000; ++i) {
       var ns = document.createElementNS("http://www.w3.org/1999/xhtml", "script");
       var nt = document.createTextNode("++j");
       ns.appendChild(nt);
       document.body.appendChild(ns);
     }
 
     gDelayTestDriverEnd = false;
 
     reportCompare(expect, actual, summary);
 
     jsTestDriverEnd();
-  }
+}
 
-  window.addEventListener('load', test, false);
-
-}
+window.addEventListener('load', test, false);
--- a/js/src/tests/js1_5/Regress/regress-466747.js
+++ b/js/src/tests/js1_5/Regress/regress-466747.js
@@ -1,8 +1,9 @@
+// |reftest| skip-if(xulRuntime.shell)
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 466747;
 var summary = 'TM: Do not assert: fp->slots + fp->script->nfixed + ' +
@@ -15,25 +16,17 @@ var expect = '';
 test();
 //-----------------------------------------------------------------------------
 
 function test()
 {
   printBugNumber(BUGNUMBER);
   printStatus (summary);
 
-  if (typeof window == 'undefined')
-  {
-    expect = actual = 'Test skipped: browser only';
-    reportCompare(expect, actual, summary);
-  }
-  else
-  {
-    gDelayTestDriverEnd = true;
-
+  gDelayTestDriverEnd = true;
 
     function newScriptWithLoop(m)
     {
       var ns = document.createElement("script");
       var nt = document.createTextNode("for (var q = 0; q < " + m + "; ++q) { }");
       ns.appendChild(nt);
       return ns;
     }
@@ -46,11 +39,10 @@ function test()
       document.body.appendChild(div);
 
 
       reportCompare(expect, actual, summary);
       gDelayTestDriverEnd = false;
       jsTestDriverEnd();
     }
 
-    window.addEventListener('load', boom, false);
-  }
+  window.addEventListener('load', boom, false);
 }
--- a/js/src/tests/js1_5/extensions/regress-327608.js
+++ b/js/src/tests/js1_5/extensions/regress-327608.js
@@ -1,8 +1,9 @@
+// |reftest| skip-if(xulRuntime.shell)
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 327608;
 var summary = 'Do not assume we will find the prototype property';
@@ -29,20 +30,13 @@ function init()
   var blurfun = inp.blur;
   blurfun.__proto__ = null;
   countProps(blurfun);
   reportCompare(expect, actual, summary);
   gDelayTestDriverEnd = false;
   jsTestDriverEnd();
 }
 
-if (typeof window != 'undefined')
-{
-  // delay test driver end
-  gDelayTestDriverEnd = true;
+// delay test driver end
+gDelayTestDriverEnd = true;
 
-  document.write('<input>');
-  window.addEventListener("load", init, false);
-}
-else
-{
-  reportCompare(expect, actual, summary);
-}
+document.write('<input>');
+window.addEventListener("load", init, false);
--- a/js/src/tests/js1_5/extensions/regress-367121.js
+++ b/js/src/tests/js1_5/extensions/regress-367121.js
@@ -1,8 +1,9 @@
+// |reftest| skip-if(xulRuntime.shell)
 /* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 367121;
 var summary = 'self modifying script detection';
@@ -14,22 +15,17 @@ var expect = 'No Crash';
 test();
 //-----------------------------------------------------------------------------
 
 function test()
 {
   printBugNumber(BUGNUMBER);
   printStatus (summary);
  
-  if (typeof window == 'undefined')
-  {
-    actual = expect = 'Test skipped - Test must be run in the browser.';
-    reportCompare(expect, actual, summary);
-  }
-  else if (typeof Script == 'undefined')
+  if (typeof Script == 'undefined')
   {
     actual = expect = 'Test skipped - Test requires Script object..';
     reportCompare(expect, actual, summary);
   }
   else
   {
     gDelayTestDriverEnd = true;
   }
@@ -50,12 +46,9 @@ function handleLoad()
 	var s = new Script("d.dispatchEvent(e);");
 	s.exec();
 
   gDelayTestDriverEnd = false;
   reportCompare(expect, actual, summary);
   jsTestDriverEnd();
 }
 
-if (typeof window != 'undefined')
-{
-  window.onload = handleLoad;
-}
+window.onload = handleLoad;
--- a/js/src/tests/js1_5/extensions/regress-367589.js
+++ b/js/src/tests/js1_5/extensions/regress-367589.js
@@ -1,9 +1,9 @@
-// |reftest| skip-if(xulRuntime.OS=="WINNT"&&isDebugBuild) slow
+// |reftest| skip-if(xulRuntime.shell||(xulRuntime.OS=="WINNT"&&isDebugBuild)) slow
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 367589;
 var summary = 'Do not assert !SPROP_HAS_STUB_SETTER(sprop) || (sprop->attrs & JSPROP_GETTER)';
@@ -14,27 +14,20 @@ var expect = 'No Crash';
 //-----------------------------------------------------------------------------
 test();
 //-----------------------------------------------------------------------------
 
 function test()
 {
   printBugNumber(BUGNUMBER);
   printStatus (summary);
- 
-  if (typeof window != 'undefined')
-  {
-    gDelayTestDriverEnd = true;
-    document.write('<button id="button" onclick="document.getElementsByTagName(\'button\')[0] = \'wtf\';">Crash</button>');
-    window.addEventListener('load', crash, false);
-  }
-  else
-  {
-    reportCompare(expect, actual, summary);
-  }
+
+  gDelayTestDriverEnd = true;
+  document.write('<button id="button" onclick="document.getElementsByTagName(\'button\')[0] = \'wtf\';">Crash</button>');
+  window.addEventListener('load', crash, false);
 }
 
 function crash()
 {
   document.getElementById('button').click();
   setTimeout(checkCrash, 0);
 }
 
--- a/js/src/tests/js1_5/extensions/regress-369404.js
+++ b/js/src/tests/js1_5/extensions/regress-369404.js
@@ -1,8 +1,9 @@
+// |reftest| skip-if(xulRuntime.shell)
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 369404;
 var summary = 'Do not assert: !SPROP_HAS_STUB_SETTER(sprop) || (sprop->attrs & JSPROP_GETTER) ';
@@ -13,33 +14,26 @@ var expect = 'No Crash';
 //-----------------------------------------------------------------------------
 test();
 //-----------------------------------------------------------------------------
 
 function test()
 {
   printBugNumber(BUGNUMBER);
   printStatus (summary);
- 
-  if (typeof window != 'undefined')
-  {
-    gDelayTestDriverEnd = true;
-    document.write('<span id="r"> </span>' +
-                   '<script>' +
-                   'f = function(){};' +
-                   'f.prototype = document.getElementById("r").childNodes;' +
-                   'j = new f();' +
-                   'j[0] = null;' +
-                   '</script>');
-    window.addEventListener('load', crash, false);
-  }
-  else
-  {
-    reportCompare(expect, actual, summary);
-  }
+
+  gDelayTestDriverEnd = true;
+  document.write('<span id="r"> </span>' +
+                 '<script>' +
+                 'f = function(){};' +
+                 'f.prototype = document.getElementById("r").childNodes;' +
+                 'j = new f();' +
+                 'j[0] = null;' +
+                 '</script>');
+  window.addEventListener('load', crash, false);
 }
 
 function crash()
 {
   gDelayTestDriverEnd = false;
   reportCompare(expect, actual, summary);
   jsTestDriverEnd();
 }
--- a/js/src/tests/js1_5/extensions/regress-372309.js
+++ b/js/src/tests/js1_5/extensions/regress-372309.js
@@ -1,8 +1,9 @@
+// |reftest| skip-if(xulRuntime.shell)
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 372309;
 var summary = 'Root new array objects';
@@ -25,20 +26,12 @@ function test()
   img1canvas.getContext("2d").getImageData(0, 0, width, height).data;
   img2canvas.getContext("2d").getImageData(0, 0, width, height).data;
  
   reportCompare(expect, actual, summary);
   gDelayTestDriverEnd = false;
   jsTestDriverEnd();
 }
 
-if (typeof window != 'undefined')
-{
-  // delay test driver end
-  gDelayTestDriverEnd = true;
+// delay test driver end
+gDelayTestDriverEnd = true;
 
-  window.addEventListener("load", test, false);
-}
-else
-{
-  reportCompare(expect, actual, summary);
-}
-
+window.addEventListener("load", test, false);
--- a/js/src/tests/js1_5/extensions/regress-407720.js
+++ b/js/src/tests/js1_5/extensions/regress-407720.js
@@ -1,9 +1,9 @@
-// |reftest| skip-if(!xulRuntime.shell) slow
+// |reftest| skip slow
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 407720;
 var summary = 'js_FindClassObject causes crashes with getter/setter - Browser only';
@@ -11,27 +11,19 @@ var actual = 'No Crash';
 var expect = 'No Crash';
 
 printBugNumber(BUGNUMBER);
 printStatus (summary);
 
 // stop the test after 60 seconds
 var start = new Date();
 
-if (typeof document != 'undefined')
-{ 
-  // delay test driver end
-  gDelayTestDriverEnd = true;
-  document.write('<iframe onload="onLoad()"><\/iframe>');
-}
-else
-{
-  actual = 'No Crash';
-  reportCompare(expect, actual, summary);
-}
+// delay test driver end
+gDelayTestDriverEnd = true;
+document.write('<iframe onload="onLoad()"><\/iframe>');
 
 function onLoad() 
 {
 
   if ( (new Date() - start) < 60*1000)
   {
     var x = frames[0].Window.prototype;
     x.a = x.b = x.c = 1;
--- a/js/src/tests/js1_5/extensions/regress-443569.js
+++ b/js/src/tests/js1_5/extensions/regress-443569.js
@@ -1,34 +1,28 @@
+// |reftest| skip-if(xulRuntime.shell)
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 443569;
 var summary = 'Do not assert: OBJ_IS_NATIVE(obj)';
 var actual = 'No Crash';
 var expect = 'No Crash';
 
 
 printBugNumber(BUGNUMBER);
 printStatus (summary);
 
-if (typeof window != 'undefined')
-{
-  // delay test driver end
-  gDelayTestDriverEnd = true;
+// delay test driver end
+gDelayTestDriverEnd = true;
 
-  window.addEventListener("load", boom, false);
-}
-else
-{
-  reportCompare(expect, actual, summary);
-}
+window.addEventListener("load", boom, false);
 
 function boom()
 {
   var r = RegExp.prototype;
   r["-1"] = 0;
   Array.prototype.__proto__ = r;
   []["-1"];
 
--- a/js/src/tests/js1_5/extensions/regress-454704.js
+++ b/js/src/tests/js1_5/extensions/regress-454704.js
@@ -1,8 +1,9 @@
+// |reftest| skip-if(xulRuntime.shell)
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 454704;
 var summary = 'Do not crash with defineGetter and XPC wrapper';
@@ -14,24 +15,24 @@ var expect = '';
 test();
 //-----------------------------------------------------------------------------
 
 function test()
 {
   printBugNumber(BUGNUMBER);
   printStatus (summary);
 
-  if (typeof XPCSafeJSObjectWrapper != 'undefined' && typeof document != 'undefined')
+  if (typeof XPCSafeJSObjectWrapper != 'undefined')
   {
     gDelayTestDriverEnd = true;
     document.addEventListener('load', boom, true);
   }
   else
   {
-    print(expect = actual = 'Test requires browser.');
+    print(expect = actual = 'Test requires XPCSafeJSObjectWrapper.');
     reportCompare(expect, actual, summary);
   }
 }
 
 function boom()
 {
   try
   {
--- a/js/src/tests/js1_7/iterable/regress-341815.js
+++ b/js/src/tests/js1_7/iterable/regress-341815.js
@@ -1,9 +1,9 @@
-// |reftest| skip-if(!xulRuntime.shell) -- bug xxx - fails to dismiss alert
+// |reftest| skip -- bug xxx - fails to dismiss alert
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 341815;
 var summary = 'Close hook crash';
@@ -72,20 +72,12 @@ function checkTest()
     return;
   }
 
   reportCompare(expect, actual, summary);
   gDelayTestDriverEnd = false;
   jsTestDriverEnd();
 }
 
-if (typeof window != 'undefined')
-{
-  // delay test driver end
-  gDelayTestDriverEnd = true;
+// delay test driver end
+gDelayTestDriverEnd = true;
 
-  window.addEventListener("load", init, false);
-}
-else
-{
-  reportCompare(expect, actual, summary);
-}
-
+window.addEventListener("load", init, false);
--- a/js/src/tests/js1_7/iterable/regress-341821.js
+++ b/js/src/tests/js1_7/iterable/regress-341821.js
@@ -1,9 +1,9 @@
-// |reftest| skip-if(!xulRuntime.shell) -- bug xxx - fails to dismiss alert
+// |reftest| skip -- bug xxx - fails to dismiss alert
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 341821;
 var summary = 'Close hook crash';
@@ -61,20 +61,12 @@ function init()
 function runtest()
 {
   test();
   reportCompare(expect, actual, summary);
   gDelayTestDriverEnd = false;
   jsTestDriverEnd();
 }
 
-if (typeof window != 'undefined')
-{
-  // delay test driver end
-  gDelayTestDriverEnd = true;
+// delay test driver end
+gDelayTestDriverEnd = true;
 
-  window.addEventListener("load", init, false);
-}
-else
-{
-  reportCompare(expect, actual, summary);
-}
-
+window.addEventListener("load", init, false);