diff --git a/tests/wpt/metadata-layout-2020/FileAPI/url/url-charset.window.js.ini b/tests/wpt/metadata-layout-2020/FileAPI/url/url-charset.window.js.ini deleted file mode 100644 index a9005e45d6e..00000000000 --- a/tests/wpt/metadata-layout-2020/FileAPI/url/url-charset.window.js.ini +++ /dev/null @@ -1,8 +0,0 @@ -[url-charset.window.html] - expected: TIMEOUT - [Blob charset should override any auto-detected charset.] - expected: TIMEOUT - - [Blob charset should override .] - expected: TIMEOUT - diff --git a/tests/wpt/metadata-layout-2020/FileAPI/url/url-in-tags-revoke.window.js.ini b/tests/wpt/metadata-layout-2020/FileAPI/url/url-in-tags-revoke.window.js.ini index 3605e8f3fc9..76b44d9e9cf 100644 --- a/tests/wpt/metadata-layout-2020/FileAPI/url/url-in-tags-revoke.window.js.ini +++ b/tests/wpt/metadata-layout-2020/FileAPI/url/url-in-tags-revoke.window.js.ini @@ -4,7 +4,7 @@ expected: TIMEOUT [Opening a blob URL in a new window immediately before revoking it works.] - expected: TIMEOUT + expected: FAIL [Fetching a blob URL immediately before revoking it works in an iframe.] expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-003.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-003.html.ini deleted file mode 100644 index f29da48a2a0..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-003.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[hit-test-floats-003.html] - [Miss float below something else] - expected: FAIL - diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-004.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-004.html.ini deleted file mode 100644 index 4bfb0c2053a..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-004.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[hit-test-floats-004.html] - [Miss float below something else] - expected: FAIL - diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/linebox/inline-negative-margin-001.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/linebox/inline-negative-margin-001.html.ini index 6425f4beda1..cb2edcb5dcd 100644 --- a/tests/wpt/metadata-layout-2020/css/CSS2/linebox/inline-negative-margin-001.html.ini +++ b/tests/wpt/metadata-layout-2020/css/CSS2/linebox/inline-negative-margin-001.html.ini @@ -5,9 +5,6 @@ [[data-expected-height\] 7] expected: FAIL - [[data-expected-height\] 1] - expected: FAIL - - [[data-expected-height\] 2] + [[data-expected-height\] 4] expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/css-backgrounds/animations/one-element-three-keyframes-animation1.html.ini b/tests/wpt/metadata-layout-2020/css/css-backgrounds/animations/one-element-three-keyframes-animation1.html.ini new file mode 100644 index 00000000000..56fdc71d13f --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-backgrounds/animations/one-element-three-keyframes-animation1.html.ini @@ -0,0 +1,2 @@ +[one-element-three-keyframes-animation1.html] + expected: TIMEOUT diff --git a/tests/wpt/metadata-layout-2020/css/css-backgrounds/animations/one-element-three-keyframes-animation2.html.ini b/tests/wpt/metadata-layout-2020/css/css-backgrounds/animations/one-element-three-keyframes-animation2.html.ini new file mode 100644 index 00000000000..36f7ea710b7 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-backgrounds/animations/one-element-three-keyframes-animation2.html.ini @@ -0,0 +1,2 @@ +[one-element-three-keyframes-animation2.html] + expected: TIMEOUT diff --git a/tests/wpt/metadata-layout-2020/css/css-backgrounds/animations/one-element-three-keyframes-animation3.html.ini b/tests/wpt/metadata-layout-2020/css/css-backgrounds/animations/one-element-three-keyframes-animation3.html.ini new file mode 100644 index 00000000000..a9bed0b064c --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-backgrounds/animations/one-element-three-keyframes-animation3.html.ini @@ -0,0 +1,2 @@ +[one-element-three-keyframes-animation3.html] + expected: TIMEOUT diff --git a/tests/wpt/metadata-layout-2020/css/css-flexbox/flex-aspect-ratio-img-column-018.html.ini b/tests/wpt/metadata-layout-2020/css/css-flexbox/flex-aspect-ratio-img-column-018.html.ini new file mode 100644 index 00000000000..df3e40f9fc0 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-flexbox/flex-aspect-ratio-img-column-018.html.ini @@ -0,0 +1,2 @@ +[flex-aspect-ratio-img-column-018.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/css-flexbox/flex-aspect-ratio-img-row-015.html.ini b/tests/wpt/metadata-layout-2020/css/css-flexbox/flex-aspect-ratio-img-row-015.html.ini new file mode 100644 index 00000000000..dc75b52999c --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-flexbox/flex-aspect-ratio-img-row-015.html.ini @@ -0,0 +1,2 @@ +[flex-aspect-ratio-img-row-015.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/cssom-view/CaretPosition-001.html.ini b/tests/wpt/metadata-layout-2020/css/cssom-view/CaretPosition-001.html.ini new file mode 100644 index 00000000000..4c79907309b --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/cssom-view/CaretPosition-001.html.ini @@ -0,0 +1,4 @@ +[CaretPosition-001.html] + [Element at (400, 100)] + expected: FAIL + diff --git a/tests/wpt/metadata-layout-2020/css/cssom-view/elementFromPosition.html.ini b/tests/wpt/metadata-layout-2020/css/cssom-view/elementFromPosition.html.ini index 23c61ede1a1..c131078eace 100644 --- a/tests/wpt/metadata-layout-2020/css/cssom-view/elementFromPosition.html.ini +++ b/tests/wpt/metadata-layout-2020/css/cssom-view/elementFromPosition.html.ini @@ -17,6 +17,3 @@ [test the top of layer] expected: FAIL - [test some point of the element: top left corner] - expected: FAIL - diff --git a/tests/wpt/metadata-layout-2020/css/cssom-view/elementsFromPoint-invalid-cases.html.ini b/tests/wpt/metadata-layout-2020/css/cssom-view/elementsFromPoint-invalid-cases.html.ini new file mode 100644 index 00000000000..e181af5397f --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/cssom-view/elementsFromPoint-invalid-cases.html.ini @@ -0,0 +1,4 @@ +[elementsFromPoint-invalid-cases.html] + [The root element is the last element returned for otherwise empty queries within the viewport] + expected: FAIL + diff --git a/tests/wpt/metadata-layout-2020/css/cssom-view/matchMedia-display-none-iframe.html.ini b/tests/wpt/metadata-layout-2020/css/cssom-view/matchMedia-display-none-iframe.html.ini deleted file mode 100644 index e6e1f29e274..00000000000 --- a/tests/wpt/metadata-layout-2020/css/cssom-view/matchMedia-display-none-iframe.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[matchMedia-display-none-iframe.html] - expected: ERROR diff --git a/tests/wpt/metadata-layout-2020/css/selectors/focus-in-focus-event-001.html.ini b/tests/wpt/metadata-layout-2020/css/selectors/focus-in-focus-event-001.html.ini new file mode 100644 index 00000000000..bef445ff6c0 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/selectors/focus-in-focus-event-001.html.ini @@ -0,0 +1,2 @@ +[focus-in-focus-event-001.html] + expected: ERROR diff --git a/tests/wpt/metadata-layout-2020/css/selectors/focus-in-focusin-event-001.html.ini b/tests/wpt/metadata-layout-2020/css/selectors/focus-in-focusin-event-001.html.ini new file mode 100644 index 00000000000..28c9856c156 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/selectors/focus-in-focusin-event-001.html.ini @@ -0,0 +1,2 @@ +[focus-in-focusin-event-001.html] + expected: TIMEOUT diff --git a/tests/wpt/metadata-layout-2020/css/selectors/parsing/parse-not.html.ini b/tests/wpt/metadata-layout-2020/css/selectors/parsing/parse-not.html.ini index c52f597e5fc..13cb99458c9 100644 --- a/tests/wpt/metadata-layout-2020/css/selectors/parsing/parse-not.html.ini +++ b/tests/wpt/metadata-layout-2020/css/selectors/parsing/parse-not.html.ini @@ -23,3 +23,9 @@ [":not(:host)" should be a valid selector] expected: FAIL + [":not([disabled\],[selected\])" should be a valid selector] + expected: FAIL + + [":not([disabled\][selected\])" should be a valid selector] + expected: FAIL + diff --git a/tests/wpt/metadata-layout-2020/fetch/api/request/request-bad-port.any.js.ini b/tests/wpt/metadata-layout-2020/fetch/api/request/request-bad-port.any.js.ini index 8068c2bf6ce..1677e17d51e 100644 --- a/tests/wpt/metadata-layout-2020/fetch/api/request/request-bad-port.any.js.ini +++ b/tests/wpt/metadata-layout-2020/fetch/api/request/request-bad-port.any.js.ini @@ -12,20 +12,11 @@ [Request on bad port 554 should throw TypeError.] expected: TIMEOUT - [Request on bad port 587 should throw TypeError.] - expected: NOTRUN - - [Request on bad port 563 should throw TypeError.] - expected: NOTRUN - - [Request on bad port 995 should throw TypeError.] - expected: NOTRUN - [Request on bad port 4045 should throw TypeError.] expected: NOTRUN [Request on bad port 1720 should throw TypeError.] - expected: NOTRUN + expected: TIMEOUT [Request on bad port 6665 should throw TypeError.] expected: NOTRUN @@ -36,21 +27,12 @@ [Request on bad port 1723 should throw TypeError.] expected: NOTRUN - [Request on bad port 993 should throw TypeError.] - expected: NOTRUN - [Request on bad port 6666 should throw TypeError.] expected: NOTRUN [Request on bad port 6667 should throw TypeError.] expected: NOTRUN - [Request on bad port 556 should throw TypeError.] - expected: NOTRUN - - [Request on bad port 601 should throw TypeError.] - expected: NOTRUN - [Request on bad port 6668 should throw TypeError.] expected: NOTRUN @@ -60,9 +42,6 @@ [Request on bad port 2049 should throw TypeError.] expected: NOTRUN - [Request on bad port 636 should throw TypeError.] - expected: NOTRUN - [Request on bad port 5061 should throw TypeError.] expected: NOTRUN @@ -81,20 +60,11 @@ [Request on bad port 554 should throw TypeError.] expected: TIMEOUT - [Request on bad port 587 should throw TypeError.] - expected: NOTRUN - - [Request on bad port 563 should throw TypeError.] - expected: NOTRUN - - [Request on bad port 995 should throw TypeError.] - expected: NOTRUN - [Request on bad port 4045 should throw TypeError.] expected: NOTRUN [Request on bad port 1720 should throw TypeError.] - expected: NOTRUN + expected: TIMEOUT [Request on bad port 6665 should throw TypeError.] expected: NOTRUN @@ -105,21 +75,12 @@ [Request on bad port 1723 should throw TypeError.] expected: NOTRUN - [Request on bad port 993 should throw TypeError.] - expected: NOTRUN - [Request on bad port 6666 should throw TypeError.] expected: NOTRUN [Request on bad port 6667 should throw TypeError.] expected: NOTRUN - [Request on bad port 556 should throw TypeError.] - expected: NOTRUN - - [Request on bad port 601 should throw TypeError.] - expected: NOTRUN - [Request on bad port 6668 should throw TypeError.] expected: NOTRUN @@ -129,9 +90,6 @@ [Request on bad port 2049 should throw TypeError.] expected: NOTRUN - [Request on bad port 636 should throw TypeError.] - expected: NOTRUN - [Request on bad port 5061 should throw TypeError.] expected: NOTRUN diff --git a/tests/wpt/metadata-layout-2020/fetch/content-type/response.window.js.ini b/tests/wpt/metadata-layout-2020/fetch/content-type/response.window.js.ini index 9150db9d352..e5c50667a92 100644 --- a/tests/wpt/metadata-layout-2020/fetch/content-type/response.window.js.ini +++ b/tests/wpt/metadata-layout-2020/fetch/content-type/response.window.js.ini @@ -315,9 +315,6 @@ [ diff --git a/tests/wpt/web-platform-tests/preload/avoid-prefetching-on-text-plain.html b/tests/wpt/web-platform-tests/preload/avoid-prefetching-on-text-plain.html index 487cbbcaba7..45564e1bfac 100644 --- a/tests/wpt/web-platform-tests/preload/avoid-prefetching-on-text-plain.html +++ b/tests/wpt/web-platform-tests/preload/avoid-prefetching-on-text-plain.html @@ -23,8 +23,16 @@ urls.push(entry.name); } // If preloading is working correctly, should only see the text document - // represented in the performance information. - assert_array_equals(resource_types, ['navigation']); + // represented in the performance information. A 'resource' type indicates + // that we've prefetched something. + let resource_found = false; + for (const t of resource_types) { + if (t == "resource") { + resource_found = true; + break; + } + } + assert_false(resource_found, "no resources should be present"); assert_equals(urls.length, 1); assert_equals(urls[0].endsWith("avoid-prefetching-on-text-plain-inner.html"), true); done(); diff --git a/tests/wpt/web-platform-tests/referrer-policy/css-integration/image/inline-style-with-differentorigin-base-tag.tentative.html b/tests/wpt/web-platform-tests/referrer-policy/css-integration/image/inline-style-with-differentorigin-base-tag.tentative.html new file mode 100644 index 00000000000..091afd832ab --- /dev/null +++ b/tests/wpt/web-platform-tests/referrer-policy/css-integration/image/inline-style-with-differentorigin-base-tag.tentative.html @@ -0,0 +1,45 @@ + +CSS integration - image from inline style from document with base tag + + + + + + + + + + + + + + + +

Check that resources from inline styles are loaded with + the referrer and referrer policy from the document and, in + particular, not with the different base URL set in the base tag.

+ +
+ + + +
+ + diff --git a/tests/wpt/web-platform-tests/referrer-policy/css-integration/svg/inline-style-with-differentorigin-base-tag.tentative.html b/tests/wpt/web-platform-tests/referrer-policy/css-integration/svg/inline-style-with-differentorigin-base-tag.tentative.html new file mode 100644 index 00000000000..9a8bc6da418 --- /dev/null +++ b/tests/wpt/web-platform-tests/referrer-policy/css-integration/svg/inline-style-with-differentorigin-base-tag.tentative.html @@ -0,0 +1,40 @@ + + + + + CSS integration - styling SVG from inline style on page with different-origin base tag + + + + + + + + + + + + + +

Check that resources from inline styles are loaded with + the referrer and referrer policy from the document and, in + particular, not from the document's overridden base URL.

+ + +
+ + + diff --git a/tests/wpt/web-platform-tests/resources/chromium/webusb-test.js b/tests/wpt/web-platform-tests/resources/chromium/webusb-test.js index 8bccfd1f724..f6a793dc956 100644 --- a/tests/wpt/web-platform-tests/resources/chromium/webusb-test.js +++ b/tests/wpt/web-platform-tests/resources/chromium/webusb-test.js @@ -16,6 +16,19 @@ let internal = { messagePort: null, }; +let mojom = {}; + +async function loadMojomDefinitions() { + const deviceMojom = + await import('/gen/services/device/public/mojom/usb_device.mojom.m.js'); + const serviceMojom = await import( + '/gen/third_party/blink/public/mojom/usb/web_usb_service.mojom.m.js'); + return { + ...deviceMojom, + ...serviceMojom, + }; +} + function getMessagePort(target) { return new Promise(resolve => { target.addEventListener('message', messageEvent => { @@ -93,29 +106,29 @@ function fakeDeviceInitToDeviceInfo(guid, init) { var endpointInfo = { endpointNumber: endpoint.endpointNumber, packetSize: endpoint.packetSize, - synchronizationType: device.mojom.UsbSynchronizationType.NONE, - usageType: device.mojom.UsbUsageType.DATA, + synchronizationType: mojom.UsbSynchronizationType.NONE, + usageType: mojom.UsbUsageType.DATA, pollingInterval: 0, extraData: new Uint8Array() }; switch (endpoint.direction) { - case "in": - endpointInfo.direction = device.mojom.UsbTransferDirection.INBOUND; - break; - case "out": - endpointInfo.direction = device.mojom.UsbTransferDirection.OUTBOUND; - break; + case "in": + endpointInfo.direction = mojom.UsbTransferDirection.INBOUND; + break; + case "out": + endpointInfo.direction = mojom.UsbTransferDirection.OUTBOUND; + break; } switch (endpoint.type) { - case "bulk": - endpointInfo.type = device.mojom.UsbTransferType.BULK; - break; - case "interrupt": - endpointInfo.type = device.mojom.UsbTransferType.INTERRUPT; - break; - case "isochronous": - endpointInfo.type = device.mojom.UsbTransferType.ISOCHRONOUS; - break; + case "bulk": + endpointInfo.type = mojom.UsbTransferType.BULK; + break; + case "interrupt": + endpointInfo.type = mojom.UsbTransferType.INTERRUPT; + break; + case "isochronous": + endpointInfo.type = mojom.UsbTransferType.ISOCHRONOUS; + break; } alternateInfo.endpoints.push(endpointInfo); }); @@ -173,7 +186,7 @@ class FakeDevice { open() { assert_false(this.opened_); this.opened_ = true; - return Promise.resolve({ error: device.mojom.UsbOpenDeviceError.OK }); + return Promise.resolve({error: mojom.UsbOpenDeviceError.OK}); } close() { @@ -244,36 +257,35 @@ class FakeDevice { async controlTransferIn(params, length, timeout) { assert_true(this.opened_); - if ((params.recipient == device.mojom.UsbControlTransferRecipient.INTERFACE || - params.recipient == device.mojom.UsbControlTransferRecipient.ENDPOINT) && + if ((params.recipient == mojom.UsbControlTransferRecipient.INTERFACE || + params.recipient == mojom.UsbControlTransferRecipient.ENDPOINT) && this.currentConfiguration_ == null) { return { - status: device.mojom.UsbTransferStatus.PERMISSION_DENIED, + status: mojom.UsbTransferStatus.PERMISSION_DENIED, }; } return { - status: device.mojom.UsbTransferStatus.OK, - data: [length >> 8, length & 0xff, params.request, params.value >> 8, - params.value & 0xff, params.index >> 8, params.index & 0xff] + status: mojom.UsbTransferStatus.OK, + data: [ + length >> 8, length & 0xff, params.request, params.value >> 8, + params.value & 0xff, params.index >> 8, params.index & 0xff + ] }; } async controlTransferOut(params, data, timeout) { assert_true(this.opened_); - if ((params.recipient == device.mojom.UsbControlTransferRecipient.INTERFACE || - params.recipient == device.mojom.UsbControlTransferRecipient.ENDPOINT) && + if ((params.recipient == mojom.UsbControlTransferRecipient.INTERFACE || + params.recipient == mojom.UsbControlTransferRecipient.ENDPOINT) && this.currentConfiguration_ == null) { return { - status: device.mojom.UsbTransferStatus.PERMISSION_DENIED, + status: mojom.UsbTransferStatus.PERMISSION_DENIED, }; } - return { - status: device.mojom.UsbTransferStatus.OK, - bytesWritten: data.byteLength - }; + return {status: mojom.UsbTransferStatus.OK, bytesWritten: data.byteLength}; } genericTransferIn(endpointNumber, length, timeout) { @@ -283,20 +295,15 @@ class FakeDevice { let data = new Array(length); for (let i = 0; i < length; ++i) data[i] = i & 0xff; - return Promise.resolve({ - status: device.mojom.UsbTransferStatus.OK, - data: data - }); + return Promise.resolve({status: mojom.UsbTransferStatus.OK, data: data}); } genericTransferOut(endpointNumber, data, timeout) { assert_true(this.opened_); assert_false(this.currentConfiguration_ == null, 'device configured'); // TODO(reillyg): Assert that endpoint is valid. - return Promise.resolve({ - status: device.mojom.UsbTransferStatus.OK, - bytesWritten: data.byteLength - }); + return Promise.resolve( + {status: mojom.UsbTransferStatus.OK, bytesWritten: data.byteLength}); } isochronousTransferIn(endpointNumber, packetLengths, timeout) { @@ -312,7 +319,7 @@ class FakeDevice { packets[i] = { length: packetLengths[i], transferredLength: packetLengths[i], - status: device.mojom.UsbTransferStatus.OK + status: mojom.UsbTransferStatus.OK }; } return Promise.resolve({ data: data, packets: packets }); @@ -327,7 +334,7 @@ class FakeDevice { packets[i] = { length: packetLengths[i], transferredLength: packetLengths[i], - status: device.mojom.UsbTransferStatus.OK + status: mojom.UsbTransferStatus.OK }; } return Promise.resolve({ packets: packets }); @@ -336,7 +343,7 @@ class FakeDevice { class FakeWebUsbService { constructor() { - this.bindingSet_ = new mojo.BindingSet(blink.mojom.WebUsbService); + this.receiver_ = new mojom.WebUsbServiceReceiver(this); this.devices_ = new Map(); this.devicesByGuid_ = new Map(); this.client_ = null; @@ -344,7 +351,7 @@ class FakeWebUsbService { } addBinding(handle) { - this.bindingSet_.addBinding(this, handle); + this.receiver_.$.bindHandle(handle); } addDevice(fakeDevice, info) { @@ -352,7 +359,7 @@ class FakeWebUsbService { fakeDevice: fakeDevice, guid: (this.nextGuid_++).toString(), info: info, - bindingArray: [] + receivers: [], }; this.devices_.set(fakeDevice, device); this.devicesByGuid_.set(device.guid, device); @@ -365,8 +372,8 @@ class FakeWebUsbService { if (!device) throw new Error('Cannot remove unknown device.'); - for (var binding of device.bindingArray) - binding.close(); + for (const receiver of device.receivers) + receiver.$.close(); this.devices_.delete(device.fakeDevice); this.devicesByGuid_.delete(device.guid); if (this.client_) { @@ -377,8 +384,8 @@ class FakeWebUsbService { removeAllDevices() { this.devices_.forEach(device => { - for (var binding of device.bindingArray) - binding.close(); + for (const receiver of device.receivers) + receiver.$.close(); this.client_.onDeviceRemoved( fakeDeviceInitToDeviceInfo(device.guid, device.info)); }); @@ -397,17 +404,16 @@ class FakeWebUsbService { getDevice(guid, request) { let retrievedDevice = this.devicesByGuid_.get(guid); if (retrievedDevice) { - let binding = new mojo.Binding( - device.mojom.UsbDevice, - new FakeDevice(retrievedDevice.info), - request); - binding.setConnectionErrorHandler(() => { + const receiver = + new mojom.UsbDeviceReceiver(new FakeDevice(retrievedDevice.info)); + receiver.$.bindHandle(request.handle); + receiver.onConnectionError.addListener(() => { if (retrievedDevice.fakeDevice.onclose) retrievedDevice.fakeDevice.onclose(); }); - retrievedDevice.bindingArray.push(binding); + retrievedDevice.receivers.push(receiver); } else { - request.close(); + request.handle.close(); } } @@ -422,8 +428,8 @@ class FakeWebUsbService { }); } - setClient(clientInfo) { - this.client_ = new device.mojom.UsbDeviceManagerClientAssociatedPtr(clientInfo); + setClient(client) { + this.client_ = client; } } @@ -474,9 +480,10 @@ class USBTest { getMessagePort(window); } + mojom = await loadMojomDefinitions(); internal.webUsbService = new FakeWebUsbService(); internal.webUsbServiceInterceptor = - new MojoInterfaceInterceptor(blink.mojom.WebUsbService.name); + new MojoInterfaceInterceptor(mojom.WebUsbService.$interfaceName); internal.webUsbServiceInterceptor.oninterfacerequest = e => internal.webUsbService.addBinding(e.handle); internal.webUsbServiceInterceptor.start(); @@ -498,7 +505,7 @@ class USBTest { return new Promise(resolve => { internal.messagePort.onmessage = channelEvent => { switch (channelEvent.data.type) { - case blink.mojom.WebUsbService.name: + case mojom.WebUsbService.$interfaceName: internal.webUsbService.addBinding(channelEvent.data.handle); break; case 'Complete': @@ -507,10 +514,11 @@ class USBTest { } }; internal.messagePort.postMessage({ - type: 'Attach' , + type: 'Attach', interfaces: [ - blink.mojom.WebUsbService.name, - ]}); + mojom.WebUsbService.$interfaceName, + ] + }); }); }); } diff --git a/tests/wpt/web-platform-tests/svg/animations/animate-marker-orient-from-auto-to-auto-start-reverse.html b/tests/wpt/web-platform-tests/svg/animations/animate-marker-orient-from-auto-to-auto-start-reverse.html index fedfe4a8c28..b7a4e68562d 100644 --- a/tests/wpt/web-platform-tests/svg/animations/animate-marker-orient-from-auto-to-auto-start-reverse.html +++ b/tests/wpt/web-platform-tests/svg/animations/animate-marker-orient-from-auto-to-auto-start-reverse.html @@ -76,7 +76,7 @@ function sample3() { assert_approx_equals(marker.orientAngle.animVal.value, 0, epsilon); assert_equals(marker.orientAngle.baseVal.value, 0); - assert_equals(marker.orientType.animVal, SVGMarkerElement.SVG_MARKER_ORIENT_UNKNOWN); + assert_equals(marker.orientType.animVal, SVGMarkerElement.SVG_MARKER_ORIENT_AUTO_START_REVERSE); assert_equals(marker.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE); } @@ -94,4 +94,4 @@ smil_async_test((t) => { runAnimationTest(t, expectedValues); }); - \ No newline at end of file + diff --git a/tests/wpt/web-platform-tests/svg/types/scripted/SVGAnimatedEnumeration-SVGMarkerElement.html b/tests/wpt/web-platform-tests/svg/types/scripted/SVGAnimatedEnumeration-SVGMarkerElement.html index 7ac884ae3e5..dfc9dd24800 100644 --- a/tests/wpt/web-platform-tests/svg/types/scripted/SVGAnimatedEnumeration-SVGMarkerElement.html +++ b/tests/wpt/web-platform-tests/svg/types/scripted/SVGAnimatedEnumeration-SVGMarkerElement.html @@ -90,8 +90,17 @@ test(function() { markerElement.setAttribute('orient', '10deg'); + // Switch to 'auto-start-reverse' value - by modifying orientType. + markerElement.orientType.baseVal = SVGMarkerElement.SVG_MARKER_ORIENT_AUTO_START_REVERSE; + assert_equals(markerElement.orientAngle.baseVal.value, 0); + assert_equals(markerElement.orientAngle.baseVal.unitType, SVGAngle.SVG_ANGLETYPE_UNSPECIFIED); + assert_equals(markerElement.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_AUTO_START_REVERSE); + assert_equals(markerElement.getAttribute('orient'), "auto-start-reverse"); + + markerElement.setAttribute('orient', '10deg'); + // Try setting invalid values. - assert_throws_js(TypeError, function() { markerElement.orientType.baseVal = 3; }); + assert_throws_js(TypeError, function() { markerElement.orientType.baseVal = 4; }); assert_equals(markerElement.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE); assert_equals(markerElement.getAttribute('orient'), "10deg"); @@ -110,4 +119,4 @@ test(function() { assert_equals(markerElement.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_AUTO); assert_equals(markerElement.getAttribute('orient'), "auto"); }); - \ No newline at end of file + diff --git a/tests/wpt/web-platform-tests/tools/lint/lint.py b/tests/wpt/web-platform-tests/tools/lint/lint.py index 38225ec9588..1872e627259 100644 --- a/tests/wpt/web-platform-tests/tools/lint/lint.py +++ b/tests/wpt/web-platform-tests/tools/lint/lint.py @@ -655,6 +655,16 @@ def check_parsed(repo_root, path, f): if incorrect_path("testdriver-vendor.js", src): errors.append(rules.TestdriverVendorPath.error(path)) + script_path = None + try: + script_path = urlsplit(urljoin(source_file.url, src)).path + except ValueError: + # This happens if the contents of src isn't something that looks like a URL to Python + pass + if (script_path == "/common/reftest-wait.js" and + "reftest-wait" not in source_file.root.attrib.get("class", "").split()): + errors.append(rules.MissingReftestWait.error(path)) + return errors class ASTCheck(with_metaclass(abc.ABCMeta)): diff --git a/tests/wpt/web-platform-tests/tools/lint/rules.py b/tests/wpt/web-platform-tests/tools/lint/rules.py index f6e23aef58a..b389e3d8f08 100644 --- a/tests/wpt/web-platform-tests/tools/lint/rules.py +++ b/tests/wpt/web-platform-tests/tools/lint/rules.py @@ -197,6 +197,14 @@ class MultipleTestharness(Rule): """ +class MissingReftestWait(Rule): + name = "MISSING-REFTESTWAIT" + description = "Missing `class=reftest-wait`" + to_fix = """ + ensure tests that include reftest-wait.js also use class=reftest-wait on the root element. + """ + + class MissingTestharnessReport(Rule): name = "MISSING-TESTHARNESSREPORT" description = "Missing ` - -
- diff --git a/tests/wpt/web-platform-tests/url/url-origin.html b/tests/wpt/web-platform-tests/url/url-origin.any.js similarity index 77% rename from tests/wpt/web-platform-tests/url/url-origin.html rename to tests/wpt/web-platform-tests/url/url-origin.any.js index fccb643ed6c..d9ef64c73b8 100644 --- a/tests/wpt/web-platform-tests/url/url-origin.html +++ b/tests/wpt/web-platform-tests/url/url-origin.any.js @@ -1,9 +1,3 @@ - - - - -
- diff --git a/tests/wpt/web-platform-tests/webdriver/tests/support/authentication.py b/tests/wpt/web-platform-tests/webdriver/tests/support/authentication.py index 25a8eb95d11..e61eef0696c 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/support/authentication.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/support/authentication.py @@ -1,15 +1,12 @@ from six.moves.urllib.parse import urlencode -def basic_authentication(username=None, password=None, protocol="http"): - from .fixtures import server_config, url - build_url = url(server_config()) - +def basic_authentication(url, username=None, password=None, protocol="http"): query = {} - return build_url("/webdriver/tests/support/authentication.py", - query=urlencode(query), - protocol=protocol) + return url("/webdriver/tests/support/authentication.py", + query=urlencode(query), + protocol=protocol) def main(request, response): diff --git a/tests/wpt/web-platform-tests/webrtc/RTCRtpTransceiver-stop.html b/tests/wpt/web-platform-tests/webrtc/RTCRtpTransceiver-stop.html index 60f6d0c1335..766b34d7b12 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCRtpTransceiver-stop.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCRtpTransceiver-stop.html @@ -148,8 +148,8 @@ promise_test(async (t) => { pc2Transceiver = pc2.getTransceivers()[0]; pc1.getTransceivers()[0].stop(); await exchangeOfferAnswer(pc1, pc2); - assert_equals('stopped', pc1Transceiver.direction); - assert_equals('stopped', pc2Transceiver.direction); + assert_equals(pc1Transceiver.direction, 'stopped'); + assert_equals(pc2Transceiver.direction, 'stopped'); }, 'If a transceiver is stopped, transceivers should end up in state stopped'); diff --git a/tests/wpt/web-platform-tests/websockets/Create-blocked-port.any.js b/tests/wpt/web-platform-tests/websockets/Create-blocked-port.any.js index 84728c0e567..0e8938a3d56 100644 --- a/tests/wpt/web-platform-tests/websockets/Create-blocked-port.any.js +++ b/tests/wpt/web-platform-tests/websockets/Create-blocked-port.any.js @@ -58,7 +58,6 @@ async_test(t => { 532, // netnews 540, // uucp 548, // afp - 554, // rtsp 556, // remotefs 563, // nntp+ssl 587, // smtp (outgoing) diff --git a/tests/wpt/web-platform-tests/websockets/handlers/send-backpressure_wsh.py b/tests/wpt/web-platform-tests/websockets/handlers/send-backpressure_wsh.py index 40905c31cff..e59070c3002 100755 --- a/tests/wpt/web-platform-tests/websockets/handlers/send-backpressure_wsh.py +++ b/tests/wpt/web-platform-tests/websockets/handlers/send-backpressure_wsh.py @@ -9,7 +9,12 @@ import time # this number too large will result in false positives, when it takes more than # 2 seconds to transmit the message anyway. This number was arrived at by # trial-and-error. -MESSAGE_SIZE = 16 * 1024 * 1024 +MESSAGE_SIZE = 1024 * 1024 + +# With Windows 10 and Python 3, the OS will buffer an entire message in memory +# and return from send() immediately, even if it is very large. To work around +# this problem, send multiple messages. +MESSAGE_COUNT = 16 def web_socket_do_extra_handshake(request): @@ -26,8 +31,10 @@ def web_socket_transfer_data(request): # 3 is complete. time.time() can go backwards. start_time = time.time() - # The large message that will be blocked by backpressure. - request.ws_stream.send_message(b' ' * MESSAGE_SIZE, binary=True) + # The large messages that will be blocked by backpressure. + for i in range(MESSAGE_COUNT): + request.ws_stream.send_message(b' ' * MESSAGE_SIZE, binary=True) # Report the time taken to send the large message. - request.ws_stream.send_message(six.text_type(time.time() - start_time), binary=False) + request.ws_stream.send_message(six.text_type(time.time() - start_time), + binary=False) diff --git a/tests/wpt/web-platform-tests/websockets/stream/tentative/backpressure-receive.any.js b/tests/wpt/web-platform-tests/websockets/stream/tentative/backpressure-receive.any.js index 17c75bd51cd..662a6a2871b 100644 --- a/tests/wpt/web-platform-tests/websockets/stream/tentative/backpressure-receive.any.js +++ b/tests/wpt/web-platform-tests/websockets/stream/tentative/backpressure-receive.any.js @@ -5,6 +5,7 @@ // Allow for this much timer jitter. const JITTER_ALLOWANCE_MS = 200; +const LARGE_MESSAGE_COUNT = 16; // This test works by using a server WebSocket handler which sends a large // message, and then sends a second message with the time it measured the first @@ -22,8 +23,10 @@ promise_test(async t => { // Skip the empty message used to fill the readable queue. await reader.read(); - // Skip the large message. - await reader.read(); + // Skip the large messages. + for (let i = 0; i < LARGE_MESSAGE_COUNT; ++i) { + await reader.read(); + } // Read the time it took. const { value, done } = await reader.read(); diff --git a/tests/wpt/web-platform-tests/webusb/resources/usb-helpers.js b/tests/wpt/web-platform-tests/webusb/resources/usb-helpers.js index bb674512478..8525da74b55 100644 --- a/tests/wpt/web-platform-tests/webusb/resources/usb-helpers.js +++ b/tests/wpt/web-platform-tests/webusb/resources/usb-helpers.js @@ -16,28 +16,12 @@ } })(); -// This function is shared between blink/web_tests/usb and external/wpt/webusb. -// Only include "/gen/" paths here, which are available in both places. -async function loadChromiumResources() { - const chromiumResources = [ - '/gen/mojo/public/mojom/base/big_buffer.mojom.js', - '/gen/mojo/public/mojom/base/string16.mojom.js', - '/gen/url/mojom/url.mojom.js', - '/gen/services/device/public/mojom/usb_device.mojom.js', - '/gen/services/device/public/mojom/usb_enumeration_options.mojom.js', - '/gen/services/device/public/mojom/usb_manager_client.mojom.js', - '/gen/third_party/blink/public/mojom/usb/web_usb_service.mojom.js', - ]; - await loadMojoResources(chromiumResources); -} - function usb_test(func, name, properties) { promise_test(async () => { assert_implements(navigator.usb, 'missing navigator.usb'); if (navigator.usb.test === undefined) { // Try loading a polyfill for the WebUSB Testing API. if (isChromiumBased) { - await loadChromiumResources(); await loadScript('/resources/chromium/webusb-test.js'); } } diff --git a/tests/wpt/web-platform-tests/webusb/usbDevice_transferIn-manual.https.html b/tests/wpt/web-platform-tests/webusb/usbDevice_transferIn-manual.https.html new file mode 100644 index 00000000000..bd3df7d54ea --- /dev/null +++ b/tests/wpt/web-platform-tests/webusb/usbDevice_transferIn-manual.https.html @@ -0,0 +1,142 @@ + + + + + + + + + + +

+ This test requires a USB device implementing the USB CDC-ACM protocol + configured to loop back TX to RX. For example, this Arduino sketch could + be used: + +

+void setup() {
+  Serial.begin(115200);
+  while (!Serial) {
+    ;
+  }
+}
+
+void loop() {
+  if (Serial.available()) {
+    Serial.write(Serial.read());
+  }
+}
+      
+

+ + +