Skip to content

Commit

Permalink
Import wpt@9f428424dacec4acfc312887048dadf7208f5186
Browse files Browse the repository at this point in the history
Using wpt-import in Chromium e146d8b.
With Chromium commits locally applied on WPT:
329c91e "Attempt to make test more stable"


Note to sheriffs: This CL imports external tests and adds
expectations for those tests; if this CL is large and causes
a few new failures, please fix the failures by adding new
lines to TestExpectations rather than reverting. See:
https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_platform_tests.md

NOAUTOREVERT=true
TBR=robertma

No-Export: true
Change-Id: I02f183e3b2a930f92f91ac221ce1b62450a16ef2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1747272
Reviewed-by: WPT Autoroller <wpt-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: WPT Autoroller <wpt-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#685894}
  • Loading branch information
Chromium WPT Sync authored and Commit Bot committed Aug 11, 2019
1 parent 3167666 commit f478ba7
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 36 deletions.
13 changes: 10 additions & 3 deletions third_party/blink/web_tests/external/WPT_BASE_MANIFEST_6.json
Original file line number Diff line number Diff line change
Expand Up @@ -163649,6 +163649,9 @@
"mediasession/README.md": [
[]
],
"mediasession/idlharness.window-expected.txt": [
[]
],
"mimesniff/META.yml": [
[]
],
Expand Down Expand Up @@ -444787,7 +444790,7 @@
"support"
],
"interfaces/html.idl": [
"47abcda810a1f94f5704623db63fdec9805cc9c9",
"6dfb39215d0fec30d56027b16cc1c5b620eba0bc",
"support"
],
"interfaces/image-capture.idl": [
Expand Down Expand Up @@ -444823,7 +444826,7 @@
"support"
],
"interfaces/magnetometer.idl": [
"fd29af847679dcca3c4d2d3eedf56d1cf9af89ff",
"be6cbc9d47a8da6a16613c8d88bbc824e7372de3",
"support"
],
"interfaces/media-capabilities.idl": [
Expand Down Expand Up @@ -444851,7 +444854,7 @@
"support"
],
"interfaces/mediasession.idl": [
"5466300b6b48829493518fd4dd9f995509d7d337",
"237cea53adf296d8e626e6828847df80c8cda41a",
"support"
],
"interfaces/mediastream-recording.idl": [
Expand Down Expand Up @@ -447994,6 +447997,10 @@
"7c7c9f8d57a46ae310b1a63df7c6117f89b56d63",
"support"
],
"mediasession/idlharness.window-expected.txt": [
"96abe20c3383370374570be8156a3b6ef7eaa391",
"support"
],
"mediasession/idlharness.window.js": [
"e4d914544ed5df95b20287f8bd5482fdd7fe1045",
"testharness"
Expand Down
58 changes: 31 additions & 27 deletions third_party/blink/web_tests/external/wpt/interfaces/html.idl
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ interface mixin HTMLOrSVGElement {
attribute DOMString nonce; // intentionally no [CEReactions]

[CEReactions] attribute long tabIndex;
void focus(optional FocusOptions options);
void focus(optional FocusOptions options = {});
void blur();
};

Expand Down Expand Up @@ -666,7 +666,7 @@ interface TimeRanges {
};

[Exposed=Window,
Constructor(DOMString type, optional TrackEventInit eventInitDict)]
Constructor(DOMString type, optional TrackEventInit eventInitDict = {})]
interface TrackEvent : Event {
readonly attribute (VideoTrack or AudioTrack or TextTrack)? track;
};
Expand Down Expand Up @@ -1098,7 +1098,7 @@ interface ValidityState {
};

[Exposed=Window,
Constructor(DOMString type, optional FormDataEventInit eventInitDict)]
Constructor(DOMString type, optional FormDataEventInit eventInitDict = {})]
interface FormDataEvent : Event {
readonly attribute FormData formData;
};
Expand Down Expand Up @@ -1149,8 +1149,8 @@ interface HTMLTemplateElement : HTMLElement {
HTMLConstructor]
interface HTMLSlotElement : HTMLElement {
[CEReactions] attribute DOMString name;
sequence<Node> assignedNodes(optional AssignedNodesOptions options);
sequence<Element> assignedElements(optional AssignedNodesOptions options);
sequence<Node> assignedNodes(optional AssignedNodesOptions options = {});
sequence<Element> assignedElements(optional AssignedNodesOptions options = {});
};

