2011-10-03 21:08:06 +02:00
|
|
|
/// Copyright (c) 2011 Microsoft Corporation
|
|
|
|
///
|
test\harness\*:
- a lot of JS harness code written in strings have been moved out to actual physical files
such as ed.js (syntax error detection for globally scoped tests) and gs.js (global scope test
case validator). This change makes it far easier to maintain the test harness code
- reorganized helper.js providing a clear indication which methods are used by external objects,
which are implementation details, and which are unequivocally test262-specific. I've also added,
openErrorWindow, which will be used to open a descriptive error message window for each test case
failure reported on the 'Run' tab
- improved the error message for syntax errors occurring when a test case fails to load
- sta.js no longer tries to pickle all helper functions it contains! Instead, we load the file
directly from sth.js. The performance of fnGlobalObject has been improved. Finally, the ES5Harness
object has been moved from sth.js (in a string) to here
- sth.js now has a browser implementer hook, controller.implementerHook, which allows browser implementers
to handle test case failures in their own way (e.g., log to the filesystem). The 'run' function was
basically re-written
Added 37 new test cases from the "IE Test Center" Build release. There were 14 modifications to
existing test cases as well. Refactored SputnikGlobalScope.js such that test case paths are now used
as indices into the GlobalScopeTests array.
TestCasePackager.py had the concept of templated test harnesses introduced - see templates\runner.test262.html.
Also added support for one HTML test harness per ES5 chapter. Last but not least, TestCasePackagerConfig.py
now has a 'source control' abstraction class which abstracts away source control adds|edits when dynamically
generating *.json and *.html test chapters.
2011-08-25 20:18:44 +02:00
|
|
|
/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
2011-10-03 21:08:06 +02:00
|
|
|
/// that the following conditions are met:
|
test\harness\*:
- a lot of JS harness code written in strings have been moved out to actual physical files
such as ed.js (syntax error detection for globally scoped tests) and gs.js (global scope test
case validator). This change makes it far easier to maintain the test harness code
- reorganized helper.js providing a clear indication which methods are used by external objects,
which are implementation details, and which are unequivocally test262-specific. I've also added,
openErrorWindow, which will be used to open a descriptive error message window for each test case
failure reported on the 'Run' tab
- improved the error message for syntax errors occurring when a test case fails to load
- sta.js no longer tries to pickle all helper functions it contains! Instead, we load the file
directly from sth.js. The performance of fnGlobalObject has been improved. Finally, the ES5Harness
object has been moved from sth.js (in a string) to here
- sth.js now has a browser implementer hook, controller.implementerHook, which allows browser implementers
to handle test case failures in their own way (e.g., log to the filesystem). The 'run' function was
basically re-written
Added 37 new test cases from the "IE Test Center" Build release. There were 14 modifications to
existing test cases as well. Refactored SputnikGlobalScope.js such that test case paths are now used
as indices into the GlobalScopeTests array.
TestCasePackager.py had the concept of templated test harnesses introduced - see templates\runner.test262.html.
Also added support for one HTML test harness per ES5 chapter. Last but not least, TestCasePackagerConfig.py
now has a 'source control' abstraction class which abstracts away source control adds|edits when dynamically
generating *.json and *.html test chapters.
2011-08-25 20:18:44 +02:00
|
|
|
/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
|
2011-10-03 21:08:06 +02:00
|
|
|
/// the following disclaimer.
|
|
|
|
/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
|
|
|
/// the following disclaimer in the documentation and/or other materials provided with the distribution.
|
test\harness\*:
- a lot of JS harness code written in strings have been moved out to actual physical files
such as ed.js (syntax error detection for globally scoped tests) and gs.js (global scope test
case validator). This change makes it far easier to maintain the test harness code
- reorganized helper.js providing a clear indication which methods are used by external objects,
which are implementation details, and which are unequivocally test262-specific. I've also added,
openErrorWindow, which will be used to open a descriptive error message window for each test case
failure reported on the 'Run' tab
- improved the error message for syntax errors occurring when a test case fails to load
- sta.js no longer tries to pickle all helper functions it contains! Instead, we load the file
directly from sth.js. The performance of fnGlobalObject has been improved. Finally, the ES5Harness
object has been moved from sth.js (in a string) to here
- sth.js now has a browser implementer hook, controller.implementerHook, which allows browser implementers
to handle test case failures in their own way (e.g., log to the filesystem). The 'run' function was
basically re-written
Added 37 new test cases from the "IE Test Center" Build release. There were 14 modifications to
existing test cases as well. Refactored SputnikGlobalScope.js such that test case paths are now used
as indices into the GlobalScopeTests array.
TestCasePackager.py had the concept of templated test harnesses introduced - see templates\runner.test262.html.
Also added support for one HTML test harness per ES5 chapter. Last but not least, TestCasePackagerConfig.py
now has a 'source control' abstraction class which abstracts away source control adds|edits when dynamically
generating *.json and *.html test chapters.
2011-08-25 20:18:44 +02:00
|
|
|
/// * Neither the name of Microsoft nor the names of its contributors may be used to
|
|
|
|
/// endorse or promote products derived from this software without specific prior written permission.
|
2011-10-03 21:08:06 +02:00
|
|
|
///
|
test\harness\*:
- a lot of JS harness code written in strings have been moved out to actual physical files
such as ed.js (syntax error detection for globally scoped tests) and gs.js (global scope test
case validator). This change makes it far easier to maintain the test harness code
- reorganized helper.js providing a clear indication which methods are used by external objects,
which are implementation details, and which are unequivocally test262-specific. I've also added,
openErrorWindow, which will be used to open a descriptive error message window for each test case
failure reported on the 'Run' tab
- improved the error message for syntax errors occurring when a test case fails to load
- sta.js no longer tries to pickle all helper functions it contains! Instead, we load the file
directly from sth.js. The performance of fnGlobalObject has been improved. Finally, the ES5Harness
object has been moved from sth.js (in a string) to here
- sth.js now has a browser implementer hook, controller.implementerHook, which allows browser implementers
to handle test case failures in their own way (e.g., log to the filesystem). The 'run' function was
basically re-written
Added 37 new test cases from the "IE Test Center" Build release. There were 14 modifications to
existing test cases as well. Refactored SputnikGlobalScope.js such that test case paths are now used
as indices into the GlobalScopeTests array.
TestCasePackager.py had the concept of templated test harnesses introduced - see templates\runner.test262.html.
Also added support for one HTML test harness per ES5 chapter. Last but not least, TestCasePackagerConfig.py
now has a 'source control' abstraction class which abstracts away source control adds|edits when dynamically
generating *.json and *.html test chapters.
2011-08-25 20:18:44 +02:00
|
|
|
/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
|
|
|
/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
|
|
/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
|
|
|
/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
|
|
/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
2011-10-03 21:08:06 +02:00
|
|
|
/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
test\harness\*:
- a lot of JS harness code written in strings have been moved out to actual physical files
such as ed.js (syntax error detection for globally scoped tests) and gs.js (global scope test
case validator). This change makes it far easier to maintain the test harness code
- reorganized helper.js providing a clear indication which methods are used by external objects,
which are implementation details, and which are unequivocally test262-specific. I've also added,
openErrorWindow, which will be used to open a descriptive error message window for each test case
failure reported on the 'Run' tab
- improved the error message for syntax errors occurring when a test case fails to load
- sta.js no longer tries to pickle all helper functions it contains! Instead, we load the file
directly from sth.js. The performance of fnGlobalObject has been improved. Finally, the ES5Harness
object has been moved from sth.js (in a string) to here
- sth.js now has a browser implementer hook, controller.implementerHook, which allows browser implementers
to handle test case failures in their own way (e.g., log to the filesystem). The 'run' function was
basically re-written
Added 37 new test cases from the "IE Test Center" Build release. There were 14 modifications to
existing test cases as well. Refactored SputnikGlobalScope.js such that test case paths are now used
as indices into the GlobalScopeTests array.
TestCasePackager.py had the concept of templated test harnesses introduced - see templates\runner.test262.html.
Also added support for one HTML test harness per ES5 chapter. Last but not least, TestCasePackagerConfig.py
now has a 'source control' abstraction class which abstracts away source control adds|edits when dynamically
generating *.json and *.html test chapters.
2011-08-25 20:18:44 +02:00
|
|
|
|
|
|
|
//Global Scope Test Case Validator
|
|
|
|
|
|
|
|
//An exception is expected
|
|
|
|
if (testDescrip.negative !== undefined) {
|
2011-10-03 21:08:06 +02:00
|
|
|
//TODO - come up with a generic way of catching the error type
|
|
|
|
//from this.onerror
|
2011-09-26 02:05:32 +02:00
|
|
|
testDescrip.negative = testDescrip.negative === "NotEarlyError" ?
|
2011-10-03 21:08:06 +02:00
|
|
|
testDescrip.negative :
|
|
|
|
(testDescrip.negative === "^((?!NotEarlyError).)*$" ?
|
|
|
|
testDescrip.negative : ".");
|
2011-09-27 01:12:46 +02:00
|
|
|
if (this.iframeError === undefined) { //no exception was thrown
|
2011-10-03 21:08:06 +02:00
|
|
|
testRun(testDescrip.id,
|
|
|
|
testDescrip.path,
|
|
|
|
testDescrip.description,
|
|
|
|
testDescrip.code,
|
|
|
|
'fail',
|
|
|
|
Error('No exception was thrown; expected an error "message"' +
|
|
|
|
' property matching the regular expression "' +
|
|
|
|
testDescrip.negative + '".'));
|
|
|
|
} else if (!(new RegExp(testDescrip.negative,
|
|
|
|
"i").test(this.iframeError))) {
|
|
|
|
//wrong type of exception thrown
|
|
|
|
testRun(testDescrip.id,
|
|
|
|
testDescrip.path,
|
|
|
|
testDescrip.description,
|
|
|
|
testDescrip.code,
|
|
|
|
'fail',
|
|
|
|
Error('Expected an exception with a "message"' +
|
|
|
|
' property matching the regular expression "' +
|
|
|
|
testDescrip.negative +
|
|
|
|
'" to be thrown; actual was "' +
|
|
|
|
this.iframeError + '".'));
|
test\harness\*:
- a lot of JS harness code written in strings have been moved out to actual physical files
such as ed.js (syntax error detection for globally scoped tests) and gs.js (global scope test
case validator). This change makes it far easier to maintain the test harness code
- reorganized helper.js providing a clear indication which methods are used by external objects,
which are implementation details, and which are unequivocally test262-specific. I've also added,
openErrorWindow, which will be used to open a descriptive error message window for each test case
failure reported on the 'Run' tab
- improved the error message for syntax errors occurring when a test case fails to load
- sta.js no longer tries to pickle all helper functions it contains! Instead, we load the file
directly from sth.js. The performance of fnGlobalObject has been improved. Finally, the ES5Harness
object has been moved from sth.js (in a string) to here
- sth.js now has a browser implementer hook, controller.implementerHook, which allows browser implementers
to handle test case failures in their own way (e.g., log to the filesystem). The 'run' function was
basically re-written
Added 37 new test cases from the "IE Test Center" Build release. There were 14 modifications to
existing test cases as well. Refactored SputnikGlobalScope.js such that test case paths are now used
as indices into the GlobalScopeTests array.
TestCasePackager.py had the concept of templated test harnesses introduced - see templates\runner.test262.html.
Also added support for one HTML test harness per ES5 chapter. Last but not least, TestCasePackagerConfig.py
now has a 'source control' abstraction class which abstracts away source control adds|edits when dynamically
generating *.json and *.html test chapters.
2011-08-25 20:18:44 +02:00
|
|
|
} else {
|
2011-10-03 21:08:06 +02:00
|
|
|
testRun(testDescrip.id,
|
|
|
|
testDescrip.path,
|
|
|
|
testDescrip.description,
|
|
|
|
testDescrip.code,
|
|
|
|
'pass',
|
|
|
|
undefined);
|
test\harness\*:
- a lot of JS harness code written in strings have been moved out to actual physical files
such as ed.js (syntax error detection for globally scoped tests) and gs.js (global scope test
case validator). This change makes it far easier to maintain the test harness code
- reorganized helper.js providing a clear indication which methods are used by external objects,
which are implementation details, and which are unequivocally test262-specific. I've also added,
openErrorWindow, which will be used to open a descriptive error message window for each test case
failure reported on the 'Run' tab
- improved the error message for syntax errors occurring when a test case fails to load
- sta.js no longer tries to pickle all helper functions it contains! Instead, we load the file
directly from sth.js. The performance of fnGlobalObject has been improved. Finally, the ES5Harness
object has been moved from sth.js (in a string) to here
- sth.js now has a browser implementer hook, controller.implementerHook, which allows browser implementers
to handle test case failures in their own way (e.g., log to the filesystem). The 'run' function was
basically re-written
Added 37 new test cases from the "IE Test Center" Build release. There were 14 modifications to
existing test cases as well. Refactored SputnikGlobalScope.js such that test case paths are now used
as indices into the GlobalScopeTests array.
TestCasePackager.py had the concept of templated test harnesses introduced - see templates\runner.test262.html.
Also added support for one HTML test harness per ES5 chapter. Last but not least, TestCasePackagerConfig.py
now has a 'source control' abstraction class which abstracts away source control adds|edits when dynamically
generating *.json and *.html test chapters.
2011-08-25 20:18:44 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//Exception was not expected to be thrown
|
2011-10-03 21:08:06 +02:00
|
|
|
else if (this.iframeError !== undefined) {
|
|
|
|
testRun(testDescrip.id,
|
|
|
|
testDescrip.path,
|
|
|
|
testDescrip.description,
|
|
|
|
testDescrip.code,
|
|
|
|
'fail',
|
|
|
|
Error('Unexpected exception, "' +
|
|
|
|
this.iframeError + '" was thrown.'));
|
|
|
|
}
|
test\harness\*:
- a lot of JS harness code written in strings have been moved out to actual physical files
such as ed.js (syntax error detection for globally scoped tests) and gs.js (global scope test
case validator). This change makes it far easier to maintain the test harness code
- reorganized helper.js providing a clear indication which methods are used by external objects,
which are implementation details, and which are unequivocally test262-specific. I've also added,
openErrorWindow, which will be used to open a descriptive error message window for each test case
failure reported on the 'Run' tab
- improved the error message for syntax errors occurring when a test case fails to load
- sta.js no longer tries to pickle all helper functions it contains! Instead, we load the file
directly from sth.js. The performance of fnGlobalObject has been improved. Finally, the ES5Harness
object has been moved from sth.js (in a string) to here
- sth.js now has a browser implementer hook, controller.implementerHook, which allows browser implementers
to handle test case failures in their own way (e.g., log to the filesystem). The 'run' function was
basically re-written
Added 37 new test cases from the "IE Test Center" Build release. There were 14 modifications to
existing test cases as well. Refactored SputnikGlobalScope.js such that test case paths are now used
as indices into the GlobalScopeTests array.
TestCasePackager.py had the concept of templated test harnesses introduced - see templates\runner.test262.html.
Also added support for one HTML test harness per ES5 chapter. Last but not least, TestCasePackagerConfig.py
now has a 'source control' abstraction class which abstracts away source control adds|edits when dynamically
generating *.json and *.html test chapters.
2011-08-25 20:18:44 +02:00
|
|
|
|
|
|
|
else {
|
2011-10-03 21:08:06 +02:00
|
|
|
testRun(testDescrip.id,
|
|
|
|
testDescrip.path,
|
|
|
|
testDescrip.description,
|
|
|
|
testDescrip.code,
|
|
|
|
'pass',
|
|
|
|
undefined);
|
test\harness\*:
- a lot of JS harness code written in strings have been moved out to actual physical files
such as ed.js (syntax error detection for globally scoped tests) and gs.js (global scope test
case validator). This change makes it far easier to maintain the test harness code
- reorganized helper.js providing a clear indication which methods are used by external objects,
which are implementation details, and which are unequivocally test262-specific. I've also added,
openErrorWindow, which will be used to open a descriptive error message window for each test case
failure reported on the 'Run' tab
- improved the error message for syntax errors occurring when a test case fails to load
- sta.js no longer tries to pickle all helper functions it contains! Instead, we load the file
directly from sth.js. The performance of fnGlobalObject has been improved. Finally, the ES5Harness
object has been moved from sth.js (in a string) to here
- sth.js now has a browser implementer hook, controller.implementerHook, which allows browser implementers
to handle test case failures in their own way (e.g., log to the filesystem). The 'run' function was
basically re-written
Added 37 new test cases from the "IE Test Center" Build release. There were 14 modifications to
existing test cases as well. Refactored SputnikGlobalScope.js such that test case paths are now used
as indices into the GlobalScopeTests array.
TestCasePackager.py had the concept of templated test harnesses introduced - see templates\runner.test262.html.
Also added support for one HTML test harness per ES5 chapter. Last but not least, TestCasePackagerConfig.py
now has a 'source control' abstraction class which abstracts away source control adds|edits when dynamically
generating *.json and *.html test chapters.
2011-08-25 20:18:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
testFinished();
|