Commit 57ad94dd authored by Chromium WPT Sync's avatar Chromium WPT Sync Committed by Commit Bot

Import wpt@511fea02e78967d7f7fd99c1a884b4c06468dd3e

Using wpt-import in Chromium 2c37032b.
With Chromium commits locally applied on WPT:
1d5b803f "Add WebVTT support for inline styling - Web Platform Tests"


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

Directory owners for changes in this CL:
guidou@chromium.org, armax@chromium.org:
  external/wpt/mediacapture-streams
rego@igalia.com:
  external/wpt/css/css-grid

NOAUTOREVERT=true
TBR=smcgruer

No-Export: true
Change-Id: Iaaad527fbb79df9ea9d0f299baab29ce297dd418
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1878948Reviewed-by: default avatarWPT 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@{#709138}
parent 1fdfdeba
import os
here = os.path.dirname(__file__)
readonly_template = """\
interface {interface}A {{
readonly setlike<DOMString>;
static void {method}();
}};
interface {interface}B {{
readonly setlike<DOMString>;
static readonly attribute long {method};
}};
"""
readwrite_template = """\
interface ReadOnly {{
readonly setlike<DOMString>;
}};
interface ReadWrite {{
setlike<DOMString>;
}};
interface {interface}A {{
setlike<DOMString>;
void {method}();
}};
interface {interface}B {{
readonly setlike<DOMString>;
void {method}();
}};
interface {interface}C {{
readonly setlike<DOMString>;
readonly attribute long {method};
}};
interface {interface}D {{
readonly setlike<DOMString>;
const long {method} = 0;
}};
interface {interface}E : ReadOnly {{
void {method}();
}};
interface {interface}F : ReadOnly {{
readonly attribute long {method};
}};
interface {interface}G : ReadOnly {{
const long {method} = 0;
}};
interface {interface}H {{
readonly setlike<DOMString>;
static void {method}();
}};
interface {interface}I {{
readonly setlike<DOMString>;
static readonly attribute long {method};
}};
interface {interface}J1 {{
static void {method}();
}};
interface {interface}J2 : {interface}J1 {{
readonly setlike<DOMString>;
}};
interface {interface}K1 {{
static readonly attribute long {method};
}};
interface {interface}K2 : {interface}K1 {{
readonly setlike<DOMString>;
}};
"""
members_readonly = [
"entries",
"forEach",
"has",
"keys",
"size",
"values",
]
members_readwrite = [
"add",
"clear",
"delete",
]
def transform(m):
return m[0].upper() + m[1:]
tests = [
(members_readonly, readonly_template),
(members_readwrite, readwrite_template),
]
for (members, template) in tests:
for method in members:
path = "{here}/../valid/idl/setlike-{method}.widl".format(here=here, method=method)
test = template.format(method=method, interface=transform(method))
with open(path, "wb") as f:
f.write(test.encode("utf8"))
// META: global=worker // META: global=worker
// META: timeout=long
//
// This test isn't actually slow usually, but sometimes it takes >10 seconds on
// Firefox with service worker for no obvious reason.
'use strict'; 'use strict';
......
/*
Take every possible line break so the box width is the width of largest
unbreakable line box.
*/
.min-content {
/* Webkit, but not actually implemented outside deprecated flexbox */
width: min-intrinsic;
width: -webkit-min-content;
width: -moz-min-content;
width: min-content;
}
.max-content {
width: -webkit-max-content;
width: -moz-max-content;
width: max-content;
}
/*
Identical to auto except for elements with an instrinsic width like an
img where this overrides the intrinsic width to get regular block "auto".
*/
.fill-available {
width: -webkit-fill-available;
/* Firefox is missing the fill- prefix because they followed an older spec */
width: -moz-available;
width: fill-available;
}
/*
Shrink wrap just like floating.
max(min-content, min(max-content, fill-available))
*/
.fit-content {
/* Webkit, but only outside a deprecated flexbox. */
width: intrinsic;
width: -webkit-fit-content;
width: -moz-fit-content;
width: fit-content;
}
.max-width-min-content {
max-width: -webkit-min-content;
max-width: -moz-min-content;
max-width: min-content;
}
.max-width-max-content {
max-width: -webkit-max-content;
max-width: -moz-max-content;
max-width: max-content;
}
.max-width-fill-available {
max-width: -webkit-fill-available;
max-width: -moz-available;
max-width: fill-available;
}
.max-width-fit-content {
max-width: intrinsic;
max-width: -webkit-fit-content;
max-width: -moz-fit-content;
max-width: fit-content;
}
.min-width-min-content {
min-width: -webkit-min-content;
min-width: -moz-min-content;
min-width: min-content;
}
.min-width-max-content {
min-width: -webkit-max-content;
min-width: -moz-max-content;
min-width: max-content;
}
.min-width-fill-available {
min-width: -webkit-fill-available;
min-width: -moz-available;
min-width: fill-available;
}
.min-width-fit-content {
min-width: intrinsic;
min-width: -webkit-fit-content;
min-width: -moz-fit-content;
min-width: fit-content;
}
<svg xmlns="http://www.w3.org/2000/svg"
width="260" height="260" viewBox="0 0 1280.000000 1276.000000"
preserveAspectRatio="xMidYMid meet">
<!-- from https://svgsilh.com/image/303465.html , CC0 -->
<metadata>
Created by potrace 1.15, written by Peter Selinger 2001-2017
</metadata>
<g transform="translate(0.000000,1276.000000) scale(0.100000,-0.100000)"
fill="#003C56" stroke="none">
<path d="M5975 12749 c-86 -6 -144 -14 -151 -22 -6 -6 -41 -111 -77 -232 -37
-121 -107 -355 -157 -520 -50 -165 -123 -406 -162 -536 l-71 -237 -188 -46
c-213 -52 -475 -135 -658 -208 -68 -27 -130 -47 -137 -44 -7 3 -301 221 -653
485 -353 265 -645 481 -649 481 -13 0 -257 -149 -392 -240 -198 -132 -359
-254 -578 -436 l-25 -21 271 -746 c150 -411 272 -752 272 -758 0 -6 -40 -56
-88 -112 -175 -202 -337 -420 -457 -615 -32 -52 -64 -96 -72 -99 -8 -3 -366 4
-796 16 -430 12 -794 21 -808 21 -23 0 -30 -9 -56 -67 -61 -137 -142 -353
-202 -538 -61 -186 -145 -494 -138 -502 2 -2 303 -204 668 -448 562 -377 665
-450 670 -473 3 -15 1 -72 -4 -127 -8 -99 -2 -525 11 -702 l7 -92 -669 -448
c-367 -246 -672 -450 -677 -453 -9 -6 23 -147 72 -320 71 -249 180 -554 284
-794 l16 -39 137 6 c75 4 440 14 810 24 l673 17 25 -29 c13 -17 68 -95 120
-174 113 -169 222 -314 350 -467 l93 -111 -275 -752 c-151 -414 -274 -757
-272 -761 5 -14 213 -185 361 -296 225 -170 606 -418 631 -412 7 2 299 219
649 482 l637 479 47 -15 c27 -9 84 -30 128 -48 183 -74 392 -141 619 -200 81
-21 149 -40 151 -42 3 -3 222 -724 386 -1273 38 -126 73 -239 78 -251 8 -18
24 -22 137 -33 314 -30 1078 -22 1110 12 6 7 41 111 77 232 37 121 107 355
157 520 50 165 123 406 162 536 l71 237 188 46 c213 52 475 135 658 208 68 27
130 47 137 44 7 -3 301 -221 653 -485 353 -265 644 -481 649 -481 11 0 250
145 362 220 206 137 422 299 608 456 l25 21 -271 746 c-150 411 -272 752 -272
758 0 6 40 56 88 112 175 202 337 420 457 615 32 52 64 96 72 99 8 3 366 -4
796 -16 430 -12 794 -21 808 -21 23 0 30 9 56 68 61 136 142 352 202 537 61
186 145 494 138 502 -2 2 -303 204 -668 448 -562 377 -665 450 -670 473 -3 15
-1 72 4 127 8 99 2 527 -11 702 l-7 92 668 448 c368 246 673 450 678 453 9 6
-22 146 -72 320 -71 249 -180 554 -284 794 l-17 39 -141 -6 c-78 -4 -443 -14
-810 -24 l-668 -17 -25 29 c-13 17 -68 95 -120 174 -113 169 -222 314 -350
467 l-93 111 275 752 c151 414 274 757 272 761 -5 14 -213 185 -361 296 -225
170 -606 418 -631 412 -7 -2 -299 -219 -649 -482 l-637 -479 -47 15 c-27 9
-84 30 -128 48 -183 74 -392 141 -619 200 -81 21 -149 40 -151 42 -3 3 -222
724 -386 1273 -38 127 -73 239 -78 251 -8 18 -24 22 -137 33 -164 16 -775 22
-959 10z"/>
</g>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 762 762">
<rect x="183.9" y="511.4" fill="#FFFFFF" width="201.5" height="38"/>
<path fill="#FFFFFF" d="M504.9,549.4c37.3,0,67.6-30.3,67.6-67.6v-19h-38v19c0,16.3-13.3,29.6-29.6,29.6c-16.3,0-29.6-13.3-29.6-29.6
V287.4h-38v56.5h-51.9v-92.6h112.4c25.5,0,46.3,20.8,46.3,46.3c0,20-13,37.8-31.8,44v39.1c40-6.9,69.8-42.1,69.8-83
c0-46.5-37.8-84.3-84.3-84.3H366.4c-10.5,0-19,8.5-19,19V386l-46.4-79.4c-3.4-5.8-9.7-9.4-16.4-9.4c-6.7,0-13,3.6-16.4,9.4
l-46.2,79.2V213.4h-38v242.7c0,8.6,5.8,16.1,14,18.3c8.3,2.2,17.1-1.4,21.4-8.8l65.2-111.8L350,465.7c3.4,5.8,9.7,9.4,16.4,9.4
c1.7,0,3.3-0.2,5-0.7c8.3-2.2,14-9.8,14-18.3v-74.2h51.9v99.8C437.3,519.1,467.6,549.4,504.9,549.4z"/>
</svg>
</svg>
<!doctype html>
<html>
<head>
<title>enumerateDevices is returning new MediaDeviceInfo objects every time</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
</head>
<body>
<script>
function doTest(callGetUserMedia, testName)
{
promise_test(async () => {
if (callGetUserMedia)
await navigator.mediaDevices.getUserMedia({audio : true, video: true});
const deviceList1 = await navigator.mediaDevices.enumerateDevices();
const deviceList2 = await navigator.mediaDevices.enumerateDevices();
assert_equals(deviceList1.length, deviceList2.length);
for (let i = 0; i < deviceList1.length; i++) {
const device1 = deviceList1[i];
const device2 = deviceList2[i];
assert_not_equals(device1, device2);
assert_equals(device1.deviceId, device2.deviceId, "deviceId");
assert_equals(device1.kind, device2.kind, "kind");
}
}, testName);
}
doTest(false, "enumerateDevices returns new objects in case device-info permission is not granted");
doTest(true, "enumerateDevices returns new objects in case device-info permission is granted");
</script>
</body>
</html>
importScripts("/resources/testharness.js");
function doTest(event)
{
if (!event.request.url.includes("fetch-error-test"))
return;
let counter = 0;
const stream = new ReadableStream({ pull: controller => {
switch (++counter) {
case 1:
controller.enqueue(new Uint8Array([1]));
return;
default:
// We asynchronously error the stream so that there is ample time to resolve the fetch promise and call text() on the response.
step_timeout(() => controller.error("Sorry"), 50);
}
}});
event.respondWith(new Response(stream));
}
self.addEventListener("fetch", doTest);
This is a testharness.js-based test.
PASS Setup service worker
FAIL Make sure a load that makes progress does not time out assert_true: expected true got false
PASS Unregister service worker
Harness: the test ran to completion.
<!DOCTYPE html>
<html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script>
</head>
<body>
<script>
var scope = "resources";
var registration;
promise_test(async (test) => {
registration = await navigator.serviceWorker.register("fetch-error-worker.js", { scope : scope });
var activeWorker = registration.active;
if (activeWorker)
return;
activeWorker = registration.installing;
return new Promise(resolve => {
activeWorker.addEventListener('statechange', () => {
if (activeWorker.state === "activated")
resolve();
});
});
}, "Setup service worker");
promise_test(async (test) => {
const iframe = await with_iframe(scope);
const response = await iframe.contentWindow.fetch("fetch-error-test");
await response.text().then(assert_unreached, (error) => { assert_true(error.message.includes("Sorry")); });
iframe.remove();
}, "Make sure a load that makes progress does not time out");
promise_test(async () => {
registration.unregister();
}, "Unregister service worker");
</script>
</body>
</html>
...@@ -7,3 +7,4 @@ html/tools/build.sh ...@@ -7,3 +7,4 @@ html/tools/build.sh
offscreen-canvas/tools/build.sh offscreen-canvas/tools/build.sh
python mimesniff/mime-types/resources/generated-mime-types.py python mimesniff/mime-types/resources/generated-mime-types.py
python3 css/css-ui/tools/appearance-build-webkit-reftests.py python3 css/css-ui/tools/appearance-build-webkit-reftests.py
python3 WebIDL/generate-setlike.py
This is a testharness.js-based test.
PASS Setup service worker
FAIL Make sure a load that makes progress does not time out assert_true: expected true got false
PASS Unregister service worker
Harness: the test ran to completion.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment