From 8843cc7d490f731d373363153684a3843041274c Mon Sep 17 00:00:00 2001 From: "bclary%bclary.com" Date: Mon, 7 May 2007 05:18:27 +0000 Subject: [PATCH] JavaScript Tests - disable window.onerror handler to prevent false failure, bug 340804 --- js/tests/js1_5/Regress/regress-314401.js | 64 +++++++++++++----------- 1 file changed, 35 insertions(+), 29 deletions(-) diff --git a/js/tests/js1_5/Regress/regress-314401.js b/js/tests/js1_5/Regress/regress-314401.js index 2826c55a7a6..8e4869c0312 100755 --- a/js/tests/js1_5/Regress/regress-314401.js +++ b/js/tests/js1_5/Regress/regress-314401.js @@ -42,9 +42,16 @@ var expect = 'No Crash'; printBugNumber (bug); printStatus (summary); - -if (typeof setTimeout != 'undefined') + +if (typeof setTimeout == 'undefined') { + reportCompare(expect, actual, 'Test Skipped.'); +} +else +{ + gDelayTestDriverEnd = true; + window.onerror = null; + try { setTimeout(eval, 0, '', null); @@ -53,24 +60,22 @@ if (typeof setTimeout != 'undefined') { printStatus(ex+''); } -} -reportCompare(expect, actual, 'setTimeout(eval, 0, "", null)'); -if (typeof setTimeout != 'undefined' && typeof Script != 'undefined') -{ - try - { - setTimeout(Script, 0, '', null); - } - catch(ex) - { - printStatus(ex+''); - } -} -reportCompare(expect, actual, 'setTimeout(Script, 0, "", null)'); + reportCompare(expect, actual, 'setTimeout(eval, 0, "", null)'); + + if (typeof Script != 'undefined') + { + try + { + setTimeout(Script, 0, '', null); + } + catch(ex) + { + printStatus(ex+''); + } + reportCompare(expect, actual, 'setTimeout(Script, 0, "", null)'); + } -if (typeof setInterval != 'undefined') -{ try { setInterval(eval, 0, '', null); @@ -79,18 +84,19 @@ if (typeof setInterval != 'undefined') { printStatus(ex+''); } -} -reportCompare(expect, actual, 'setInterval(eval, 0, "", null)'); + reportCompare(expect, actual, 'setInterval(eval, 0, "", null)'); -if (typeof setInterval != 'undefined' && typeof Script != 'undefined') -{ - try + if (typeof Script != 'undefined') { - setInterval(Script, 0, '', null); + try + { + setInterval(Script, 0, '', null); + } + catch(ex) + { + printStatus(ex+''); + } + reportCompare(expect, actual, 'setInterval(Script, 0, "", null)'); } - catch(ex) - { - printStatus(ex+''); - } + setTimeout('gDelayTestDriverEnd = false; jsTestDriverEnd();', 0); } -reportCompare(expect, actual, 'setInterval(Script, 0, "", null)');