From 82c8d63eee1790e2c4e3ac837c85b97a7e25e54f Mon Sep 17 00:00:00 2001 From: David Fugate Date: Tue, 8 Feb 2011 09:42:59 -0800 Subject: [PATCH] Added a test harness 'debug' mode to Simple Test Harness. Accessible via appending "?sitedebug" to the end of the Test262 URL. There's a mismatch between the Test262 test harness and IE Test Center's harness which invalidated 15.4.4.17-5-1.js, 15.4.4.18-5-1.js, and 15.4.4.20-5-1.js on Test262. Essentially what's going on is Test262 uses the 'window' object as 'this' for the test case functions whereas IE Test Center uses the test case object housing the test case function as this. This causes problems for test cases pertaining to scoping. I've gone ahead and adjusted the Test262 tests to expect 'window' to be 'this', and will be updating IE Test Center's harness to use the 'window' object as well so we don't run into this problem again. --- test/harness/helper.js | 6 +++++- test/harness/sth.js | 14 ++++++++++++++ .../15.4/15.4.4/15.4.4.17/15.4.4.17-5-1.js | 6 +++--- .../15.4/15.4.4/15.4.4.18/15.4.4.18-5-1.js | 6 +++--- .../15.4/15.4.4/15.4.4.20/15.4.4.20-5-1.js | 6 +++--- website/resources/scripts/global/helper.js | 6 +++++- website/resources/scripts/global/sth.js | 14 ++++++++++++++ website/resources/scripts/testcases/chapter15.xml | 6 +++--- .../resources/scripts/testcases/testcaseslist.xml | 2 +- 9 files changed, 51 insertions(+), 15 deletions(-) diff --git a/test/harness/helper.js b/test/harness/helper.js index fb3d044283..110b23b077 100644 --- a/test/harness/helper.js +++ b/test/harness/helper.js @@ -291,7 +291,11 @@ function Presenter() { this.finished = function(elapsed) { $('.button-start').attr('src', 'resources/images/start.png'); - activityBar.text('Overall Execution Time: ' + elapsed + ' minutes'); + if (isSiteDebugMode()) { + activityBar.text('Overall Execution Time: ' + elapsed + ' minutes'); + } else { + activityBar.text(''); + } } /* Refresh display of the report */ diff --git a/test/harness/sth.js b/test/harness/sth.js index 40bd303bdc..63e71d1f30 100644 --- a/test/harness/sth.js +++ b/test/harness/sth.js @@ -303,6 +303,20 @@ function Controller() { var controller = new Controller() +/* Helper function which shows if we're in the 'debug' mode of the Test262 site. + This mode is only useful for debugging issues with the test harness and + website. */ +function isSiteDebugMode() { + var str=window.location.href.substring(window.location.href.indexOf("?")+1) + if(str.indexOf("sitedebug") > -1) { + return true; + } + else { + return false; + } +} + + $(function () { presenter.setup(); diff --git a/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.17/15.4.4.17-5-1.js b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.17/15.4.4.17-5-1.js index e378f6c1d1..e54e3ef446 100644 --- a/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.17/15.4.4.17-5-1.js +++ b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.17/15.4.4.17-5-1.js @@ -24,11 +24,11 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.17/15.4.4.17-5-1.js", - description: "Array.prototype.some - thisArg not passed", + description: "Array.prototype.some - thisArg is passed", test: function testcase() { - this._15_4_4_17_5_1 = true; - var _15_4_4_17_5_1 = false; + this._15_4_4_17_5_1 = false; + var _15_4_4_17_5_1 = true; function callbackfn(val, idx, obj) { return this._15_4_4_17_5_1; diff --git a/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-1.js b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-1.js index 1fcd0a09e6..e47dbf3765 100644 --- a/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-1.js +++ b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-1.js @@ -24,11 +24,11 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-1.js", - description: "Array.prototype.forEach - thisArg not passed", + description: "Array.prototype.forEach - thisArg is passed", test: function testcase() { - this._15_4_4_18_5_1 = true; - var _15_4_4_18_5_1 = false; + this._15_4_4_18_5_1 = false; + var _15_4_4_18_5_1 = true; var result; function callbackfn(val, idx, obj) { result = this._15_4_4_18_5_1; diff --git a/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-1.js b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-1.js index 9ca420dd45..6a4ebc1afa 100644 --- a/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-1.js +++ b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-1.js @@ -24,11 +24,11 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-1.js", - description: "Array.prototype.filter - thisArg not passed", + description: "Array.prototype.filter - thisArg is passed", test: function testcase() { - this._15_4_4_17_5_1 = true; - var _15_4_4_17_5_1 = false; + this._15_4_4_17_5_1 = false; + var _15_4_4_17_5_1 = true; function callbackfn(val, idx, obj) { return this._15_4_4_17_5_1; diff --git a/website/resources/scripts/global/helper.js b/website/resources/scripts/global/helper.js index fb3d044283..110b23b077 100644 --- a/website/resources/scripts/global/helper.js +++ b/website/resources/scripts/global/helper.js @@ -291,7 +291,11 @@ function Presenter() { this.finished = function(elapsed) { $('.button-start').attr('src', 'resources/images/start.png'); - activityBar.text('Overall Execution Time: ' + elapsed + ' minutes'); + if (isSiteDebugMode()) { + activityBar.text('Overall Execution Time: ' + elapsed + ' minutes'); + } else { + activityBar.text(''); + } } /* Refresh display of the report */ diff --git a/website/resources/scripts/global/sth.js b/website/resources/scripts/global/sth.js index 40bd303bdc..63e71d1f30 100644 --- a/website/resources/scripts/global/sth.js +++ b/website/resources/scripts/global/sth.js @@ -303,6 +303,20 @@ function Controller() { var controller = new Controller() +/* Helper function which shows if we're in the 'debug' mode of the Test262 site. + This mode is only useful for debugging issues with the test harness and + website. */ +function isSiteDebugMode() { + var str=window.location.href.substring(window.location.href.indexOf("?")+1) + if(str.indexOf("sitedebug") > -1) { + return true; + } + else { + return false; + } +} + + $(function () { presenter.setup(); diff --git a/website/resources/scripts/testcases/chapter15.xml b/website/resources/scripts/testcases/chapter15.xml index b539781541..2e4fbfd1c4 100644 --- a/website/resources/scripts/testcases/chapter15.xml +++ b/website/resources/scripts/testcases/chapter15.xml @@ -2273,7 +2273,7 @@ - + @@ -2446,7 +2446,7 @@ - + @@ -2748,7 +2748,7 @@ - + diff --git a/website/resources/scripts/testcases/testcaseslist.xml b/website/resources/scripts/testcases/testcaseslist.xml index 200f07005d..034e1fcbbc 100644 --- a/website/resources/scripts/testcases/testcaseslist.xml +++ b/website/resources/scripts/testcases/testcaseslist.xml @@ -1,4 +1,4 @@ - + resources/scripts/testcases/07_Lexical_Conventions.xml resources/scripts/testcases/08_Types.xml resources/scripts/testcases/09_Type_Conversion.xml