Skip to content

Commit

Permalink
Import wpt@b42310489d080ec6e4f30e950059887e8e05a637
Browse files Browse the repository at this point in the history
Using wpt-import in Chromium 1d9b11c.
With Chromium commits locally applied on WPT:
9df922f "[renderblocking] Register finish callbacks for link header preloads"


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/+/main/docs/testing/web_platform_tests.md

Directory owners for changes in this CL:
jsbell@chromium.org:
  external/wpt/resources
yhirano@chromium.org, mkwst@chromium.org, japhet@chromium.org:
  external/wpt/fetch

NOAUTOREVERT=true

No-Export: true
Cq-Include-Trybots: luci.chromium.try:linux-wpt-identity-fyi-rel,linux-wpt-input-fyi-rel,linux-blink-rel
Change-Id: I9b7ad1967483647b72fa1389e6a9bcfa91146d98
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3569128
Auto-Submit: WPT Autoroller <wpt-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Reviewed-by: Weizhong Xia <weizhong@google.com>
Commit-Queue: Weizhong Xia <weizhong@google.com>
Cr-Commit-Position: refs/heads/main@{#988721}
  • Loading branch information
Chromium WPT Sync authored and Chromium LUCI CQ committed Apr 4, 2022
1 parent 1d46b83 commit 132c5b9
Show file tree
Hide file tree
Showing 12 changed files with 243 additions and 30 deletions.
8 changes: 7 additions & 1 deletion third_party/blink/web_tests/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -3331,6 +3331,12 @@ crbug.com/626703 [ Win ] virtual/prerender/external/wpt/speculation-rules/preren
crbug.com/626703 [ Win ] virtual/partitioned-cookies/http/tests/inspector-protocol/network/disabled-cache-navigation.js [ Failure ]

# ====== New tests from wpt-importer added here ======
crbug.com/626703 [ Mac11-arm64 ] external/wpt/fetch/private-network-access/nested-worker.https.window.html [ Timeout ]
crbug.com/626703 [ Mac10.12 ] external/wpt/html/cross-origin-opener-policy/header-parsing.https.html [ Timeout ]
crbug.com/626703 [ Mac10.12 ] external/wpt/html/cross-origin-opener-policy/reporting/access-reporting/property-opener-set.https.html [ Timeout ]
crbug.com/626703 [ Mac10.12 ] virtual/document-transition/wpt_internal/document-transition/new-content-container-writing-modes.html [ Timeout ]
crbug.com/626703 [ Mac10.12 ] virtual/no-alloc-direct-call/external/wpt/html/canvas/element/manual/wide-gamut-canvas/canvas-display-p3-drawImage-ImageBitmap-cloned.html [ Timeout ]
crbug.com/626703 [ Mac10.12 ] virtual/split-http-cache/external/wpt/signed-exchange/reporting/sxg-reporting-navigation-cert_fetch_error-downgraded.tentative.html [ Timeout ]
crbug.com/626703 [ Mac11-arm64 ] external/wpt/navigation-api/ordering-and-transition/navigate-cross-document-double.html [ Timeout ]
crbug.com/626703 external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-meter-background-attachment-001.html [ Failure ]
crbug.com/626703 [ Linux ] external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-meter-background-clip-001.html [ Failure ]
Expand Down Expand Up @@ -7700,7 +7706,7 @@ crbug.com/1311786 external/wpt/navigation-api/navigation-methods/sandboxing-back
# Scroll Unification known issues (go/su-web-tests) for enabling in test:
crbug.com/1311431 [ Mac ] fast/scroll-behavior/overscroll-behavior.html [ Failure Pass ]
crbug.com/1248231 fast/events/touch/touch-latched-scroll-node-removed.html [ Failure Pass ]
crbug.com/1248231 fast/events/wheel/wheel-latched-scroll-node-removed.html [ Failure Timeout Pass ]
crbug.com/1248231 fast/events/wheel/wheel-latched-scroll-node-removed.html [ Failure Pass Timeout ]
crbug.com/1311731 [ Linux ] fast/events/touch/gesture/touch-gesture-scroll-input-field.html [ Failure Pass ]
crbug.com/1311731 [ Win ] fast/events/touch/gesture/touch-gesture-scroll-input-field.html [ Failure Pass ]
crbug.com/1248581 fast/scrolling/resize-corner-tracking-touch.html [ Failure Pass ]
Expand Down
2 changes: 1 addition & 1 deletion third_party/blink/web_tests/external/Version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Version: bc351be47b742e2d306907de797f6dd56093f092
Version: b42310489d080ec6e4f30e950059887e8e05a637
38 changes: 29 additions & 9 deletions third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json
Original file line number Diff line number Diff line change
Expand Up @@ -148957,7 +148957,7 @@
]
],
"block-ruby-001.html": [
"f6a058807c48dc5c0cfe056a95355f3d234ac0ad",
"0602116aacae5187176de06d865b584cbf9bc0b8",
[
null,
[
Expand Down Expand Up @@ -278333,7 +278333,7 @@
[]
],
"block-ruby-001-ref.html": [
"b8d851fb532107b8d3e7fd792438295577b6ac23",
"076a2f01cfba8693e633b15dfd50e0946fe8167d",
[]
],
"block-ruby-002-ref.html": [
Expand Down Expand Up @@ -294371,7 +294371,7 @@
[]
],
"testharness.md": [
"57cbd33ea0b35c39af321bafca75a56d8728797a",
"2a13c4c7f1101d16adfa3aba8c20d1fd2c0c330c",
[]
],
"tools.md": [
Expand Down Expand Up @@ -299562,6 +299562,10 @@
]
},
"range": {
"general.any.serviceworker-expected.txt": [
"61126fdaf3eaaebfbee0d435c749a4920f489a81",
[]
],
"general.window-expected.txt": [
"d15469b170082ed0d182f611184954647d90379a",
[]
Expand All @@ -299572,7 +299576,7 @@
[]
],
"long-wav.py": [
"be7df7b83d8723ffd8c977d3f4b5c42a23d7918a",
"acfc81a71809dc3867a956872e6d65e23ad4d58d",
[]
],
"partial-script.py": [
Expand Down Expand Up @@ -310036,7 +310040,7 @@
]
},
"structured-cloning-error-stack-optional.sub.window-expected.txt": [
"c939958ba0335696671453638f8803501a25b0b1",
"bdda3adea39bd4b931d43ad525cfb94a3a1d8e3f",
[]
]
},
Expand Down Expand Up @@ -326888,7 +326892,7 @@
[]
],
"testharness.js": [
"a6f48e1f943b9952a8fbe5d882278c2cfb86baba",
"2c5df32b8c73c8cc4b1c0e0f3bec406fef345e72",
[]
],
"testharness.js.headers": [
Expand Down Expand Up @@ -390476,7 +390480,7 @@
]
],
"table-width-redistribution-fixed-padding.html": [
"57843d5eb6e845b95bcab53c6dd3b24fc71be7ae",
"097ddacfc3139105f0d80689e0c03ac722a00aeb",
[
null,
{}
Expand Down Expand Up @@ -433833,7 +433837,7 @@
},
"range": {
"general.any.js": [
"80791c3847eac7501191b44e541d85f5b8f293b7",
"3c4669ad0bbc1c3f10bca384194cd75dd54aa171",
[
"fetch/range/general.any.html",
{
Expand All @@ -433842,6 +433846,10 @@
"global",
"window,worker"
],
[
"script",
"/common/get-host-info.sub.js"
],
[
"script",
"/common/utils.js"
Expand All @@ -433857,6 +433865,10 @@
"global",
"window,worker"
],
[
"script",
"/common/get-host-info.sub.js"
],
[
"script",
"/common/utils.js"
Expand All @@ -433872,6 +433884,10 @@
"global",
"window,worker"
],
[
"script",
"/common/get-host-info.sub.js"
],
[
"script",
"/common/utils.js"
Expand All @@ -433887,6 +433903,10 @@
"global",
"window,worker"
],
[
"script",
"/common/get-host-info.sub.js"
],
[
"script",
"/common/utils.js"
Expand Down Expand Up @@ -473257,7 +473277,7 @@
]
],
"focus-after-close.html": [
"7061c34e4e45252bc3a325b104fdbae07be36004",
"d66d45527a7e39fa96ee11d9a331bcc2109aeb37",
[
null,
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@
<title>CSS Ruby Reference: basic 'block ruby' layout.</title>
<link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com">
<style>
@font-face
{
font-family: "mplus-1p-regular";
src: url("/fonts/mplus-1p-regular.woff") format("woff");
}

html
{
font-family: "mplus-1p-regular";
}

.b { background: lightblue; }
.mbp {
margin: 1px 3px 5px 7px;
Expand All @@ -25,13 +36,13 @@
display: ruby-base-container;
unicode-bidi: isolate;
}
.w { white-space: nowrap; width:2.5em; }
.w { white-space: nowrap; width:2.5em; margin: 1em 0em; }
</style>
A<div class=b><ruby><rt></rt></ruby></div>B
A<div class="b"><ruby><rt></rt></ruby></div>B
A<div class="mbp b"><ruby><rt></rt></ruby></div>B
<div class=columns>A<div class="mbp b"><ruby><rt></rt><rt></rt><rt></rt><rt></rt><rt></rt></ruby></div>B</div>
<div style="width:2.5em; border:1px solid; text-align: center">
<p><div class="w b"><ruby><rb><rb><rb><rb><rb><rb><rb><rb></ruby></div></p>
<p><div class="w b"><ruby><rbc></rbc><rbc></rbc><rbc></rbc><rbc></rbc><rbc></rbc><rbc></rbc><rbc></rbc><rbc></rbc></ruby></div></p>
<div class="columns">A<div class="mbp b"><ruby><rt></rt><rt></rt><rt></rt><rt></rt><rt></rt></ruby></div>B</div>
<div style="width:2.5em; border:1px solid;">
<div class="w b"><ruby><rb><rb><rb><rb><rb><rb><rb><rb></ruby></div>
<div class="w b"><ruby><rbc></rbc><rbc></rbc><rbc></rbc><rbc></rbc><rbc></rbc><rbc></rbc><rbc></rbc><rbc></rbc></ruby></div>
</div>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@
<link rel="help" href="https://drafts.csswg.org/css-ruby-1/#ruby-layout">
<link rel="match" href="block-ruby-001-ref.html">
<style>
@font-face
{
font-family: "mplus-1p-regular";
src: url("/fonts/mplus-1p-regular.woff") format("woff");
}

html
{
font-family: "mplus-1p-regular";
}

ruby { display: block ruby; background: lightblue; }
.mbp {
margin: 1px 3px 5px 7px;
Expand All @@ -30,10 +41,10 @@
}
</style>
A<ruby><rt></rt></ruby>B
A<ruby class=mbp><rt></rt></ruby>B
<div class=columns>A<ruby class=mbp><rt></rt><rt></rt><rt></rt><rt></rt><rt></rt></ruby>B</div>
<div style="width:2.5em; border:1px solid; text-align: center">
<p><ruby><rb><rb><rb><rb><rb><rb><rb><rb></ruby></p>
<p><ruby><rbc></rbc><rbc></rbc><rbc></rbc><rbc></rbc><rbc></rbc><rbc></rbc><rbc></rbc><rbc></rbc></ruby></p>
A<ruby class="mbp"><rt></rt></ruby>B
<div class="columns">A<ruby class=mbp><rt></rt><rt></rt><rt></rt><rt></rt><rt></rt></ruby>B</div>
<div style="width:2.5em; border:1px solid;">
<ruby style="margin: 1em 0em;"><rb><rb><rb><rb><rb><rb><rb><rb></ruby>
<ruby style="margin: 1em 0em;"><rbc></rbc><rbc></rbc><rbc></rbc><rbc></rbc><rbc></rbc><rbc></rbc><rbc></rbc><rbc></rbc></ruby>
</div>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ are:
* `jsshell`: to be run in a JavaScript shell, without access to the DOM
(currently only supported in SpiderMonkey, and skipped in wptrunner)
* `worker`: shorthand for the dedicated, shared, and service worker scopes
* `shadowrealm`: runs the test code in a
[ShadowRealm](https://github.com/tc39/proposal-shadowrealm) context hosted in
an ordinary Window context; to be run at <code><var>x</var>.any.shadowrealm.html</code>

To check if your test is run from a window or worker you can use the following two methods that will
be made available by the framework:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// META: global=window,worker
// META: script=/common/get-host-info.sub.js
// META: script=/common/utils.js

// Helpers that return headers objects with a particular guard
Expand Down Expand Up @@ -89,3 +90,47 @@ promise_test(async () => {
assert_equals(await response.json(), 'identity', `Expect identity accept-encoding if range header is ${JSON.stringify(rangeHeader)}`);
}
}, `Fetch with range header will be sent with Accept-Encoding: identity`);

promise_test(async () => {
const wavURL = new URL(get_host_info().HTTP_REMOTE_ORIGIN + '/fetch/range/resources/long-wav.py');
const stashTakeURL = new URL('resources/stash-take.py', location);

function changeToken() {
const stashToken = token();
wavURL.searchParams.set('accept-encoding-key', stashToken);
stashTakeURL.searchParams.set('key', stashToken);
}

const rangeHeaders = [
'bytes=10-9',
'bytes=-0',
'bytes=0000000000000000000000000000000000000000000000000000000000011-0000000000000000000000000000000000000000000000000000000000111',
];

for (const rangeHeader of rangeHeaders) {
changeToken();
await fetch(wavURL, { headers: { Range : rangeHeader} }).then(() => { throw "loaded with range header " + rangeHeader }, () => { });
}
}, `Cross Origin Fetch with non safe range header`);

promise_test(async () => {
const wavURL = new URL(get_host_info().HTTP_REMOTE_ORIGIN + '/fetch/range/resources/long-wav.py');
const stashTakeURL = new URL('resources/stash-take.py', location);

function changeToken() {
const stashToken = token();
wavURL.searchParams.set('accept-encoding-key', stashToken);
stashTakeURL.searchParams.set('key', stashToken);
}

const rangeHeaders = [
'bytes=0-10',
'bytes=0-',
'bytes=00000000000000000000000000000000000000000000000000000000011-00000000000000000000000000000000000000000000000000000000000111',
];

for (const rangeHeader of rangeHeaders) {
changeToken();
await fetch(wavURL, { headers: { Range: rangeHeader } }).then(() => { }, () => { throw "failed load with range header " + rangeHeader });
}
}, `Cross Origin Fetch with safe range header`);
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
This is a testharness.js-based test.
PASS Range header setting allowed for guard type: none
PASS Range header setting allowed for guard type: response
PASS Range header setting allowed for guard type: request
PASS Privileged header not allowed for guard type: request-no-cors
PASS Fetch with range header will be sent with Accept-Encoding: identity
PASS Cross Origin Fetch with non safe range header
FAIL Cross Origin Fetch with safe range header promise_test: Unhandled rejection with value: "failed load with range header bytes=0-10"
Harness: the test ran to completion.

Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,15 @@ def create_wav_header(sample_rate, bit_depth, channels, duration):


def main(request, response):
if request.method == u"OPTIONS":
response.status = (404, b"Not Found")
response.headers.set(b"Content-Type", b"text/plain")
return b"Preflight not accepted"

response.headers.set(b"Content-Type", b"audio/wav")
response.headers.set(b"Accept-Ranges", b"bytes")
response.headers.set(b"Cache-Control", b"no-cache")
response.headers.set(b"Access-Control-Allow-Origin", request.headers.get(b'Origin', b''))

range_header = request.headers.get(b'Range', b'')
range_header_match = range_header and re.search(r'^bytes=(\d*)-(\d*)$', isomorphic_decode(range_header))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PASS JS-engine-created TypeError (worker)
PASS JS-engine-created TypeError (cross-site iframe)
PASS web API-created TypeError (worker)
PASS web API-created TypeError (cross-site iframe)
FAIL web API-created DOMException (worker) assert_equals: expected (string) "Error: Failed to execute 'createElement' on 'Document': The tag name provided ('') is not a valid name.\n at http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:33:14\n at Test.<anonymous> (http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:41:19)\n at Test.step (http://web-platform.test:8001/resources/testharness.js:2534:25)\n at async_test (http://web-platform.test:8001/resources/testharness.js:620:34)\n at stackTests (http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:40:3)\n at http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:31:1" but got (undefined) undefined
FAIL web API-created DOMException (cross-site iframe) assert_equals: expected (string) "Error: Failed to execute 'createElement' on 'Document': The tag name provided ('') is not a valid name.\n at http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:33:14\n at Test.<anonymous> (http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:60:19)\n at Test.step (http://web-platform.test:8001/resources/testharness.js:2534:25)\n at async_test (http://web-platform.test:8001/resources/testharness.js:620:34)\n at stackTests (http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:57:3)\n at http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:31:1" but got (undefined) undefined
FAIL web API-created DOMException (worker) assert_equals: expected (string) "Error: Failed to execute 'createElement' on 'Document': The tag name provided ('') is not a valid name.\n at http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:33:14\n at Test.<anonymous> (http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:41:19)\n at Test.step (http://web-platform.test:8001/resources/testharness.js:2592:25)\n at async_test (http://web-platform.test:8001/resources/testharness.js:678:34)\n at stackTests (http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:40:3)\n at http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:31:1" but got (undefined) undefined
FAIL web API-created DOMException (cross-site iframe) assert_equals: expected (string) "Error: Failed to execute 'createElement' on 'Document': The tag name provided ('') is not a valid name.\n at http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:33:14\n at Test.<anonymous> (http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:60:19)\n at Test.step (http://web-platform.test:8001/resources/testharness.js:2592:25)\n at async_test (http://web-platform.test:8001/resources/testharness.js:678:34)\n at stackTests (http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:57:3)\n at http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:31:1" but got (undefined) undefined
Harness: the test ran to completion.

Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,17 @@
}

// Test moving the focus doesn't scroll the viewport
function test_move_focus_dont_scroll_viewport(showModal) {
async function test_move_focus_dont_scroll_viewport(showModal) {
const outViewPortButton = document.createElement("button");
outViewPortButton.style.top = (window.innerHeight + 10).toString() + "px";
outViewPortButton.style.position = "absolute";
document.body.appendChild(outViewPortButton);

outViewPortButton.focus();
await new Promise(resolve => {
document.addEventListener("scroll", () => step_timeout(resolve, 0));
outViewPortButton.focus();
});

// Since the outViewPortButton is focused, so the viewport should be
// scrolled to it
assert_true(document.documentElement.scrollTop > 0 );
Expand Down Expand Up @@ -217,9 +221,9 @@
test_move_to_shadow_host(false);
}, "Focus should be moved to the shadow DOM host if the previouly focused element is a shadow DOM node");

test(() => {
test_move_focus_dont_scroll_viewport(true);
test_move_focus_dont_scroll_viewport(false);
promise_test(async () => {
await test_move_focus_dont_scroll_viewport(true);
await test_move_focus_dont_scroll_viewport(false);
}, "Focus should not scroll if the previously focused element is outside the viewport");
</script>
</body>

0 comments on commit 132c5b9

Please sign in to comment.