mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Update web-platform-tests to revision e8bfc205e36ad699601212cd50083870bad9a75d
This commit is contained in:
parent
65dd6d4340
commit
ccdb0a3458
1428 changed files with 118036 additions and 9786 deletions
|
@ -29,6 +29,7 @@ function JSONtest(params) {
|
|||
this.Params = null; // paramaters passed in
|
||||
this.Promise = null; // master Promise that resolves when intialization is complete
|
||||
this.Properties = null; // testharness_properties from the opening window
|
||||
this.SkipFailures = []; // list of assertionType values that should be skipped if their test would fail
|
||||
this.Test = null; // test being run
|
||||
this.AssertionCounter = 0;// keeps track of which assertion is being processed
|
||||
|
||||
|
@ -122,6 +123,10 @@ function JSONtest(params) {
|
|||
this.DescriptionText = test.description;
|
||||
}
|
||||
|
||||
if (test.hasOwnProperty("skipFailures") && Array.isArray(test.skipFailures) ) {
|
||||
this.SkipFailures = test.skipFailures;
|
||||
}
|
||||
|
||||
if (test.content) {
|
||||
// we have content
|
||||
if (typeof test.content === "string") {
|
||||
|
@ -407,7 +412,7 @@ JSONtest.prototype = {
|
|||
var message = assert.hasOwnProperty('errorMessage') ?
|
||||
assert.errorMessage : "Result was not " + expected;
|
||||
var type = assert.hasOwnProperty('assertionType') ?
|
||||
assert.assertionType : "must" ;
|
||||
assert.assertionType.toLowerCase() : "must" ;
|
||||
if (!typeMap.hasOwnProperty(type)) {
|
||||
type = "must";
|
||||
}
|
||||
|
@ -507,39 +512,42 @@ JSONtest.prototype = {
|
|||
return ;
|
||||
}
|
||||
|
||||
if (testAction !== 'continue') {
|
||||
if (testAction === 'continue') {
|
||||
// a previous test told us to not run this test; skip it
|
||||
test(function() { }, "SKIPPED: " + assert.title);
|
||||
} else {
|
||||
// test(function() { }, "SKIPPED: " + assert.title);
|
||||
// start an actual sub-test
|
||||
test(function() {
|
||||
var valid = validate(content) ;
|
||||
var valid = validate(content) ;
|
||||
|
||||
var result = this.determineResult(assert, valid) ;
|
||||
var theResult = this.determineResult(assert, valid) ;
|
||||
|
||||
// remember the result
|
||||
theResults.push(result);
|
||||
// remember the result
|
||||
theResults.push(theResult);
|
||||
|
||||
var newAction = this.determineAction(assert, result) ;
|
||||
// next time around we will use this action
|
||||
testAction = newAction;
|
||||
var newAction = this.determineAction(assert, theResult) ;
|
||||
// next time around we will use this action
|
||||
testAction = newAction;
|
||||
|
||||
var err = ";";
|
||||
if (validate.errors !== null) {
|
||||
err = "; Errors: " + this.ajv.errorsText(validate.errors) + ";" ;
|
||||
}
|
||||
if (testAction === 'abort') {
|
||||
err += "; Aborting execution of remaining assertions;";
|
||||
} else if (testAction === 'skip') {
|
||||
err += "; Skipping execution of remaining assertions at level " + level + ";";
|
||||
}
|
||||
if (result === false) {
|
||||
// test result was unexpected; use message
|
||||
assert_true(result, typeMap[type] + message + err);
|
||||
} else {
|
||||
assert_true(result, err) ;
|
||||
}
|
||||
}.bind(this), "" + level + ":" + (num+1) + " " + assert.title);
|
||||
// only run the test if we are NOT skipping fails for some types
|
||||
// or the result is expected
|
||||
if ( theResult === true || !this.SkipFailures.includes(type) ) {
|
||||
test(function() {
|
||||
var err = ";";
|
||||
if (validate.errors !== null && !assert.hasOwnProperty("errorMessage")) {
|
||||
err = "; Errors: " + this.ajv.errorsText(validate.errors) + ";" ;
|
||||
}
|
||||
if (testAction === 'abort') {
|
||||
err += "; Aborting execution of remaining assertions;";
|
||||
} else if (testAction === 'skip') {
|
||||
err += "; Skipping execution of remaining assertions at level " + level + ";";
|
||||
}
|
||||
if (theResult === false) {
|
||||
// test result was unexpected; use message
|
||||
assert_true(theResult, typeMap[type] + message + err);
|
||||
} else {
|
||||
assert_true(theResult, err) ;
|
||||
}
|
||||
}.bind(this), "" + level + ":" + (num+1) + " " + assert.title);
|
||||
}
|
||||
}
|
||||
}.bind(this));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue