Commit 204674a3 authored by Stephen McGruer's avatar Stephen McGruer Committed by Commit Bot

Roll WPT js scripts into Chromium

This rolls testharness.js, idlharness.js, and testdriver-actions.js from
the external copy in external/wpt/resources/ to the internal copy in
resources/, bringing us up to WPT SHA 2d15a10a

Bug: None
Change-Id: I95d4ed0d10ffd5833162e3051c4613428c575757
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2222443
Commit-Queue: Stephen McGruer <smcgruer@chromium.org>
Auto-Submit: Stephen McGruer <smcgruer@chromium.org>
Reviewed-by: default avatarLuke Z <lpz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#773212}
parent cf7e307a
This is a testharness.js-based test. This is a testharness.js-based test.
FAIL drag-selected-image-to-contenteditable resources/testharness.js:1988:25) FAIL drag-selected-image-to-contenteditable resources/testharness.js:1977:25)
expected <style>div, img { width: 200px; height: 100px; }</style><div contenteditable id="target">^<img id="image">|</div><img id="image">, expected <style>div, img { width: 200px; height: 100px; }</style><div contenteditable id="target">^<img id="image">|</div><img id="image">,
but got <style>div, img { width: 200px; height: 100px; }</style><div contenteditable id="target"></div>^<img id="image">|, but got <style>div, img { width: 200px; height: 100px; }</style><div contenteditable id="target"></div>^<img id="image">|,
sameupto <style>div, img { width: 200px; height: 100px; }</style><div contenteditable id="target"> sameupto <style>div, img { width: 200px; height: 100px; }</style><div contenteditable id="target">
......
This is a testharness.js-based test. This is a testharness.js-based test.
PASS Continuations across a block -20 PASS Continuations across a block -20
FAIL Continuations across a block -15 resources/testharness.js:1988:25) FAIL Continuations across a block -15 resources/testharness.js:1977:25)
expected <style>* { font: 20px Ahem; }</style><p>^AAAAA</p><p>|BBBBB</p>, expected <style>* { font: 20px Ahem; }</style><p>^AAAAA</p><p>|BBBBB</p>,
but got <style>* { font: 20px Ahem; }</style><p>^AAAAA</p><p>BB|BBB</p>, but got <style>* { font: 20px Ahem; }</style><p>^AAAAA</p><p>BB|BBB</p>,
sameupto <style>* { font: 20px Ahem; }</style><p>^AAAAA</p><p> sameupto <style>* { font: 20px Ahem; }</style><p>^AAAAA</p><p>
......
...@@ -130,9 +130,9 @@ ...@@ -130,9 +130,9 @@
/** /**
* Add a new pointer input source with the given name * Add a new pointer input source with the given name
* *
* @param {String} type - Name of the key source * @param {String} type - Name of the pointer source
* @param {String} pointerType - Type of pointing device * @param {String} pointerType - Type of pointing device
* @param {Bool} set - Set source as the default key source * @param {Bool} set - Set source as the default pointer source
* @returns {Actions} * @returns {Actions}
*/ */
addPointer: function(name, pointerType="mouse", set=true) { addPointer: function(name, pointerType="mouse", set=true) {
......
...@@ -1190,6 +1190,8 @@ policies and contribution forms [3]. ...@@ -1190,6 +1190,8 @@ policies and contribution forms [3].
} }
expose(assert_in_array, "assert_in_array"); expose(assert_in_array, "assert_in_array");
// This function was deprecated in July of 2015.
// See https://github.com/web-platform-tests/wpt/issues/2033
function assert_object_equals(actual, expected, description) function assert_object_equals(actual, expected, description)
{ {
assert(typeof actual === "object" && actual !== null, "assert_object_equals", description, assert(typeof actual === "object" && actual !== null, "assert_object_equals", description,
...@@ -1867,24 +1869,11 @@ policies and contribution forms [3]. ...@@ -1867,24 +1869,11 @@ policies and contribution forms [3].
*/ */
function assert_implements_optional(condition, description) { function assert_implements_optional(condition, description) {
if (!condition) { if (!condition) {
// Due to the difficulty of changing logging statuses, we re-use throw new OptionalFeatureUnsupportedError(description);
// the PRECONDITION_FAILED status for assert_implements_optional.
// See the RFC: https://github.com/web-platform-tests/rfcs/pull/48
//
// TODO(smcgruer): Once assert_precondition is removed, rename the
// exception and move this comment to where PRECONDITION_FAILED is used.
throw new PreconditionFailedError(description);
} }
} }
expose(assert_implements_optional, "assert_implements_optional") expose(assert_implements_optional, "assert_implements_optional")
function assert_precondition(precondition, description) {
if (!precondition) {
throw new PreconditionFailedError(description);
}
}
expose(assert_precondition, "assert_precondition");
function Test(name, properties) function Test(name, properties)
{ {
if (tests.file_is_test && tests.tests.length) { if (tests.file_is_test && tests.tests.length) {
...@@ -1990,7 +1979,7 @@ policies and contribution forms [3]. ...@@ -1990,7 +1979,7 @@ policies and contribution forms [3].
if (this.phase >= this.phases.HAS_RESULT) { if (this.phase >= this.phases.HAS_RESULT) {
return; return;
} }
var status = e instanceof PreconditionFailedError ? this.PRECONDITION_FAILED : this.FAIL; var status = e instanceof OptionalFeatureUnsupportedError ? this.PRECONDITION_FAILED : this.FAIL;
var message = String((typeof e === "object" && e !== null) ? e.message : e); var message = String((typeof e === "object" && e !== null) ? e.message : e);
var stack = e.stack ? e.stack : null; var stack = e.stack ? e.stack : null;
...@@ -2576,7 +2565,7 @@ policies and contribution forms [3]. ...@@ -2576,7 +2565,7 @@ policies and contribution forms [3].
try { try {
func(); func();
} catch (e) { } catch (e) {
this.status.status = e instanceof PreconditionFailedError ? this.status.PRECONDITION_FAILED : this.status.ERROR; this.status.status = e instanceof OptionalFeatureUnsupportedError ? this.status.PRECONDITION_FAILED : this.status.ERROR;
this.status.message = String(e); this.status.message = String(e);
this.status.stack = e.stack ? e.stack : null; this.status.stack = e.stack ? e.stack : null;
this.complete(); this.complete();
...@@ -3118,14 +3107,14 @@ policies and contribution forms [3]. ...@@ -3118,14 +3107,14 @@ policies and contribution forms [3].
status_text_harness[harness_status.OK] = "OK"; status_text_harness[harness_status.OK] = "OK";
status_text_harness[harness_status.ERROR] = "Error"; status_text_harness[harness_status.ERROR] = "Error";
status_text_harness[harness_status.TIMEOUT] = "Timeout"; status_text_harness[harness_status.TIMEOUT] = "Timeout";
status_text_harness[harness_status.PRECONDITION_FAILED] = "Precondition Failed"; status_text_harness[harness_status.PRECONDITION_FAILED] = "Optional Feature Unsupported";
var status_text = {}; var status_text = {};
status_text[Test.prototype.PASS] = "Pass"; status_text[Test.prototype.PASS] = "Pass";
status_text[Test.prototype.FAIL] = "Fail"; status_text[Test.prototype.FAIL] = "Fail";
status_text[Test.prototype.TIMEOUT] = "Timeout"; status_text[Test.prototype.TIMEOUT] = "Timeout";
status_text[Test.prototype.NOTRUN] = "Not Run"; status_text[Test.prototype.NOTRUN] = "Not Run";
status_text[Test.prototype.PRECONDITION_FAILED] = "Precondition Failed"; status_text[Test.prototype.PRECONDITION_FAILED] = "Optional Feature Unsupported";
var status_number = {}; var status_number = {};
forEach(tests, forEach(tests,
...@@ -3507,12 +3496,12 @@ policies and contribution forms [3]. ...@@ -3507,12 +3496,12 @@ policies and contribution forms [3].
return lines.slice(i).join("\n"); return lines.slice(i).join("\n");
} }
function PreconditionFailedError(message) function OptionalFeatureUnsupportedError(message)
{ {
AssertionError.call(this, message); AssertionError.call(this, message);
} }
PreconditionFailedError.prototype = Object.create(AssertionError.prototype); OptionalFeatureUnsupportedError.prototype = Object.create(AssertionError.prototype);
expose(PreconditionFailedError, "PreconditionFailedError"); expose(OptionalFeatureUnsupportedError, "OptionalFeatureUnsupportedError");
function make_message(function_name, description, error, substitutions) function make_message(function_name, description, error, substitutions)
{ {
...@@ -3742,17 +3731,17 @@ policies and contribution forms [3]. ...@@ -3742,17 +3731,17 @@ policies and contribution forms [3].
if (global_scope.addEventListener) { if (global_scope.addEventListener) {
var error_handler = function(error, message, stack) { var error_handler = function(error, message, stack) {
var precondition_failed = error instanceof PreconditionFailedError; var optional_unsupported = error instanceof OptionalFeatureUnsupportedError;
if (tests.file_is_test) { if (tests.file_is_test) {
var test = tests.tests[0]; var test = tests.tests[0];
if (test.phase >= test.phases.HAS_RESULT) { if (test.phase >= test.phases.HAS_RESULT) {
return; return;
} }
var status = precondition_failed ? test.PRECONDITION_FAILED : test.FAIL; var status = optional_unsupported ? test.PRECONDITION_FAILED : test.FAIL;
test.set_status(status, message, stack); test.set_status(status, message, stack);
test.phase = test.phases.HAS_RESULT; test.phase = test.phases.HAS_RESULT;
} else if (!tests.allow_uncaught_exception) { } else if (!tests.allow_uncaught_exception) {
var status = precondition_failed ? tests.status.PRECONDITION_FAILED : tests.status.ERROR; var status = optional_unsupported ? tests.status.PRECONDITION_FAILED : tests.status.ERROR;
tests.status.status = status; tests.status.status = status;
tests.status.message = message; tests.status.message = message;
tests.status.stack = stack; tests.status.stack = stack;
...@@ -3868,11 +3857,11 @@ tr.notrun > td:first-child {\ ...@@ -3868,11 +3857,11 @@ tr.notrun > td:first-child {\
color:blue;\ color:blue;\
}\ }\
\ \
tr.preconditionfailed > td:first-child {\ tr.optionalunsupported > td:first-child {\
color:blue;\ color:blue;\
}\ }\
\ \
.pass > td:first-child, .fail > td:first-child, .timeout > td:first-child, .notrun > td:first-child, .preconditionfailed > td:first-child {\ .pass > td:first-child, .fail > td:first-child, .timeout > td:first-child, .notrun > td:first-child, .optionalunsupported > td:first-child {\
font-variant:small-caps;\ font-variant:small-caps;\
}\ }\
\ \
......
CONSOLE ERROR: line 3451: Uncaught Error: assert_equals: Normal script execution order comparison expected "Inline1;Sync1;EndOfBody;DOMContentLoaded;Async1;" but got "EndOfBody;Inline1;Sync1;DOMContentLoaded;Async1;" CONSOLE ERROR: line 3440: Uncaught Error: assert_equals: Normal script execution order comparison expected "Inline1;Sync1;EndOfBody;DOMContentLoaded;Async1;" but got "EndOfBody;Inline1;Sync1;DOMContentLoaded;Async1;"
This is a testharness.js-based test. This is a testharness.js-based test.
FAIL Async Script Execution Order (wrt possibly deferred Synchronous Script) Uncaught Error: assert_equals: Normal script execution order comparison expected "Inline1;Sync1;EndOfBody;DOMContentLoaded;Async1;" but got "EndOfBody;Inline1;Sync1;DOMContentLoaded;Async1;" FAIL Async Script Execution Order (wrt possibly deferred Synchronous Script) Uncaught Error: assert_equals: Normal script execution order comparison expected "Inline1;Sync1;EndOfBody;DOMContentLoaded;Async1;" but got "EndOfBody;Inline1;Sync1;DOMContentLoaded;Async1;"
Harness: the test ran to completion. Harness: the test ran to completion.
......
CONSOLE ERROR: line 3451: Uncaught Error: assert_equals: Normal defer script execution order comparison expected "Inline1;Sync1;Inline2;Sync2;EndOfBody;Defer1;Defer2;DOMContentLoaded;" but got "EndOfBody;Inline1;Sync1;Inline2;Sync2;Defer1;Defer2;DOMContentLoaded;" CONSOLE ERROR: line 3440: Uncaught Error: assert_equals: Normal defer script execution order comparison expected "Inline1;Sync1;Inline2;Sync2;EndOfBody;Defer1;Defer2;DOMContentLoaded;" but got "EndOfBody;Inline1;Sync1;Inline2;Sync2;Defer1;Defer2;DOMContentLoaded;"
This is a testharness.js-based test. This is a testharness.js-based test.
FAIL Defer Script Execution Order Uncaught Error: assert_equals: Normal defer script execution order comparison expected "Inline1;Sync1;Inline2;Sync2;EndOfBody;Defer1;Defer2;DOMContentLoaded;" but got "EndOfBody;Inline1;Sync1;Inline2;Sync2;Defer1;Defer2;DOMContentLoaded;" FAIL Defer Script Execution Order Uncaught Error: assert_equals: Normal defer script execution order comparison expected "Inline1;Sync1;Inline2;Sync2;EndOfBody;Defer1;Defer2;DOMContentLoaded;" but got "EndOfBody;Inline1;Sync1;Inline2;Sync2;Defer1;Defer2;DOMContentLoaded;"
Harness: the test ran to completion. Harness: the test ran to completion.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment