Skip to content

Commit

Permalink
test: add WPT streams tests
Browse files Browse the repository at this point in the history
Signed-off-by: James M Snell <[email protected]>

PR-URL: #39062
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
  • Loading branch information
jasnell authored and targos committed Jul 11, 2021
1 parent 4202274 commit cc32365
Show file tree
Hide file tree
Showing 91 changed files with 18,833 additions and 10 deletions.
5 changes: 3 additions & 2 deletions test/fixtures/wpt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ Last update:
- html/webappapis/atob: https://github.com/web-platform-tests/wpt/tree/f267e1dca6/html/webappapis/atob
- html/webappapis/microtask-queuing: https://github.com/web-platform-tests/wpt/tree/2c5c3c4c27/html/webappapis/microtask-queuing
- html/webappapis/timers: https://github.com/web-platform-tests/wpt/tree/5873f2d8f1/html/webappapis/timers
- interfaces: https://github.com/web-platform-tests/wpt/tree/79fa4cf76e/interfaces
- interfaces: https://github.com/web-platform-tests/wpt/tree/fcb671ed8b/interfaces
- resources: https://github.com/web-platform-tests/wpt/tree/972ca5b669/resources
- streams: https://github.com/web-platform-tests/wpt/tree/b869e60df1/streams
- url: https://github.com/web-platform-tests/wpt/tree/1fcb39223d/url

