aboutsummaryrefslogtreecommitdiffstats
path: root/console/harness/gs.js
diff options
context:
space:
mode:
Diffstat (limited to 'console/harness/gs.js')
-rw-r--r--console/harness/gs.js99
1 files changed, 51 insertions, 48 deletions
diff --git a/console/harness/gs.js b/console/harness/gs.js
index 210c08548..855cb85bf 100644
--- a/console/harness/gs.js
+++ b/console/harness/gs.js
@@ -5,38 +5,60 @@
/// copyright and this notice and otherwise comply with the Use Terms.
//Global Scope Test Case Validator
+function $DONE() {
-//An exception is expected
-if (testDescrip.negative !== undefined) {
- //TODO - come up with a generic way of catching the error type
- //from this.onerror
- testDescrip.negative = testDescrip.negative === "NotEarlyError" ?
- testDescrip.negative :
- (testDescrip.negative === "^((?!NotEarlyError).)*$" ?
- testDescrip.negative : ".");
- if (this.iframeError === undefined) { //no exception was thrown
- 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
+ //An exception is expected
+ if (testDescrip.negative !== undefined) {
+ //TODO - come up with a generic way of catching the error type
+ //from this.onerror
+ testDescrip.negative = testDescrip.negative === "NotEarlyError" ?
+ testDescrip.negative :
+ (testDescrip.negative === "^((?!NotEarlyError).)*$" ?
+ testDescrip.negative : ".");
+ if (this.iframeError === undefined) { //no exception was thrown
+ 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 + '".'));
+ } else {
+ testRun(testDescrip.id,
+ testDescrip.path,
+ testDescrip.description,
+ testDescrip.code,
+ 'pass',
+ undefined);
+ }
+ }
+
+ //Exception was not expected to be thrown
+ else if (this.iframeError !== undefined) {
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 + '".'));
- } else {
+ Error('Unexpected exception, "' +
+ this.iframeError + '" was thrown.'));
+ }
+
+ else {
testRun(testDescrip.id,
testDescrip.path,
testDescrip.description,
@@ -44,26 +66,7 @@ if (testDescrip.negative !== undefined) {
'pass',
undefined);
}
-}
-
-//Exception was not expected to be thrown
-else if (this.iframeError !== undefined) {
- testRun(testDescrip.id,
- testDescrip.path,
- testDescrip.description,
- testDescrip.code,
- 'fail',
- Error('Unexpected exception, "' +
- this.iframeError + '" was thrown.'));
-}
-
-else {
- testRun(testDescrip.id,
- testDescrip.path,
- testDescrip.description,
- testDescrip.code,
- 'pass',
- undefined);
-}
-testFinished(); \ No newline at end of file
+ //teardown
+ testFinished();
+} \ No newline at end of file