diff --git a/test/fixtures/wpt/common/redirect.py b/test/fixtures/wpt/common/redirect.py index f2fd1ebd51d..1ddde9a579b 100644 --- a/test/fixtures/wpt/common/redirect.py +++ b/test/fixtures/wpt/common/redirect.py @@ -4,6 +4,9 @@ def main(request, response): The request should typically have two query parameters: status - The status to use for the redirection. Defaults to 302. location - The resource to redirect to. + + This utility optionally supports CORS (iff the `enable-cors` query param is + present). """ status = 302 if b"status" in request.GET: @@ -17,3 +20,10 @@ def main(request, response): location = request.GET.first(b"location") response.headers.set(b"Location", location) + + if request.GET.get(b"enable-cors") is not None: + origin = request.headers.get(b"Origin") + if origin: + response.headers.set(b"Content-Type", b"text/plain") + response.headers.set(b"Access-Control-Allow-Origin", origin) + response.headers.set(b"Access-Control-Allow-Credentials", 'true') diff --git a/test/fixtures/wpt/fetch/content-encoding/br/br-navigation.https.window.js b/test/fixtures/wpt/fetch/content-encoding/br/br-navigation.https.window.js new file mode 100644 index 00000000000..6fbb42ad3ab --- /dev/null +++ b/test/fixtures/wpt/fetch/content-encoding/br/br-navigation.https.window.js @@ -0,0 +1,6 @@ +// META: script=../../../service-workers/service-worker/resources/test-helpers.sub.js + +promise_test(async t => { + const frame = await with_iframe('./resources/hello.html.br'); + assert_equals(frame.contentDocument.body.textContent, 'Hello world'); +}, `Naigation to br encoded page`); diff --git a/test/fixtures/wpt/fetch/content-encoding/br/resources/hello.html.br b/test/fixtures/wpt/fetch/content-encoding/br/resources/hello.html.br new file mode 100644 index 00000000000..eff82bcb41e Binary files /dev/null and b/test/fixtures/wpt/fetch/content-encoding/br/resources/hello.html.br differ diff --git a/test/fixtures/wpt/fetch/content-encoding/br/resources/hello.html.br.headers b/test/fixtures/wpt/fetch/content-encoding/br/resources/hello.html.br.headers new file mode 100644 index 00000000000..c001132850f --- /dev/null +++ b/test/fixtures/wpt/fetch/content-encoding/br/resources/hello.html.br.headers @@ -0,0 +1,2 @@ +Content-type: text/html +Content-Encoding: br diff --git a/test/fixtures/wpt/fetch/content-encoding/gzip/gzip-navigation.https.window.js b/test/fixtures/wpt/fetch/content-encoding/gzip/gzip-navigation.https.window.js new file mode 100644 index 00000000000..0ef68766098 --- /dev/null +++ b/test/fixtures/wpt/fetch/content-encoding/gzip/gzip-navigation.https.window.js @@ -0,0 +1,6 @@ +// META: script=../../../service-workers/service-worker/resources/test-helpers.sub.js + +promise_test(async t => { + const frame = await with_iframe('./resources/hello.html.gz'); + assert_equals(frame.contentDocument.body.textContent, 'Hello world'); +}, `Naigation to gzip encoded page`); diff --git a/test/fixtures/wpt/fetch/content-encoding/gzip/resources/hello.html.gz b/test/fixtures/wpt/fetch/content-encoding/gzip/resources/hello.html.gz new file mode 100644 index 00000000000..87140901396 Binary files /dev/null and b/test/fixtures/wpt/fetch/content-encoding/gzip/resources/hello.html.gz differ diff --git a/test/fixtures/wpt/fetch/content-encoding/gzip/resources/hello.html.gz.headers b/test/fixtures/wpt/fetch/content-encoding/gzip/resources/hello.html.gz.headers new file mode 100644 index 00000000000..937eff5d7d8 --- /dev/null +++ b/test/fixtures/wpt/fetch/content-encoding/gzip/resources/hello.html.gz.headers @@ -0,0 +1,2 @@ +Content-type: text/html +Content-Encoding: gzip diff --git a/test/fixtures/wpt/fetch/content-encoding/zstd/resources/hello.html.zst b/test/fixtures/wpt/fetch/content-encoding/zstd/resources/hello.html.zst new file mode 100644 index 00000000000..1e3598106fc Binary files /dev/null and b/test/fixtures/wpt/fetch/content-encoding/zstd/resources/hello.html.zst differ diff --git a/test/fixtures/wpt/fetch/content-encoding/zstd/resources/hello.html.zst.headers b/test/fixtures/wpt/fetch/content-encoding/zstd/resources/hello.html.zst.headers new file mode 100644 index 00000000000..45763963093 --- /dev/null +++ b/test/fixtures/wpt/fetch/content-encoding/zstd/resources/hello.html.zst.headers @@ -0,0 +1,2 @@ +Content-type: text/html +Content-Encoding: zstd diff --git a/test/fixtures/wpt/fetch/content-encoding/zstd/zstd-navigation.https.window.js b/test/fixtures/wpt/fetch/content-encoding/zstd/zstd-navigation.https.window.js new file mode 100644 index 00000000000..27cf25ae782 --- /dev/null +++ b/test/fixtures/wpt/fetch/content-encoding/zstd/zstd-navigation.https.window.js @@ -0,0 +1,6 @@ +// META: script=../../../service-workers/service-worker/resources/test-helpers.sub.js + +promise_test(async t => { + const frame = await with_iframe('./resources/hello.html.zst'); + assert_equals(frame.contentDocument.body.textContent, 'Hello world'); +}, `Naigation to zstd encoded page`); diff --git a/test/fixtures/wpt/interfaces/DOM-Parsing.idl b/test/fixtures/wpt/interfaces/DOM-Parsing.idl deleted file mode 100644 index af262607936..00000000000 --- a/test/fixtures/wpt/interfaces/DOM-Parsing.idl +++ /dev/null @@ -1,10 +0,0 @@ -// GENERATED CONTENT - DO NOT EDIT -// Content was automatically extracted by Reffy into webref -// (https://github.com/w3c/webref) -// Source: DOM Parsing and Serialization (https://w3c.github.io/DOM-Parsing/) - -[Exposed=Window] -interface XMLSerializer { - constructor(); - DOMString serializeToString(Node root); -}; diff --git a/test/fixtures/wpt/interfaces/SVG.idl b/test/fixtures/wpt/interfaces/SVG.idl index 3a0b86126b5..5dff2947b51 100644 --- a/test/fixtures/wpt/interfaces/SVG.idl +++ b/test/fixtures/wpt/interfaces/SVG.idl @@ -418,10 +418,6 @@ interface SVGAnimatedPreserveAspectRatio { [SameObject] readonly attribute SVGPreserveAspectRatio animVal; }; -[Exposed=Window] -interface SVGPathElement : SVGGeometryElement { -}; - [Exposed=Window] interface SVGRectElement : SVGGeometryElement { [SameObject] readonly attribute SVGAnimatedLength x; diff --git a/test/fixtures/wpt/interfaces/css-mixins.idl b/test/fixtures/wpt/interfaces/css-mixins.idl index 6629b3861f6..86015e7dd0e 100644 --- a/test/fixtures/wpt/interfaces/css-mixins.idl +++ b/test/fixtures/wpt/interfaces/css-mixins.idl @@ -4,7 +4,17 @@ // Source: CSS Functions and Mixins Module (https://drafts.csswg.org/css-mixins-1/) [Exposed=Window] -interface CSSFunctionRule : CSSGroupingRule { }; +interface CSSFunctionRule : CSSGroupingRule { + readonly attribute CSSOMString name; + sequence getParameters(); + readonly attribute CSSOMString returnType; +}; + +dictionary FunctionParameter { + required CSSOMString name; + required CSSOMString type; + CSSOMString? defaultValue; +}; [Exposed=Window] interface CSSFunctionDescriptors : CSSStyleDeclaration { diff --git a/test/fixtures/wpt/interfaces/dom.idl b/test/fixtures/wpt/interfaces/dom.idl index 814040a2c40..7b4fcb920e2 100644 --- a/test/fixtures/wpt/interfaces/dom.idl +++ b/test/fixtures/wpt/interfaces/dom.idl @@ -124,6 +124,8 @@ interface mixin ParentNode { [CEReactions, Unscopable] undefined append((Node or DOMString)... nodes); [CEReactions, Unscopable] undefined replaceChildren((Node or DOMString)... nodes); + [CEReactions] undefined moveBefore(Node node, Node? child); + Element? querySelector(DOMString selectors); [NewObject] NodeList querySelectorAll(DOMString selectors); }; diff --git a/test/fixtures/wpt/interfaces/html.idl b/test/fixtures/wpt/interfaces/html.idl index f48fd370281..97fabdf80fa 100644 --- a/test/fixtures/wpt/interfaces/html.idl +++ b/test/fixtures/wpt/interfaces/html.idl @@ -1483,6 +1483,7 @@ interface mixin CanvasPathDrawingStyles { interface mixin CanvasTextDrawingStyles { // text + attribute DOMString lang; // (default: "inherit") attribute DOMString font; // (default 10px sans-serif) attribute CanvasTextAlign textAlign; // (default: "start") attribute CanvasTextBaseline textBaseline; // (default: "alphabetic") @@ -2368,6 +2369,13 @@ partial interface Range { [CEReactions, NewObject] DocumentFragment createContextualFragment((TrustedHTML or DOMString) string); }; +[Exposed=Window] +interface XMLSerializer { + constructor(); + + DOMString serializeToString(Node root); +}; + [Exposed=Window] interface Navigator { // objects implementing this interface also implement the interfaces given below diff --git a/test/fixtures/wpt/interfaces/ppa.idl b/test/fixtures/wpt/interfaces/ppa.idl index a00d2deba87..ef3eb360bdf 100644 --- a/test/fixtures/wpt/interfaces/ppa.idl +++ b/test/fixtures/wpt/interfaces/ppa.idl @@ -10,13 +10,12 @@ partial interface Navigator { enum PrivateAttributionProtocol { "dap-12-histogram", "tee-00" }; dictionary PrivateAttributionAggregationService { - required DOMString url; required DOMString protocol; }; [SecureContext, Exposed=Window] interface PrivateAttributionAggregationServices { - readonly setlike; + readonly maplike; }; [SecureContext, Exposed=Window] @@ -27,7 +26,7 @@ interface PrivateAttribution { dictionary PrivateAttributionImpressionOptions { required unsigned long histogramIndex; unsigned long filterData = 0; - required DOMString conversionSite; + required USVString conversionSite; unsigned long lifetimeDays = 30; }; @@ -37,19 +36,19 @@ partial interface PrivateAttribution { }; dictionary PrivateAttributionConversionOptions { - required DOMString aggregationService; + required USVString aggregationService; double epsilon = 1.0; required unsigned long histogramSize; + unsigned long lookbackDays; + unsigned long filterData; + sequence impressionSites = []; + sequence intermediarySites = []; + PrivateAttributionLogic logic = "last-touch"; unsigned long value = 1; unsigned long maxValue = 1; - - unsigned long lookbackDays; - unsigned long filterData; - sequence impressionSites = []; - sequence intermediarySites = []; }; dictionary PrivateAttributionConversionResult { diff --git a/test/fixtures/wpt/interfaces/private-aggregation-api.idl b/test/fixtures/wpt/interfaces/private-aggregation-api.idl index c89a4687abb..bc5eb740718 100644 --- a/test/fixtures/wpt/interfaces/private-aggregation-api.idl +++ b/test/fixtures/wpt/interfaces/private-aggregation-api.idl @@ -7,6 +7,8 @@ SecureContext] interface PrivateAggregation { undefined contributeToHistogram(PAHistogramContribution contribution); + undefined contributeToHistogramOnEvent(DOMString event, + record contribution); undefined enableDebugMode(optional PADebugModeOptions options = {}); }; diff --git a/test/fixtures/wpt/interfaces/sanitizer-api.tentative.idl b/test/fixtures/wpt/interfaces/sanitizer-api.tentative.idl deleted file mode 100644 index 4e597aeec7b..00000000000 --- a/test/fixtures/wpt/interfaces/sanitizer-api.tentative.idl +++ /dev/null @@ -1,61 +0,0 @@ -// https://wicg.github.io/sanitizer-api/ - -enum SanitizerPresets { "default" }; -dictionary SetHTMLOptions { - (Sanitizer or SanitizerConfig or SanitizerPresets) sanitizer = "default"; -}; -dictionary SetHTMLUnsafeOptions { - (Sanitizer or SanitizerConfig or SanitizerPresets) sanitizer = {}; -}; - -[Exposed=Window] -interface Sanitizer { - constructor(optional (SanitizerConfig or SanitizerPresets) configuration = "default"); - - // Query configuration: - SanitizerConfig get(); - - // Modify a Sanitizer’s lists and fields: - undefined allowElement(SanitizerElementWithAttributes element); - undefined removeElement(SanitizerElement element); - undefined replaceElementWithChildren(SanitizerElement element); - undefined allowAttribute(SanitizerAttribute attribute); - undefined removeAttribute(SanitizerAttribute attribute); - undefined setComments(boolean allow); - undefined setDataAttributes(boolean allow); - - // Remove markup that executes script. May modify multiple lists: - undefined removeUnsafe(); -}; - -dictionary SanitizerElementNamespace { - required DOMString name; - DOMString? _namespace = "http://www.w3.org/1999/xhtml"; -}; - -// Used by "elements" -dictionary SanitizerElementNamespaceWithAttributes : SanitizerElementNamespace { - sequence attributes; - sequence removeAttributes; -}; - -typedef (DOMString or SanitizerElementNamespace) SanitizerElement; -typedef (DOMString or SanitizerElementNamespaceWithAttributes) SanitizerElementWithAttributes; - -dictionary SanitizerAttributeNamespace { - required DOMString name; - DOMString? _namespace = null; -}; -typedef (DOMString or SanitizerAttributeNamespace) SanitizerAttribute; - -dictionary SanitizerConfig { - sequence elements; - sequence removeElements; - sequence replaceWithChildrenElements; - - sequence attributes; - sequence removeAttributes; - - boolean comments; - boolean dataAttributes; -}; diff --git a/test/fixtures/wpt/interfaces/shared-storage.idl b/test/fixtures/wpt/interfaces/shared-storage.idl index 941c7414c4f..e3e221a3aa7 100644 --- a/test/fixtures/wpt/interfaces/shared-storage.idl +++ b/test/fixtures/wpt/interfaces/shared-storage.idl @@ -71,6 +71,7 @@ dictionary SharedStorageSetMethodOptions : SharedStorageModifierMethodOptions { [Exposed=(Window,SharedStorageWorklet)] interface SharedStorage { + Promise get(DOMString key); Promise set(DOMString key, DOMString value, optional SharedStorageSetMethodOptions options = {}); @@ -97,9 +98,6 @@ interface SharedStorage { [Exposed=Window] readonly attribute SharedStorageWorklet worklet; - [Exposed=SharedStorageWorklet] - Promise get(DOMString key); - [Exposed=SharedStorageWorklet] Promise length(); diff --git a/test/fixtures/wpt/interfaces/svg-paths.idl b/test/fixtures/wpt/interfaces/svg-paths.idl new file mode 100644 index 00000000000..2f0813572a1 --- /dev/null +++ b/test/fixtures/wpt/interfaces/svg-paths.idl @@ -0,0 +1,31 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content was automatically extracted by Reffy into webref +// (https://github.com/w3c/webref) +// Source: SVG Paths (https://svgwg.org/specs/paths/) + +[LegacyNoInterfaceObject, Exposed=Window] +interface SVGPathSegment { + attribute DOMString type; + attribute FrozenArray values; +}; + +dictionary SVGPathDataSettings { + boolean normalize = false; +}; + +interface mixin SVGPathData { + sequence getPathData(optional SVGPathDataSettings settings = {}); + undefined setPathData(sequence pathData); +}; + +[Exposed=Window] +interface SVGPathElement : SVGGeometryElement { + + readonly attribute SVGAnimatedNumber pathLength; + + float getTotalLength(); + DOMPoint getPointAtLength(float distance); + SVGPathSegment? getPathSegmentAtLength(float distance); +}; + +SVGPathElement includes SVGPathData; diff --git a/test/fixtures/wpt/interfaces/turtledove.idl b/test/fixtures/wpt/interfaces/turtledove.idl index 2f34d763722..b9f50d47885 100644 --- a/test/fixtures/wpt/interfaces/turtledove.idl +++ b/test/fixtures/wpt/interfaces/turtledove.idl @@ -18,6 +18,7 @@ dictionary AuctionAd { sequence selectableBuyerAndSellerReportingIds; sequence allowedReportingOrigins; DOMString adRenderId; + USVString creativeScanningMetadata; }; dictionary AuctionAdInterestGroupSize { @@ -106,6 +107,7 @@ dictionary AuctionAdConfig { USVString trustedScoringSignalsURL; long maxTrustedScoringSignalsURLLength; USVString trustedScoringSignalsCoordinator; + boolean sendCreativeScanningMetadata; sequence interestGroupBuyers; Promise auctionSignals; Promise sellerSignals; @@ -218,12 +220,6 @@ dictionary PAExtendedHistogramContribution { bigint filteringId = 0; }; -[Exposed=InterestGroupScriptRunnerGlobalScope] -partial interface PrivateAggregation { - undefined contributeToHistogramOnEvent( - DOMString event, PAExtendedHistogramContribution contribution); -}; - [Exposed=InterestGroupBiddingAndScoringScriptRunnerGlobalScope] interface ForDebuggingOnly { undefined reportAdAuctionWin(USVString url); @@ -351,6 +347,8 @@ dictionary ScoringBrowserSignals { unsigned long crossOriginDataVersion; sequence adComponents; boolean forDebuggingOnlyInCooldownOrLockout = false; + USVString creativeScanningMetadata; + sequence adComponentsCreativeScanningMetadata; }; dictionary ReportingBrowserSignals { diff --git a/test/fixtures/wpt/interfaces/webaudio.idl b/test/fixtures/wpt/interfaces/webaudio.idl index d14eb96820f..3b351f4d9e9 100644 --- a/test/fixtures/wpt/interfaces/webaudio.idl +++ b/test/fixtures/wpt/interfaces/webaudio.idl @@ -80,7 +80,6 @@ interface AudioContext : BaseAudioContext { readonly attribute double baseLatency; readonly attribute double outputLatency; [SecureContext] readonly attribute (DOMString or AudioSinkInfo) sinkId; - [SecureContext] readonly attribute AudioRenderCapacity renderCapacity; attribute EventHandler onsinkchange; attribute EventHandler onerror; AudioTimestamp getOutputTimestamp (); @@ -116,33 +115,6 @@ dictionary AudioTimestamp { DOMHighResTimeStamp performanceTime; }; -[Exposed=Window] -interface AudioRenderCapacity : EventTarget { - undefined start(optional AudioRenderCapacityOptions options = {}); - undefined stop(); - attribute EventHandler onupdate; -}; - -dictionary AudioRenderCapacityOptions { - double updateInterval = 1; -}; - -[Exposed=Window] -interface AudioRenderCapacityEvent : Event { - constructor (DOMString type, optional AudioRenderCapacityEventInit eventInitDict = {}); - readonly attribute double timestamp; - readonly attribute double averageLoad; - readonly attribute double peakLoad; - readonly attribute double underrunRatio; -}; - -dictionary AudioRenderCapacityEventInit : EventInit { - double timestamp = 0; - double averageLoad = 0; - double peakLoad = 0; - double underrunRatio = 0; -}; - [Exposed=Window] interface OfflineAudioContext : BaseAudioContext { constructor(OfflineAudioContextOptions contextOptions); diff --git a/test/fixtures/wpt/interfaces/webnn.idl b/test/fixtures/wpt/interfaces/webnn.idl index 63554edbffd..8dc3a0ebc14 100644 --- a/test/fixtures/wpt/interfaces/webnn.idl +++ b/test/fixtures/wpt/interfaces/webnn.idl @@ -19,7 +19,7 @@ dictionary MLContextOptions { MLPowerPreference powerPreference = "default"; }; -[SecureContext, Exposed=(Window, DedicatedWorker)] +[SecureContext, Exposed=(Window, Worker)] interface ML { Promise createContext(optional MLContextOptions options = {}); Promise createContext(GPUDevice gpuDevice); @@ -31,7 +31,7 @@ dictionary MLContextLostInfo { DOMString message; }; -[SecureContext, Exposed=(Window, DedicatedWorker)] +[SecureContext, Exposed=(Window, Worker)] interface MLContext { undefined dispatch(MLGraph graph, MLNamedTensors inputs, MLNamedTensors outputs); @@ -71,7 +71,7 @@ dictionary MLSingleInputSupportLimits { MLSupportLimits output; }; -[SecureContext, Exposed=(Window, DedicatedWorker)] +[SecureContext, Exposed=(Window, Worker)] interface MLGraph { undefined destroy(); }; @@ -97,7 +97,7 @@ dictionary MLOperandDescriptor { required sequence<[EnforceRange] unsigned long> shape; }; -[SecureContext, Exposed=(Window, DedicatedWorker)] +[SecureContext, Exposed=(Window, Worker)] interface MLOperand { readonly attribute MLOperandDataType dataType; readonly attribute FrozenArray shape; @@ -114,7 +114,7 @@ dictionary MLTensorDescriptor : MLOperandDescriptor { boolean writable = false; }; -[SecureContext, Exposed=(Window, DedicatedWorker)] +[SecureContext, Exposed=(Window, Worker)] interface MLTensor { readonly attribute MLOperandDataType dataType; readonly attribute FrozenArray shape; @@ -126,7 +126,7 @@ interface MLTensor { typedef record MLNamedOperands; -[SecureContext, Exposed=(Window, DedicatedWorker)] +[SecureContext, Exposed=(Window, Worker)] interface MLGraphBuilder { // Construct the graph builder from the context. constructor(MLContext context); @@ -286,6 +286,21 @@ partial dictionary MLOpSupportLimits { MLConv2dSupportLimits convTranspose2d; }; +dictionary MLCumulativeSumOptions : MLOperatorOptions { + boolean exclusive = false; + boolean reversed = false; +}; + +partial interface MLGraphBuilder { + MLOperand cumulativeSum(MLOperand input, + unsigned long axis, + optional MLCumulativeSumOptions options = {}); +}; + +partial dictionary MLOpSupportLimits { + MLSingleInputSupportLimits cumulativeSum; +}; + partial interface MLGraphBuilder { MLOperand add(MLOperand a, MLOperand b, optional MLOperatorOptions options = {}); MLOperand sub(MLOperand a, MLOperand b, optional MLOperatorOptions options = {}); @@ -310,6 +325,9 @@ partial interface MLGraphBuilder { MLOperand equal(MLOperand a, MLOperand b, optional MLOperatorOptions options = {}); + MLOperand notEqual(MLOperand a, + MLOperand b, + optional MLOperatorOptions options = {}); MLOperand greater(MLOperand a, MLOperand b, optional MLOperatorOptions options = {}); @@ -323,6 +341,15 @@ partial interface MLGraphBuilder { MLOperand b, optional MLOperatorOptions options = {}); MLOperand logicalNot(MLOperand a, optional MLOperatorOptions options = {}); + MLOperand logicalAnd(MLOperand a, + MLOperand b, + optional MLOperatorOptions options = {}); + MLOperand logicalOr(MLOperand a, + MLOperand b, + optional MLOperatorOptions options = {}); + MLOperand logicalXor(MLOperand a, + MLOperand b, + optional MLOperatorOptions options = {}); }; dictionary MLLogicalNotSupportLimits { @@ -332,11 +359,15 @@ dictionary MLLogicalNotSupportLimits { partial dictionary MLOpSupportLimits { MLBinarySupportLimits equal; + MLBinarySupportLimits notEqual; MLBinarySupportLimits greater; MLBinarySupportLimits greaterOrEqual; MLBinarySupportLimits lesser; MLBinarySupportLimits lesserOrEqual; MLLogicalNotSupportLimits logicalNot; + MLBinarySupportLimits logicalAnd; + MLBinarySupportLimits logicalOr; + MLBinarySupportLimits logicalXor; }; partial interface MLGraphBuilder { @@ -351,6 +382,7 @@ partial interface MLGraphBuilder { MLOperand neg(MLOperand input, optional MLOperatorOptions options = {}); MLOperand reciprocal(MLOperand input, optional MLOperatorOptions options = {}); MLOperand sin(MLOperand input, optional MLOperatorOptions options = {}); + MLOperand sign(MLOperand input, optional MLOperatorOptions options = {}); MLOperand sqrt(MLOperand input, optional MLOperatorOptions options = {}); MLOperand tan(MLOperand input, optional MLOperatorOptions options = {}); }; @@ -367,10 +399,40 @@ partial dictionary MLOpSupportLimits { MLSingleInputSupportLimits neg; MLSingleInputSupportLimits reciprocal; MLSingleInputSupportLimits sin; + MLSingleInputSupportLimits sign; MLSingleInputSupportLimits sqrt; MLSingleInputSupportLimits tan; }; +partial interface MLGraphBuilder { + MLOperand dequantizeLinear(MLOperand input, + MLOperand scale, + MLOperand zeroPoint, + optional MLOperatorOptions options = {}); +}; + +dictionary MLQuantizationSupportLimits { + MLSupportLimits input; + MLSupportLimits scale; + MLSupportLimits zeroPoint; + MLSupportLimits output; +}; + +partial dictionary MLOpSupportLimits { + MLQuantizationSupportLimits dequantizeLinear; +}; + +partial interface MLGraphBuilder { + MLOperand quantizeLinear(MLOperand input, + MLOperand scale, + MLOperand zeroPoint, + optional MLOperatorOptions options = {}); +}; + +partial dictionary MLOpSupportLimits { + MLQuantizationSupportLimits quantizeLinear; +}; + dictionary MLEluOptions : MLOperatorOptions { double alpha = 1; }; @@ -413,6 +475,26 @@ partial dictionary MLOpSupportLimits { MLGatherSupportLimits gather; }; +partial interface MLGraphBuilder { + MLOperand gatherElements(MLOperand input, + MLOperand indices, + optional MLGatherOptions options = {}); +}; + +partial dictionary MLOpSupportLimits { + MLGatherSupportLimits gatherElements; +}; + +partial interface MLGraphBuilder { + MLOperand gatherND(MLOperand input, + MLOperand indices, + optional MLOperatorOptions options = {}); +}; + +partial dictionary MLOpSupportLimits { + MLGatherSupportLimits gatherND; +}; + partial interface MLGraphBuilder { MLOperand gelu(MLOperand input, optional MLOperatorOptions options = {}); }; @@ -830,6 +912,51 @@ partial dictionary MLOpSupportLimits { MLSingleInputSupportLimits reshape; }; +dictionary MLReverseOptions : MLOperatorOptions { + sequence<[EnforceRange] unsigned long> axes; +}; + +partial interface MLGraphBuilder { + MLOperand reverse(MLOperand input, optional MLReverseOptions options = {}); +}; + +partial dictionary MLOpSupportLimits { + MLSingleInputSupportLimits reverse; +}; + +dictionary MLScatterOptions : MLOperatorOptions { + [EnforceRange] unsigned long axis = 0; +}; + +partial interface MLGraphBuilder { + MLOperand scatterElements(MLOperand input, + MLOperand indices, + MLOperand updates, + optional MLScatterOptions options = {}); +}; + +dictionary MLScatterSupportLimits { + MLSupportLimits input; + MLSupportLimits indices; + MLSupportLimits updates; + MLSupportLimits output; +}; + +partial dictionary MLOpSupportLimits { + MLScatterSupportLimits scatterElements; +}; + +partial interface MLGraphBuilder { + MLOperand scatterND(MLOperand input, + MLOperand indices, + MLOperand updates, + optional MLOperatorOptions options = {}); +}; + +partial dictionary MLOpSupportLimits { + MLScatterSupportLimits scatterND; +}; + partial interface MLGraphBuilder { MLOperand sigmoid(MLOperand input, optional MLOperatorOptions options = {}); }; @@ -838,14 +965,18 @@ partial dictionary MLOpSupportLimits { MLSingleInputSupportLimits sigmoid; }; +dictionary MLSliceOptions : MLOperatorOptions { + sequence<[EnforceRange] unsigned long> strides; +}; + partial interface MLGraphBuilder { MLOperand slice(MLOperand input, sequence<[EnforceRange] unsigned long> starts, sequence<[EnforceRange] unsigned long> sizes, - optional MLOperatorOptions options = {}); + optional MLSliceOptions options = {}); }; -partial dictionary MLOpSupportLimits { +partial dictionary MLOpSupportLimits { MLSingleInputSupportLimits slice; }; @@ -903,6 +1034,16 @@ partial dictionary MLOpSupportLimits { MLSingleInputSupportLimits tanh; }; +partial interface MLGraphBuilder { + MLOperand tile(MLOperand input, + sequence repetitions, + optional MLOperatorOptions options = {}); +}; + +partial dictionary MLOpSupportLimits { + MLSingleInputSupportLimits tile; +}; + dictionary MLTransposeOptions : MLOperatorOptions { sequence<[EnforceRange] unsigned long> permutation; }; diff --git a/test/fixtures/wpt/interfaces/webrtc-encoded-transform.idl b/test/fixtures/wpt/interfaces/webrtc-encoded-transform.idl index 0db2f2b9a81..8a6ba816016 100644 --- a/test/fixtures/wpt/interfaces/webrtc-encoded-transform.idl +++ b/test/fixtures/wpt/interfaces/webrtc-encoded-transform.idl @@ -75,6 +75,9 @@ dictionary RTCEncodedVideoFrameMetadata { sequence contributingSources; long long timestamp; // microseconds unsigned long rtpTimestamp; + DOMHighResTimeStamp receiveTime; + DOMHighResTimeStamp captureTime; + DOMHighResTimeStamp senderCaptureTimeOffset; DOMString mimeType; }; @@ -98,6 +101,9 @@ dictionary RTCEncodedAudioFrameMetadata { sequence contributingSources; short sequenceNumber; unsigned long rtpTimestamp; + DOMHighResTimeStamp receiveTime; + DOMHighResTimeStamp captureTime; + DOMHighResTimeStamp senderCaptureTimeOffset; DOMString mimeType; }; diff --git a/test/fixtures/wpt/interfaces/webtransport.idl b/test/fixtures/wpt/interfaces/webtransport.idl index 24fe5b7e61b..eb456336081 100644 --- a/test/fixtures/wpt/interfaces/webtransport.idl +++ b/test/fixtures/wpt/interfaces/webtransport.idl @@ -3,10 +3,18 @@ // (https://github.com/w3c/webref) // Source: WebTransport (https://w3c.github.io/webtransport/) +[Exposed=(Window,Worker), SecureContext, Transferable] +interface WebTransportDatagramsWritable : WritableStream { + attribute WebTransportSendGroup? sendGroup; + attribute long long sendOrder; +}; + [Exposed=(Window,Worker), SecureContext] interface WebTransportDatagramDuplexStream { + WebTransportDatagramsWritable createWritable( + optional WebTransportSendOptions options = {}); readonly attribute ReadableStream readable; - readonly attribute WritableStream writable; + readonly attribute WebTransportDatagramsWritable writable; readonly attribute unsigned long maxDatagramSize; attribute unrestricted double? incomingMaxAge; @@ -79,9 +87,12 @@ dictionary WebTransportCloseInfo { USVString reason = ""; }; -dictionary WebTransportSendStreamOptions { +dictionary WebTransportSendOptions { WebTransportSendGroup? sendGroup = null; long long sendOrder = 0; +}; + +dictionary WebTransportSendStreamOptions : WebTransportSendOptions { boolean waitUntilAvailable = false; }; diff --git a/test/fixtures/wpt/interfaces/xhr.idl b/test/fixtures/wpt/interfaces/xhr.idl index b4c27c8aca9..6ff75fd2774 100644 --- a/test/fixtures/wpt/interfaces/xhr.idl +++ b/test/fixtures/wpt/interfaces/xhr.idl @@ -88,12 +88,12 @@ interface ProgressEvent : Event { constructor(DOMString type, optional ProgressEventInit eventInitDict = {}); readonly attribute boolean lengthComputable; - readonly attribute unsigned long long loaded; - readonly attribute unsigned long long total; + readonly attribute double loaded; + readonly attribute double total; }; dictionary ProgressEventInit : EventInit { boolean lengthComputable = false; - unsigned long long loaded = 0; - unsigned long long total = 0; + double loaded = 0; + double total = 0; }; diff --git a/test/fixtures/wpt/resources/testharness.js b/test/fixtures/wpt/resources/testharness.js index 81cf6175588..5b5410c8b21 100644 --- a/test/fixtures/wpt/resources/testharness.js +++ b/test/fixtures/wpt/resources/testharness.js @@ -4788,7 +4788,8 @@ return META_TITLE; } if ('location' in global_scope && 'pathname' in location) { - return location.pathname.substring(location.pathname.lastIndexOf('/') + 1, location.pathname.indexOf('.')); + var filename = location.pathname.substring(location.pathname.lastIndexOf('/') + 1); + return filename.substring(0, filename.indexOf('.')); } return "Untitled"; } diff --git a/test/fixtures/wpt/resources/web-bluetooth-bidi-test.js b/test/fixtures/wpt/resources/web-bluetooth-bidi-test.js new file mode 100644 index 00000000000..044ad1a43ae --- /dev/null +++ b/test/fixtures/wpt/resources/web-bluetooth-bidi-test.js @@ -0,0 +1,91 @@ +'use strict' + +// Convert `manufacturerData` to an array of bluetooth.BluetoothManufacturerData +// defined in +// https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-bidi-definitions. +function convertToBidiManufacturerData(manufacturerData) { + const bidiManufacturerData = []; + for (const key in manufacturerData) { + bidiManufacturerData.push( + {key: parseInt(key), data: btoa(manufacturerData[key].buffer)}) + } + return bidiManufacturerData; +} + +class FakeBluetooth { + constructor() { + this.fake_central_ = null; + } + + // Returns a promise that resolves with a FakeCentral that clients can use + // to simulate events that a device in the Central/Observer role would + // receive as well as monitor the operations performed by the device in the + // Central/Observer role. + // + // A "Central" object would allow its clients to receive advertising events + // and initiate connections to peripherals i.e. operations of two roles + // defined by the Bluetooth Spec: Observer and Central. + // See Bluetooth 4.2 Vol 3 Part C 2.2.2 "Roles when Operating over an + // LE Physical Transport". + async simulateCentral({state}) { + if (this.fake_central_) { + throw 'simulateCentral() should only be called once'; + } + + await test_driver.bidi.bluetooth.simulate_adapter({state: state}); + this.fake_central_ = new FakeCentral(); + return this.fake_central_; + } +} + +// FakeCentral allows clients to simulate events that a device in the +// Central/Observer role would receive as well as monitor the operations +// performed by the device in the Central/Observer role. +class FakeCentral { + constructor() { + this.peripherals_ = new Map(); + } + + // Simulates a peripheral with |address|, |name|, |manufacturerData| and + // |known_service_uuids| that has already been connected to the system. If the + // peripheral existed already it updates its name, manufacturer data, and + // known UUIDs. |known_service_uuids| should be an array of + // BluetoothServiceUUIDs + // https://webbluetoothcg.github.io/web-bluetooth/#typedefdef-bluetoothserviceuuid + // + // Platforms offer methods to retrieve devices that have already been + // connected to the system or weren't connected through the UA e.g. a user + // connected a peripheral through the system's settings. This method is + // intended to simulate peripherals that those methods would return. + async simulatePreconnectedPeripheral( + {address, name, manufacturerData = {}, knownServiceUUIDs = []}) { + await test_driver.bidi.bluetooth.simulate_preconnected_peripheral({ + address: address, + name: name, + manufacturerData: convertToBidiManufacturerData(manufacturerData), + knownServiceUuids: knownServiceUUIDs + }); + + return this.fetchOrCreatePeripheral_(address); + } + + // Create a fake_peripheral object from the given address. + fetchOrCreatePeripheral_(address) { + let peripheral = this.peripherals_.get(address); + if (peripheral === undefined) { + peripheral = new FakePeripheral(address); + this.peripherals_.set(address, peripheral); + } + return peripheral; + } +} + +class FakePeripheral { + constructor(address) { + this.address = address; + } +} + +function initializeBluetoothBidiResources() { + navigator.bluetooth.test = new FakeBluetooth(); +} diff --git a/test/fixtures/wpt/service-workers/service-worker/ServiceWorkerGlobalScope/error-message-event.https.html b/test/fixtures/wpt/service-workers/service-worker/ServiceWorkerGlobalScope/error-message-event.https.html index fc8edb4b896..0a35cc7c39c 100644 --- a/test/fixtures/wpt/service-workers/service-worker/ServiceWorkerGlobalScope/error-message-event.https.html +++ b/test/fixtures/wpt/service-workers/service-worker/ServiceWorkerGlobalScope/error-message-event.https.html @@ -2,9 +2,10 @@ Service Worker GlobalScope onerror event + - + diff --git a/test/fixtures/wpt/service-workers/service-worker/controlled-dedicatedworker-postMessage.https.html b/test/fixtures/wpt/service-workers/service-worker/controlled-dedicatedworker-postMessage.https.html index 7e2a604621d..5ef91dd1b11 100644 --- a/test/fixtures/wpt/service-workers/service-worker/controlled-dedicatedworker-postMessage.https.html +++ b/test/fixtures/wpt/service-workers/service-worker/controlled-dedicatedworker-postMessage.https.html @@ -1,5 +1,6 @@ + diff --git a/test/fixtures/wpt/service-workers/service-worker/controlled-iframe-postMessage.https.html b/test/fixtures/wpt/service-workers/service-worker/controlled-iframe-postMessage.https.html index 8f39b7fdbf8..c3f390a5a45 100644 --- a/test/fixtures/wpt/service-workers/service-worker/controlled-iframe-postMessage.https.html +++ b/test/fixtures/wpt/service-workers/service-worker/controlled-iframe-postMessage.https.html @@ -1,5 +1,6 @@ + diff --git a/test/fixtures/wpt/service-workers/service-worker/detached-register-crash.https.html b/test/fixtures/wpt/service-workers/service-worker/detached-register-crash.https.html new file mode 100644 index 00000000000..2785142a3cf --- /dev/null +++ b/test/fixtures/wpt/service-workers/service-worker/detached-register-crash.https.html @@ -0,0 +1,14 @@ + + +Assures navigator.serviceWorker.register() doesn't crash when rejecting being called in a detached frame + + + + + + diff --git a/test/fixtures/wpt/service-workers/service-worker/navigation-preload/content-encoding.https.html b/test/fixtures/wpt/service-workers/service-worker/navigation-preload/content-encoding.https.html new file mode 100644 index 00000000000..d6135d95c88 --- /dev/null +++ b/test/fixtures/wpt/service-workers/service-worker/navigation-preload/content-encoding.https.html @@ -0,0 +1,25 @@ + + +Navigation Preload with content encoding + + + + diff --git a/test/fixtures/wpt/service-workers/service-worker/navigation-preload/resources/content-encoding-scope.py b/test/fixtures/wpt/service-workers/service-worker/navigation-preload/resources/content-encoding-scope.py new file mode 100644 index 00000000000..bd9601d1578 --- /dev/null +++ b/test/fixtures/wpt/service-workers/service-worker/navigation-preload/resources/content-encoding-scope.py @@ -0,0 +1,7 @@ +import gzip + +def main(request, response): + response.headers.set(b"Content-Type", b"text/html; charset=UTF-8") + response.headers.set(b"Content-Encoding", b"gzip") + response.content = gzip.compress(bytes(u"Hello World", 'utf-8')) + diff --git a/test/fixtures/wpt/service-workers/service-worker/navigation-preload/resources/content-encoding-worker.js b/test/fixtures/wpt/service-workers/service-worker/navigation-preload/resources/content-encoding-worker.js new file mode 100644 index 00000000000..f30e5ed274d --- /dev/null +++ b/test/fixtures/wpt/service-workers/service-worker/navigation-preload/resources/content-encoding-worker.js @@ -0,0 +1,8 @@ +self.addEventListener('activate', event => { + event.waitUntil( + self.registration.navigationPreload.enable()); + }); + +self.addEventListener('fetch', event => { + event.respondWith(event.preloadResponse); + }); diff --git a/test/fixtures/wpt/service-workers/service-worker/request-end-to-end.https.html b/test/fixtures/wpt/service-workers/service-worker/request-end-to-end.https.html index a39ceadd9f3..82475eabc4a 100644 --- a/test/fixtures/wpt/service-workers/service-worker/request-end-to-end.https.html +++ b/test/fixtures/wpt/service-workers/service-worker/request-end-to-end.https.html @@ -29,12 +29,16 @@ 'TypeError.') assert_equals(result.credentials, 'include', 'request.credentials'); assert_equals(result.redirect, 'manual', 'request.redirect'); - assert_equals(result.headers['user-agent'], undefined, - 'Default User-Agent header should not be passed to ' + - 'onfetch event.') assert_equals(result.append_header_error, 'TypeError', 'Appending a new header to the request must throw a ' + 'TypeError.') + + // `assert_equals()` is not used here to create a stable failure + // baseline, because the User-Agent header would be version-dependent + // if set. + assert_true(result.headers['user-agent'] === undefined, + 'Default User-Agent header should not be passed to ' + + 'onfetch event.') }); }, 'Test FetchEvent.request passed to onfetch'); diff --git a/test/fixtures/wpt/xhr/progressevent-constructor.html b/test/fixtures/wpt/xhr/progressevent-constructor.html index 0e771f4459f..3b9c774b874 100644 --- a/test/fixtures/wpt/xhr/progressevent-constructor.html +++ b/test/fixtures/wpt/xhr/progressevent-constructor.html @@ -40,6 +40,36 @@ assert_equals(ev.loaded, 2) }, "ECMAScript value conversion test.") test(function() { + var ev = new ProgressEvent(null, { loaded: 1, total: 2 }) + assert_equals(ev.type, "null") + assert_equals(ev.loaded, 1) + assert_equals(ev.total, 2) +}, "Positive integer number test.") +test(function () { + var ev = new ProgressEvent(null, { loaded: 0, total: 1 }) + assert_equals(ev.type, "null") + assert_equals(ev.loaded, 0) + assert_equals(ev.total, 1) +}, "Zero test.") +test(function () { + var ev = new ProgressEvent(null, { loaded: 1.5, total: 3.5 }) + assert_equals(ev.type, "null") + assert_equals(ev.loaded, 1.5) + assert_equals(ev.total, 3.5) +}, "Decimal number test.") +test(function () { + var ev = new ProgressEvent(null, { loaded: 1.5, total: 5 }) + assert_equals(ev.type, "null") + assert_equals(ev.loaded, 1.5) + assert_equals(ev.total, 5) +}, "Mixed integer and decimal number test.") +test(function () { + var ev = new ProgressEvent(null, { loaded: -1, total: -5.5 }) + assert_equals(ev.type, "null") + assert_equals(ev.loaded, -1) + assert_equals(ev.total, -5.5) +}, "Negative number.") +test(function () { var ev = new ProgressEvent("Xx", { lengthcomputable: true}) assert_equals(ev.type, "Xx") assert_equals(ev.lengthComputable, false) diff --git a/test/fixtures/wpt/xhr/progressevent-interface.html b/test/fixtures/wpt/xhr/progressevent-interface.html index 7552ff73d3f..ec8d471d783 100644 --- a/test/fixtures/wpt/xhr/progressevent-interface.html +++ b/test/fixtures/wpt/xhr/progressevent-interface.html @@ -23,8 +23,8 @@ }, "interface prototype object") var attributes = [ ["boolean", "lengthComputable"], - ["unsigned long long", "loaded"], - ["unsigned long long", "total"] + ["double", "loaded"], + ["double", "total"] ]; attributes.forEach(function(a) { test(function() {