[Web Platform Tests]: https://github.com/web-platform-tests/wpt
[`git node wpt`]: https://github.com/nodejs/node-core-utils/blob/master/docs/git-node.md#git-node-wpt
[`git node wpt`]: https://github.com/nodejs/node-core-utils/blob/main/docs/git-node.md#git-node-wpt
19 changes: 19 additions & 0 deletions test/fixtures/wpt/interfaces/dom.idl
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ interface AbortController {

[Exposed=(Window,Worker)]
interface AbortSignal : EventTarget {
[NewObject] static AbortSignal abort();

readonly attribute boolean aborted;

attribute EventHandler onabort;
Expand Down Expand Up @@ -331,11 +333,14 @@ interface DocumentFragment : Node {
[Exposed=Window]
interface ShadowRoot : DocumentFragment {
readonly attribute ShadowRootMode mode;
readonly attribute boolean delegatesFocus;
readonly attribute SlotAssignmentMode slotAssignment;
readonly attribute Element host;
attribute EventHandler onslotchange;
};

enum ShadowRootMode { "open", "closed" };
enum SlotAssignmentMode { "manual", "named" };

[Exposed=Window]
interface Element : Node {
Expand Down Expand Up @@ -386,6 +391,7 @@ interface Element : Node {
dictionary ShadowRootInit {
required ShadowRootMode mode;
boolean delegatesFocus = false;
SlotAssignmentMode slotAssignment = "named";
};

[Exposed=Window,
Expand Down Expand Up @@ -621,3 +627,16 @@ interface XPathEvaluator {
};

XPathEvaluator includes XPathEvaluatorBase;

[Exposed=Window]
interface XSLTProcessor {
constructor();
undefined importStylesheet(Node style);
[CEReactions] DocumentFragment transformToFragment(Node source, Document output);
[CEReactions] Document transformToDocument(Node source);
undefined setParameter([LegacyNullToEmptyString] DOMString namespaceURI, DOMString localName, any value);
any getParameter([LegacyNullToEmptyString] DOMString namespaceURI, DOMString localName);
undefined removeParameter([LegacyNullToEmptyString] DOMString namespaceURI, DOMString localName);
undefined clearParameters();
undefined reset();
};
36 changes: 29 additions & 7 deletions test/fixtures/wpt/interfaces/html.idl
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ interface HTMLElement : Element {
[CEReactions] attribute DOMString autocapitalize;

[CEReactions] attribute [LegacyNullToEmptyString] DOMString innerText;
[CEReactions] attribute [LegacyNullToEmptyString] DOMString outerText;

ElementInternals attachInternals();
};
Expand Down Expand Up @@ -695,7 +696,7 @@ interface TextTrackCue : EventTarget {

attribute DOMString id;
attribute double startTime;
attribute double endTime;
attribute unrestricted double endTime;
attribute boolean pauseOnExit;

attribute EventHandler onenter;
Expand Down Expand Up @@ -1231,6 +1232,7 @@ interface HTMLSlotElement : HTMLElement {
[CEReactions] attribute DOMString name;
sequence<Node> assignedNodes(optional AssignedNodesOptions options = {});
sequence<Element> assignedElements(optional AssignedNodesOptions options = {});
undefined assign((Element or Text)... nodes);
};

dictionary AssignedNodesOptions {
Expand Down Expand Up @@ -1264,11 +1266,14 @@ typedef (HTMLOrSVGImageElement or
ImageBitmap or
OffscreenCanvas) CanvasImageSource;

enum PredefinedColorSpace { "srgb", "display-p3" };

enum CanvasFillRule { "nonzero", "evenodd" };

dictionary CanvasRenderingContext2DSettings {
boolean alpha = true;
boolean desynchronized = false;
PredefinedColorSpace colorSpace = "srgb";
};

enum ImageSmoothingQuality { "low", "medium", "high" };
Expand Down Expand Up @@ -1301,6 +1306,7 @@ interface mixin CanvasState {
// state
undefined save(); // push state on state stack
undefined restore(); // pop state stack and restore state
undefined reset(); // reset the rendering context to its default state
};

interface mixin CanvasTransform {
Expand Down Expand Up @@ -1336,6 +1342,7 @@ interface mixin CanvasFillStrokeStyles {
attribute (DOMString or CanvasGradient or CanvasPattern) fillStyle; // (default black)
CanvasGradient createLinearGradient(double x0, double y0, double x1, double y1);
CanvasGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1);
CanvasGradient createConicGradient(double startAngle, double x, double y);
CanvasPattern? createPattern(CanvasImageSource image, [LegacyNullToEmptyString] DOMString repetition);

};
Expand Down Expand Up @@ -1398,9 +1405,9 @@ interface mixin CanvasDrawImage {

interface mixin CanvasImageData {
// pixel manipulation
ImageData createImageData([EnforceRange] long sw, [EnforceRange] long sh);
ImageData createImageData([EnforceRange] long sw, [EnforceRange] long sh, optional ImageDataSettings settings = {});
ImageData createImageData(ImageData imagedata);
ImageData getImageData([EnforceRange] long sx, [EnforceRange] long sy, [EnforceRange] long sw, [EnforceRange] long sh);
ImageData getImageData([EnforceRange] long sx, [EnforceRange] long sy, [EnforceRange] long sw, [EnforceRange] long sh, optional ImageDataSettings settings = {});
undefined putImageData(ImageData imagedata, [EnforceRange] long dx, [EnforceRange] long dy);
undefined putImageData(ImageData imagedata, [EnforceRange] long dx, [EnforceRange] long dy, [EnforceRange] long dirtyX, [EnforceRange] long dirtyY, [EnforceRange] long dirtyWidth, [EnforceRange] long dirtyHeight);
};
Expand All @@ -1410,6 +1417,10 @@ enum CanvasLineJoin { "round", "bevel", "miter" };
enum CanvasTextAlign { "start", "end", "left", "right", "center" };
enum CanvasTextBaseline { "top", "hanging", "middle", "alphabetic", "ideographic", "bottom" };
enum CanvasDirection { "ltr", "rtl", "inherit" };
enum CanvasFontKerning { "auto", "normal", "none" };
enum CanvasFontStretch { "ultra-condensed", "extra-condensed", "condensed", "semi-condensed", "normal", "semi-expanded", "expanded", "extra-expanded", "ultra-expanded" };
enum CanvasFontVariantCaps { "normal", "small-caps", "all-small-caps", "petite-caps", "all-petite-caps", "unicase", "titling-caps" };
enum CanvasTextRendering { "auto", "optimizeSpeed", "optimizeLegibility", "geometricPrecision" };

interface mixin CanvasPathDrawingStyles {
// line caps/joins
Expand All @@ -1430,6 +1441,12 @@ interface mixin CanvasTextDrawingStyles {
attribute CanvasTextAlign textAlign; // (default: "start")
attribute CanvasTextBaseline textBaseline; // (default: "alphabetic")
attribute CanvasDirection direction; // (default: "inherit")
attribute double textLetterSpacing; // (default: 0)
attribute double textWordSpacing; // (default: 0)
attribute CanvasFontKerning fontKerning; // (default: "auto")
attribute CanvasFontStretch fontStretch; // (default: "normal")
attribute CanvasFontVariantCaps fontVariantCaps; // (default: "normal")
attribute CanvasTextRendering textRendering; // (default: "normal")
};

interface mixin CanvasPath {
Expand Down Expand Up @@ -1476,15 +1493,20 @@ interface TextMetrics {
readonly attribute double ideographicBaseline;
};

dictionary ImageDataSettings {
PredefinedColorSpace colorSpace;
};

[Exposed=(Window,Worker),
Serializable]
interface ImageData {
constructor(unsigned long sw, unsigned long sh);
constructor(Uint8ClampedArray data, unsigned long sw, optional unsigned long sh);
constructor(unsigned long sw, unsigned long sh, optional ImageDataSettings settings = {});
constructor(Uint8ClampedArray data, unsigned long sw, optional unsigned long sh, optional ImageDataSettings settings = {});

readonly attribute unsigned long width;
readonly attribute unsigned long height;
readonly attribute Uint8ClampedArray data;
readonly attribute PredefinedColorSpace colorSpace;
};

[Exposed=(Window,Worker)]
Expand Down Expand Up @@ -1738,8 +1760,8 @@ interface History {
undefined go(optional long delta = 0);
undefined back();
undefined forward();
undefined pushState(any data, DOMString title, optional USVString? url = null);
undefined replaceState(any data, DOMString title, optional USVString? url = null);
undefined pushState(any data, DOMString unused, optional USVString? url = null);
undefined replaceState(any data, DOMString unused, optional USVString? url = null);
};

[Exposed=Window]
Expand Down
Loading

0 comments on commit cc32365

Please sign in to comment.