dictionary AssignedNodesOptions {
Expand Down Expand Up @@ -1231,7 +1231,7 @@ interface mixin CanvasTransform {

[NewObject] DOMMatrix getTransform();
void setTransform(unrestricted double a, unrestricted double b, unrestricted double c, unrestricted double d, unrestricted double e, unrestricted double f);
void setTransform(optional DOMMatrix2DInit transform);
void setTransform(optional DOMMatrix2DInit transform = {});
void resetTransform();

};
Expand Down Expand Up @@ -1373,7 +1373,7 @@ interface CanvasGradient {
[Exposed=(Window,Worker)]
interface CanvasPattern {
// opaque object
void setTransform(optional DOMMatrix2DInit transform);
void setTransform(optional DOMMatrix2DInit transform = {});
};

[Exposed=(Window,Worker)]
Expand Down Expand Up @@ -1408,7 +1408,7 @@ interface ImageData {
[Constructor(optional (Path2D or DOMString) path),
Exposed=(Window,Worker)]
interface Path2D {
void addPath(Path2D path, optional DOMMatrix2DInit transform);
void addPath(Path2D path, optional DOMMatrix2DInit transform = {});
};
Path2D includes CanvasPath;

Expand Down Expand Up @@ -1438,7 +1438,7 @@ interface OffscreenCanvas : EventTarget {

OffscreenRenderingContext? getContext(OffscreenRenderingContextId contextId, optional any options = null);
ImageBitmap transferToImageBitmap();
Promise<Blob> convertToBlob(optional ImageEncodeOptions options);
Promise<Blob> convertToBlob(optional ImageEncodeOptions options = {});
};

[Exposed=(Window,Worker)]
Expand All @@ -1465,7 +1465,7 @@ OffscreenCanvasRenderingContext2D includes CanvasPath;

[Exposed=Window]
interface CustomElementRegistry {
[CEReactions] void define(DOMString name, CustomElementConstructor constructor, optional ElementDefinitionOptions options);
[CEReactions] void define(DOMString name, CustomElementConstructor constructor, optional ElementDefinitionOptions options = {});
any get(DOMString name);
Promise<void> whenDefined(DOMString name);
[CEReactions] void upgrade(Node root);
Expand Down Expand Up @@ -1561,7 +1561,7 @@ interface DataTransferItem {
callback FunctionStringCallback = void (DOMString data);

[Exposed=Window,
Constructor(DOMString type, optional DragEventInit eventInitDict)]
Constructor(DOMString type, optional DragEventInit eventInitDict = {})]
interface DragEvent : MouseEvent {
readonly attribute DataTransfer? dataTransfer;
};
Expand Down Expand Up @@ -1620,7 +1620,7 @@ interface Window : EventTarget {
void print();

void postMessage(any message, USVString targetOrigin, optional sequence<object> transfer = []);
void postMessage(any message, optional WindowPostMessageOptions options);
void postMessage(any message, optional WindowPostMessageOptions options = {});
};
Window includes GlobalEventHandlers;
Window includes WindowEventHandlers;
Expand Down Expand Up @@ -1668,7 +1668,7 @@ interface Location { // but see also additional creation steps and overridden in
};

[Exposed=Window,
Constructor(DOMString type, optional PopStateEventInit eventInitDict)]
Constructor(DOMString type, optional PopStateEventInit eventInitDict = {})]
interface PopStateEvent : Event {
readonly attribute any state;
};
Expand All @@ -1678,7 +1678,7 @@ dictionary PopStateEventInit : EventInit {
};

[Exposed=Window,
Constructor(DOMString type, optional HashChangeEventInit eventInitDict)]
Constructor(DOMString type, optional HashChangeEventInit eventInitDict = {})]
interface HashChangeEvent : Event {
readonly attribute USVString oldURL;
readonly attribute USVString newURL;
Expand All @@ -1690,7 +1690,7 @@ dictionary HashChangeEventInit : EventInit {
};

[Exposed=Window,
Constructor(DOMString type, optional PageTransitionEventInit eventInitDict)]
Constructor(DOMString type, optional PageTransitionEventInit eventInitDict = {})]
interface PageTransitionEvent : Event {
readonly attribute boolean persisted;
};
Expand Down Expand Up @@ -1737,7 +1737,8 @@ interface mixin NavigatorOnLine {
readonly attribute boolean onLine;
};

[Constructor(DOMString type, optional ErrorEventInit eventInitDict), Exposed=(Window,Worker)]
[Constructor(DOMString type, optional ErrorEventInit eventInitDict = {}),
Exposed=(Window,Worker)]
interface ErrorEvent : Event {
readonly attribute DOMString message;
readonly attribute USVString filename;
Expand Down Expand Up @@ -1887,8 +1888,8 @@ interface mixin WindowOrWorkerGlobalScope {
void queueMicrotask(VoidFunction callback);

// ImageBitmap
Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, optional ImageBitmapOptions options);
Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, long sx, long sy, long sw, long sh, optional ImageBitmapOptions options);
Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, optional ImageBitmapOptions options = {});
Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, long sx, long sy, long sw, long sh, optional ImageBitmapOptions options = {});
};
Window includes WindowOrWorkerGlobalScope;
WorkerGlobalScope includes WindowOrWorkerGlobalScope;
Expand Down Expand Up @@ -2012,7 +2013,8 @@ interface mixin AnimationFrameProvider {
Window includes AnimationFrameProvider;
DedicatedWorkerGlobalScope includes AnimationFrameProvider;

[Constructor(DOMString type, optional MessageEventInit eventInitDict), Exposed=(Window,Worker,AudioWorklet)]
[Constructor(DOMString type, optional MessageEventInit eventInitDict = {}),
Exposed=(Window,Worker,AudioWorklet)]
interface MessageEvent : Event {
readonly attribute any data;
readonly attribute USVString origin;
Expand All @@ -2033,7 +2035,7 @@ dictionary MessageEventInit : EventInit {

typedef (WindowProxy or MessagePort or ServiceWorker) MessageEventSource;

[Constructor(USVString url, optional EventSourceInit eventSourceInitDict), Exposed=(Window,Worker)]
[Constructor(USVString url, optional EventSourceInit eventSourceInitDict = {}), Exposed=(Window,Worker)]
interface EventSource : EventTarget {
readonly attribute USVString url;
readonly attribute boolean withCredentials;
Expand Down Expand Up @@ -2085,7 +2087,8 @@ interface WebSocket : EventTarget {
void send(ArrayBufferView data);
};

[Constructor(DOMString type, optional CloseEventInit eventInitDict), Exposed=(Window,Worker)]
[Constructor(DOMString type, optional CloseEventInit eventInitDict = {}),
Exposed=(Window,Worker)]
interface CloseEvent : Event {
readonly attribute boolean wasClean;
readonly attribute unsigned short code;
Expand All @@ -2107,7 +2110,7 @@ interface MessageChannel {
[Exposed=(Window,Worker,AudioWorklet), Transferable]
interface MessagePort : EventTarget {
void postMessage(any message, sequence<object> transfer);
void postMessage(any message, optional PostMessageOptions options);
void postMessage(any message, optional PostMessageOptions options = {});
void start();
void close();

Expand Down Expand Up @@ -2149,7 +2152,7 @@ interface DedicatedWorkerGlobalScope : WorkerGlobalScope {
[Replaceable] readonly attribute DOMString name;

void postMessage(any message, sequence<object> transfer);
void postMessage(any message, optional PostMessageOptions options);
void postMessage(any message, optional PostMessageOptions options = {});

void close();

Expand All @@ -2170,12 +2173,13 @@ interface mixin AbstractWorker {
attribute EventHandler onerror;
};

[Constructor(USVString scriptURL, optional WorkerOptions options), Exposed=(Window,Worker)]
[Constructor(USVString scriptURL, optional WorkerOptions options = {}),
Exposed=(Window,Worker)]
interface Worker : EventTarget {
void terminate();

void postMessage(any message, sequence<object> transfer);
void postMessage(any message, optional PostMessageOptions options);
void postMessage(any message, optional PostMessageOptions options = {});
attribute EventHandler onmessage;
attribute EventHandler onmessageerror;
};
Expand All @@ -2190,7 +2194,7 @@ enum WorkerType { "classic", "module" };

Worker includes AbstractWorker;

[Constructor(USVString scriptURL, optional (DOMString or WorkerOptions) options),
[Constructor(USVString scriptURL, optional (DOMString or WorkerOptions) options = {}),
Exposed=(Window,Worker)]
interface SharedWorker : EventTarget {
readonly attribute MessagePort port;
Expand Down Expand Up @@ -2242,7 +2246,7 @@ interface mixin WindowLocalStorage {
Window includes WindowLocalStorage;

[Exposed=Window,
Constructor(DOMString type, optional StorageEventInit eventInitDict)]
Constructor(DOMString type, optional StorageEventInit eventInitDict = {})]
interface StorageEvent : Event {
readonly attribute DOMString? key;
readonly attribute DOMString? oldValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// (https://github.com/tidoust/reffy-reports)
// Source: Magnetometer (https://w3c.github.io/magnetometer/)

[Constructor(optional MagnetometerSensorOptions sensorOptions), SecureContext,
[Constructor(optional MagnetometerSensorOptions sensorOptions = {}), SecureContext,
Exposed=Window]
interface Magnetometer : Sensor {
readonly attribute double? x;
Expand All @@ -17,7 +17,7 @@ dictionary MagnetometerSensorOptions : SensorOptions {
MagnetometerLocalCoordinateSystem referenceFrame = "device";
};

[Constructor(optional MagnetometerSensorOptions sensorOptions), SecureContext,
[Constructor(optional MagnetometerSensorOptions sensorOptions = {}), SecureContext,
Exposed=Window]
interface UncalibratedMagnetometer : Sensor {
readonly attribute double? x;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ interface MediaSession {

void setActionHandler(MediaSessionAction action, MediaSessionActionHandler? handler);

void setPositionState(MediaPositionState? state);
void setPositionState(optional MediaPositionState? state);
};

[Constructor(optional MediaMetadataInit init), Exposed=Window]
Expand All @@ -61,9 +61,9 @@ dictionary MediaImage {
};

dictionary MediaPositionState {
required double duration;
double playbackRate = 1.0;
double position = 0.0;
double duration;
double playbackRate;
double position;
};

dictionary MediaSessionActionDetails {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
This is a testharness.js-based test.
PASS idl_test setup
PASS Partial interface Navigator: original interface defined
PASS Partial interface Navigator: valid exposure set
PASS MediaSession interface: existence and properties of interface object
PASS MediaSession interface object length
PASS MediaSession interface object name
PASS MediaSession interface: existence and properties of interface prototype object
PASS MediaSession interface: existence and properties of interface prototype object's "constructor" property
PASS MediaSession interface: existence and properties of interface prototype object's @@unscopables property
PASS MediaSession interface: attribute metadata
PASS MediaSession interface: attribute playbackState
PASS MediaSession interface: operation setActionHandler(MediaSessionAction, MediaSessionActionHandler)
FAIL MediaSession interface: operation setPositionState(MediaPositionState) assert_equals: property has wrong .length expected 0 but got 1
PASS MediaSession must be primary interface of navigator.mediaSession
PASS Stringification of navigator.mediaSession
PASS MediaSession interface: navigator.mediaSession must inherit property "metadata" with the proper type
PASS MediaSession interface: navigator.mediaSession must inherit property "playbackState" with the proper type
PASS MediaSession interface: navigator.mediaSession must inherit property "setActionHandler(MediaSessionAction, MediaSessionActionHandler)" with the proper type
PASS MediaSession interface: calling setActionHandler(MediaSessionAction, MediaSessionActionHandler) on navigator.mediaSession with too few arguments must throw TypeError
PASS MediaSession interface: navigator.mediaSession must inherit property "setPositionState(MediaPositionState)" with the proper type
PASS MediaSession interface: calling setPositionState(MediaPositionState) on navigator.mediaSession with too few arguments must throw TypeError
PASS MediaMetadata interface: existence and properties of interface object
PASS MediaMetadata interface object length
PASS MediaMetadata interface object name
PASS MediaMetadata interface: existence and properties of interface prototype object
PASS MediaMetadata interface: existence and properties of interface prototype object's "constructor" property
PASS MediaMetadata interface: existence and properties of interface prototype object's @@unscopables property
PASS MediaMetadata interface: attribute title
PASS MediaMetadata interface: attribute artist
PASS MediaMetadata interface: attribute album
PASS MediaMetadata interface: attribute artwork
PASS MediaMetadata must be primary interface of new MediaMetadata()
PASS Stringification of new MediaMetadata()
PASS MediaMetadata interface: new MediaMetadata() must inherit property "title" with the proper type
PASS MediaMetadata interface: new MediaMetadata() must inherit property "artist" with the proper type
PASS MediaMetadata interface: new MediaMetadata() must inherit property "album" with the proper type
PASS MediaMetadata interface: new MediaMetadata() must inherit property "artwork" with the proper type
PASS Navigator interface: attribute mediaSession
PASS Navigator interface: navigator must inherit property "mediaSession" with the proper type
Harness: the test ran to completion.

0 comments on commit f478ba7

Please sign in to comment.