Skip to content

Commit

Permalink
Update web-platform-tests to the latest
Browse files Browse the repository at this point in the history
Implementation of whatwg/dom#754 is delayed due to lingering issues with
the PR; see whatwg/dom#813.

Single-page to-upstream tests are updated to declare themselves as such;
per WPT RFC 28
(https://github.com/web-platform-tests/rfcs/blob/master/rfcs/single_test.md).

Co-authored-by: Timothy Gu <timothygu99@gmail.com>
  • Loading branch information
kontomondo and TimothyGu committed Jan 3, 2020
1 parent 42088ae commit 4896cec
Show file tree
Hide file tree
Showing 20 changed files with 44,972 additions and 16,392 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ exports.implementation = class ValidityStateImpl {
_failsConstraint(method) {
const validationMethod = this._state[method];
if (validationMethod) {
return this._element.willValidate && validationMethod();
return validationMethod();
}

return false;
Expand Down
2 changes: 1 addition & 1 deletion lib/jsdom/living/websockets/WebSocket-impl.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class WebSocketImpl extends EventTargetImpl {
);
}
});
this._ws.on("error", () => {
this._ws.once("error", () => {
// The exact error is passed into this callback, but it is ignored as we don't really care about it.
resolve();
this._requiredToFail = true;
Expand Down
4 changes: 3 additions & 1 deletion test/web-platform-tests/run-single-wpt.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ function createJSDOM(urlPrefix, testPath, expectFail) {
window.close();
});

if (harnessStatus.status === 2) {
if (harnessStatus.status === harnessStatus.ERROR) {
errors.push(new Error(`test harness should not error: ${testPath}\n${harnessStatus.message}`));
} else if (harnessStatus.status === harnessStatus.TIMEOUT) {
errors.push(new Error(`test harness should not timeout: ${testPath}`));
}

Expand Down
2 changes: 1 addition & 1 deletion test/web-platform-tests/tests
Submodule tests updated from 493429 to bc5671
55 changes: 47 additions & 8 deletions test/web-platform-tests/to-run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@ CaretPosition-001.html: [fail, Unknown]
DOMRectList.html: [fail, Unknown]
GetBoundingRect.html: [fail, Not implemented]
HTMLBody-ScrollArea_quirksmode.html: [fail, Unknown]
MediaQueryList-001.html: [fail, Unknown]
MediaQueryList-with-empty-string.html: [fail, Unknown]
MediaQueryList-addListener-handleEvent.html: [fail, Unknown]
MediaQueryList-addListener-removeListener.html: [fail, Unknown]
MediaQueryList-extends-EventTarget-interop.html: [fail, Unknown]
MediaQueryList-extends-EventTarget.html: [fail, Unknown]
MediaQueryListEvent.html: [fail, Unknown]
cssom-getBoundingClientRect-002.html: [fail, Unknown]
cssom-getBoxQuads-001.html: [fail, Not implemented]
cssom-getClientRects-002.html: [fail, Unknown]
Expand All @@ -71,18 +74,19 @@ getClientRects**: [fail, Not implemented]
idlharness.html: [fail, Depends on Fetch]
inheritance.html: [fail, inherit not implemented (or not properly implemented)]
matchMedia-display-none-iframe.html: [fail, Not implemented]
matchMedia.xht: [timeout, Not implemented]
matchMediaAddListener.html: [fail, Not implemented]
matchMedia.html: [fail, Unknown]
mouseEvent.html: [fail, Unknown]
negativeMargins.html: [fail, Unknown]
offsetParent_element_test.html: [fail, Unknown]
offsetTopLeft-border-box.html: [fail, Unknown]
offsetTopLeftInScrollableParent.html: [fail, Unknown]
outer-svg.html: [fail, clientTop not implemented]
parsing/scroll-behavior-computed.html: [fail, scroll-behavior not implemented]
parsing/scroll-behavior-invalid.html: [fail, scroll-behavior not implemented]
position-sticky-root-scroller-with-scroll-behavior.html: [fail, Unknown]
scroll-**: [timeout, Scroll methods not implemented]
scrollIntoView**: [fail, Scroll methods not implemented]
scrollLeft-of-scroller-with-wider-scrollbar.html: [fail, Unknown]
scrollWidthHeight.xht: [fail, Unknown]
scrollWidthHeightWhenNotScrollable.xht: [fail, Unknown]
scrolling-no-browsing-context.html: [fail, Unknown]
Expand All @@ -109,6 +113,7 @@ DIR: dom/collections
DIR: dom/events

Event-dispatch-on-disabled-elements.html: [timeout, Uses testdriver.js]
Event-dispatch-redispatch.html: [fail, Unknown]
Event-isTrusted.any.html: [fail, Unknown]
Event-timestamp-high-resolution.html: [fail, Not implemented]
EventListener-handleEvent.html: [fail, Unknown]
Expand Down Expand Up @@ -155,8 +160,10 @@ ParentNode-querySelector-All-xht.xht: [fail, ::slotted() pseudo-class is not sup
ParentNode-querySelector-All.html: [fail, ::slotted() pseudo-class is not supported]
ProcessingInstruction-escapes-1.xhtml: [fail, Unknown]
Text-constructor.html: [fail, Unknown]
adoption.window.html: [fail, "We do not implement https://github.com/whatwg/dom/pull/754 due to https://github.com/whatwg/dom/issues/813"]
aria-attribute-reflection.tentative.html: [fail, Unknown]
aria-element-reflection.tentative.html: [fail, WAI-ARIA not implemented]
remove-and-adopt-crash.html: [fail, Unknown]
remove-and-adopt-thcrash.html: [fail, window.open not implemented]

---

Expand Down Expand Up @@ -345,6 +352,7 @@ auxiliary-browsing-contexts/opener.html: [timeout, Unknown]
browsing-context-names/**: [timeout, Not implemented]
browsing-context.html: [fail, Unknown]
document-access/**: [fail, Not implemented]
document-domain-nested-navigate.window.html: [fail, Unknown]
embedded-opener-a-form.html: [timeout, Opener not implemented]
embedded-opener-remove-frame.html: [timeout, Opener not implemented]
embedded-opener.html: [timeout, Opener not implemented]
Expand All @@ -362,8 +370,8 @@ targeting-with-embedded-null-in-target.html: [timeout, Unknown]
DIR: html/dom/documents/dom-tree-accessors

Document.currentScript.html: [timeout, Unknown]
document.getElementsByName/document.getElementsByName-namespace-xhtml.xhtml: [fail, Needs MathML and SVG support]
document.getElementsByName/document.getElementsByName-namespace.html: [fail, Needs MathML and SVG support]
document.getElementsByName/document.getElementsByName-namespace-xhtml.xhtml: [fail, Needs MathML support]
document.getElementsByName/document.getElementsByName-namespace.html: [fail, Needs MathML support]
nameditem-01.html: [fail, Unknown]
nameditem-02.html: [fail, Unknown]
nameditem-04.html: [fail, Unknown]
Expand Down Expand Up @@ -434,6 +442,20 @@ sequential-focus-navigation-and-the-tabindex-attribute/focus-tabindex-order.html
sequential-focus-navigation-and-the-tabindex-attribute/focus-tabindex-positive.html: [fail, scrollIntoView() not implemented]
sequential-focus-navigation-and-the-tabindex-attribute/focus-tabindex-zero.html: [fail, scrollIntoView() not implemented]
tabindex-focus-flag.html: [fail, contentEditable is not implemented; has dont-upstream version]
the-autofocus-attribute/autofocus-on-stable-document.html: [fail, Not implemented]
the-autofocus-attribute/first-reconnected.html: [fail, Not implemented]
the-autofocus-attribute/first-when-later-but-before.html: [fail, Not implemented]
the-autofocus-attribute/first-when-later.html: [fail, Not implemented]
the-autofocus-attribute/first.html: [fail, Not implemented]
the-autofocus-attribute/focusable-area-in-top-document.html: [fail, Not implemented]
the-autofocus-attribute/queue-non-focusable.html: [fail, Not implemented]
the-autofocus-attribute/same-origin-autofocus.html: [fail, Not implemented]
the-autofocus-attribute/skip-another-top-level-browsing-context.html: [fail, Not implemented]
the-autofocus-attribute/skip-document-with-fragment.html: [fail, Not implemented]
the-autofocus-attribute/skip-non-focusable.html: [fail, Not implemented]
the-autofocus-attribute/spin-by-blocking-style-sheet.html: [fail, Not implemented]
the-autofocus-attribute/supported-elements.html: [fail, Not implemented]
the-autofocus-attribute/update-the-rendering.html: [fail, Not implemented]

---

Expand Down Expand Up @@ -476,6 +498,7 @@ stylesheet-not-removed-until-next-stylesheet-loads.html: [fail, Unknown]

DIR: html/semantics/document-metadata/the-style-element

mutations.window.html: [fail, Unknown]
style-error-01.html: [timeout, Unknown]
style_disabled.html: [fail, Not implemented]
style_events.html: [timeout, Unknown]
Expand Down Expand Up @@ -535,6 +558,9 @@ formaction.html: [fail, Unknown]

DIR: html/semantics/forms/constraints

form-validation-validity-stepMismatch.html: [fail, High precision modulo operation needed]
infinite_backtracking.html: [timeout, We cannot restrict duration of regex matching from JavaScript]

---

DIR: html/semantics/forms/form-control-infrastructure
Expand All @@ -551,7 +577,8 @@ DIR: html/semantics/forms/resetting-a-form

DIR: html/semantics/forms/the-button-element

button-activate.html: [fail, Unknown]
button-activate.html: [fail, iframe onload needs to run after synchronous script]
button-submit-children.html: [fail, We do not support form target yet]

---

Expand Down Expand Up @@ -659,6 +686,8 @@ toggleEvent.html: [fail, The ninth test requires a streaming HTML parser to pass

DIR: html/semantics/interactive-elements/the-summary-element

anchor-with-inline-element.html: [fail, SVGAElement needed for last two tests]

---

DIR: html/semantics/links
Expand All @@ -681,6 +710,9 @@ async_002.htm: [timeout, Unknown]
async_006.htm: [timeout, Unknown]
async_009.htm: [timeout, Unknown]
async_011.htm: [timeout, Unknown]
css-module/css-module-worker-test.html: [fail, CSS modules and Worker not implemented]
css-module/import-css-module-basic.html: [fail, not implemented]
css-module/utf8.tentative.html: [timeout, not implemented]
data-url.html: [timeout, Unknown]
emptyish-script-elements.html: [fail, Unknown]
execution-timing/005.html: [fail, Unknown]
Expand Down Expand Up @@ -789,6 +821,8 @@ script-type-and-language-js.html: [fail, Our script execution timing is off; see

DIR: html/semantics/scripting-1/the-template-element

template-element/template-content-hierarcy.html: [fail, "We do not implement https://github.com/whatwg/dom/pull/754 due to https://github.com/whatwg/dom/issues/813"]

---

DIR: html/semantics/selectors
Expand Down Expand Up @@ -827,6 +861,7 @@ parsing-html-fragments/*: [timeout, Unknown]
parsing/DOMContentLoaded-defer.html: [fail, Script execution timing]
parsing/html-integration-point.html: [fail, Incorrect handling of encoded entity references inside <noframes> element]
parsing/html5lib*: [timeout, Unknown]
parsing/html_content_in_foreign_context.html: [fail, Parser issues with foreign elements]
parsing/unclosed-svg-script.html: [fail, Unknown]
serializing-html-fragments/serializing.html: [fail, https://github.com/inikulin/parse5/issues/289]

Expand Down Expand Up @@ -898,9 +933,13 @@ DocumentOrShadowRoot-prototype-elementFromPoint.html: [fail, offsetTop not imple
Element-interface-attachShadow-custom-element.html: [fail, CustomElement.define is not implemented]
MouseEvent-prototype-offsetX-offsetY.html: [fail, offsetTop not implemented]
ShadowRoot-interface.html: [fail, shadowRoot.styleSheet is not yet implemented]
focus/click-focus-delegatesFocus-tabindex-varies.html: [fail, element.scrollIntoView is not implemented]
focus/click-focus-delegatesFocus-tabindex-zero.html: [fail, element.scrollIntoView is not implemented]
focus/focus-method-delegatesFocus.html: [fail, delegatesFocus is not implemented]
focus/focus-selector-delegatesFocus.html: [fail, 'https://github.com/dperini/nwsapi/issues/31']
focus/focus-tabindex-order-*: [fail, Uses testdriver.js]
form-control-form-attribute.html: [fail, Form association doesn't respect the spec]
innerHTML-setter.xhtml: [fail, customElements is not implemented]
leaktests/html-collection.html: [fail, Document.all is not implemented]
leaktests/window-frames.html: [fail, Window.name is not implemeneted]
offsetParent-across-shadow-boundaries.html: [fail, offsetParent not implemented]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<script>
"use strict";

setup({ single_test: true });

const xhr = new XMLHttpRequest();

// In jsdom's implementation, this would cause a crash, as after firing readystatechange for HEADERS_RECEIVED, it would
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<script>
"use strict";

setup({ single_test: true });

const target = document.querySelector("#target");

let timesCalled = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<script>
"use strict";

setup({ single_test: true });

assert_throws("NotSupportedError", () => document.createCDATASection("foo"));

done();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<script>
"use strict";

setup({ single_test: true });

const frag = document.createDocumentFragment();
frag.appendChild(document.createElement("div"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

<script>
"use strict";

setup({ single_test: true });

const doc = document.implementation.createHTMLDocument();

// Bug was only triggered by absolute URLs, for some reason...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
testMatched("outOfRange\u{fffd}", "#outOfRange\\ffffff");

// - escape EOF
testMatched("eof\u{fffd}", "#eof\\");
testNeverMatched("eof\\", "#eof\\");

// - escape anythong else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<script>
"use strict";

setup({ single_test: true });

const container = document.querySelector("#container");
function getIDs() {
return [...container.querySelectorAll("a.test")].map(el => el.id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<script>
"use strict";

setup({ single_test: true });

const button = document.createElement("button");

assert_equals(button.querySelector("*"), null, "querySelector, '*', before modification");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

<script>
"use strict";

setup({ single_test: true });

const el = document.getElementById("thesvg");

assert_equals(document.querySelector("[*|href]"), el);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
<script>
"use strict";

setup({ single_test: true });

const el = document.createElement("style");
el.textContent = "p { color: rgb(1, 2, 3); }";
document.head.appendChild(el);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
<script>
"use strict";

setup({ single_test: true });

assert_not_equals(document.querySelector("style").sheet, null);
assert_true(document.querySelector("style").sheet instanceof CSSStyleSheet);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
<script>
"use strict";

setup({ single_test: true });

const el = document.querySelector(".cool-class");
assert_equals(window.getComputedStyle(el).fontFamily, `"Helvetica Neue", Helvetica, Arial, sans-serif`);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<script>
"use strict";

setup({ single_test: true });

const select = document.createElement("select");
select.multiple = false;
select.size = 1;
Expand Down
2 changes: 1 addition & 1 deletion test/web-platform-tests/wpt-manifest-utils.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict";
const fs = require("fs");

const EXPECTED_MANIFEST_VERSION = 6;
const EXPECTED_MANIFEST_VERSION = 7;

exports.getPossibleTestFilePaths = manifest => {
const testharnessTests = manifest.items.testharness;
Expand Down
Loading

0 comments on commit 4896cec

Please sign in to comment.