Skip to content

Commit 94381fb

Browse files
targosdanielleadams
authored andcommitted
test: update WPT common and resources
PR-URL: #39697 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 69a2a6b commit 94381fb

File tree

14 files changed

+1655
-1325
lines changed

14 files changed

+1655
-1325
lines changed

test/fixtures/wpt/LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# The 3-Clause BSD License
22

3-
Copyright 2019 web-platform-tests contributors
3+
Copyright © web-platform-tests contributors
44

55
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
66

test/fixtures/wpt/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ See [test/wpt](../../wpt/README.md) for information on how these tests are run.
1010

1111
Last update:
1212

13-
- common: https://github.com/web-platform-tests/wpt/tree/bb97a68974/common
13+
- common: https://github.com/web-platform-tests/wpt/tree/03c5072aff/common
1414
- console: https://github.com/web-platform-tests/wpt/tree/3b1f72e99a/console
1515
- dom/abort: https://github.com/web-platform-tests/wpt/tree/1728d198c9/dom/abort
1616
- encoding: https://github.com/web-platform-tests/wpt/tree/35f70910d3/encoding
@@ -21,7 +21,7 @@ Last update:
2121
- html/webappapis/timers: https://github.com/web-platform-tests/wpt/tree/5873f2d8f1/html/webappapis/timers
2222
- interfaces: https://github.com/web-platform-tests/wpt/tree/fc086c82d5/interfaces
2323
- performance-timeline: https://github.com/web-platform-tests/wpt/tree/17ebc3aea0/performance-timeline
24-
- resources: https://github.com/web-platform-tests/wpt/tree/972ca5b669/resources
24+
- resources: https://github.com/web-platform-tests/wpt/tree/fbee645164/resources
2525
- streams: https://github.com/web-platform-tests/wpt/tree/8f60d94439/streams
2626
- url: https://github.com/web-platform-tests/wpt/tree/77d54aa9e0/url
2727
- user-timing: https://github.com/web-platform-tests/wpt/tree/df24fb604e/user-timing

test/fixtures/wpt/common/blank-with-cors.html

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Access-Control-Allow-Origin: *

test/fixtures/wpt/common/get-host-info.sub.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ function get_host_info() {
1010
var HTTPS_PORT2 = '{{ports[https][1]}}';
1111
var PROTOCOL = self.location.protocol;
1212
var IS_HTTPS = (PROTOCOL == "https:");
13+
var PORT = IS_HTTPS ? HTTPS_PORT : HTTP_PORT;
14+
var PORT2 = IS_HTTPS ? HTTPS_PORT2 : HTTP_PORT2;
1315
var HTTP_PORT_ELIDED = HTTP_PORT == "80" ? "" : (":" + HTTP_PORT);
1416
var HTTP_PORT2_ELIDED = HTTP_PORT2 == "80" ? "" : (":" + HTTP_PORT2);
1517
var HTTPS_PORT_ELIDED = HTTPS_PORT == "443" ? "" : (":" + HTTPS_PORT);
@@ -24,6 +26,8 @@ function get_host_info() {
2426
HTTP_PORT2: HTTP_PORT2,
2527
HTTPS_PORT: HTTPS_PORT,
2628
HTTPS_PORT2: HTTPS_PORT2,
29+
PORT: PORT,
30+
PORT2: PORT2,
2731
ORIGINAL_HOST: ORIGINAL_HOST,
2832
REMOTE_HOST: REMOTE_HOST,
2933

@@ -33,6 +37,7 @@ function get_host_info() {
3337
HTTPS_ORIGIN_WITH_CREDS: 'https://foo:bar@' + ORIGINAL_HOST + HTTPS_PORT_ELIDED,
3438
HTTP_ORIGIN_WITH_DIFFERENT_PORT: 'http://' + ORIGINAL_HOST + HTTP_PORT2_ELIDED,
3539
REMOTE_ORIGIN: PROTOCOL + "//" + REMOTE_HOST + PORT_ELIDED,
40+
OTHER_ORIGIN: PROTOCOL + "//" + OTHER_HOST + PORT_ELIDED,
3641
HTTP_REMOTE_ORIGIN: 'http://' + REMOTE_HOST + HTTP_PORT_ELIDED,
3742
HTTP_NOTSAMESITE_ORIGIN: 'http://' + NOTSAMESITE_HOST + HTTP_PORT_ELIDED,
3843
HTTP_REMOTE_ORIGIN_WITH_DIFFERENT_PORT: 'http://' + REMOTE_HOST + HTTP_PORT2_ELIDED,

test/fixtures/wpt/common/sab.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
const createBuffer = (() => {
22
// See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()`
3-
const sabConstructor = new WebAssembly.Memory({ shared:true, initial:0, maximum:0 }).buffer.constructor;
3+
let sabConstructor;
4+
try {
5+
sabConstructor = new WebAssembly.Memory({ shared:true, initial:0, maximum:0 }).buffer.constructor;
6+
} catch(e) {
7+
sabConstructor = null;
8+
}
49
return (type, length) => {
510
if (type === "ArrayBuffer") {
611
return new ArrayBuffer(length);
712
} else if (type === "SharedArrayBuffer") {
8-
if (sabConstructor.name !== "SharedArrayBuffer") {
13+
if (sabConstructor && sabConstructor.name !== "SharedArrayBuffer") {
914
throw new Error("WebAssembly.Memory does not support shared:true");
1015
}
1116
return new sabConstructor(length);
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<meta charset="utf-8">
3+
<title>A page that sets window.name</title>
4+
5+
<script>
6+
"use strict";
7+
8+
window.onload = () => {
9+
window.name = location.hash.slice(1); // Drop the first '#' character.
10+
window.name = "spices";
11+
};
12+
</script>

test/fixtures/wpt/resources/check-layout-th.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ function checkDataKeys(node) {
3636
"data-expected-scroll-width",
3737
"data-expected-scroll-height",
3838
"data-expected-bounding-client-rect-width",
39+
"data-expected-bounding-client-rect-height",
3940
"data-total-x",
4041
"data-total-y",
4142
"data-expected-display",
@@ -107,6 +108,11 @@ function checkExpectedValues(t, node, prefix)
107108
assert_tolerance(node.getBoundingClientRect().width, expectedWidth, prefix + "getBoundingClientRect().width");
108109
}
109110

111+
var expectedHeight = checkAttribute(output, node, "data-expected-bounding-client-rect-height");
112+
if (expectedHeight) {
113+
assert_tolerance(node.getBoundingClientRect().height, expectedHeight, prefix + "getBoundingClientRect().height");
114+
}
115+
110116
var expectedOffset = checkAttribute(output, node, "data-total-x");
111117
if (expectedOffset) {
112118
var totalLeft = node.clientLeft + node.offsetLeft;

0 commit comments

Comments
 (0)