Skip to content

Commit

Permalink
Import wpt@e8b2915cd133b09d3f1405fd722e76360fb93723
Browse files Browse the repository at this point in the history
Using wpt-import in Chromium afb4042.
With Chromium commits locally applied on WPT:
e3a4dce "[rsafor] Move to tentative external WPTs"
cc71781 "Revert "VT: Require a documentElement for the transition to happen""


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:
carlosil@chromium.org:
  external/wpt/mixed-content

NOAUTOREVERT=true
R=rubber-stamper@appspot.gserviceaccount.com

No-Export: true
Cq-Include-Trybots: luci.chromium.try:linux-wpt-identity-fyi-rel,linux-wpt-input-fyi-rel,linux-blink-rel
Change-Id: Ia71276bf83a2464acf758b4a1a6d18d67a767c2c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4197740
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: WPT Autoroller <wpt-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1098116}
  • Loading branch information
Chromium WPT Sync authored and Chromium LUCI CQ committed Jan 27, 2023
1 parent 0e3789b commit 343eab0
Show file tree
Hide file tree
Showing 4 changed files with 260 additions and 16 deletions.
116 changes: 112 additions & 4 deletions third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json
Expand Up @@ -344742,6 +344742,34 @@
"d2b92041b809f31419c6f5e929dfa5dd4b03bb50",
[]
],
"service-worker-fetch.https.window-expected.txt": [
"81f6d8aac3a8a7057b3b91cbcb1ff3b5b07eb774",
[]
],
"service-worker-update.https.window-expected.txt": [
"0aca19f20b483f0527a40e58c9aa507986c61365",
[]
],
"service-worker.https.window-expected.txt": [
"9f6d82c80281d637d51f1976ccbcc883448dbcf8",
[]
],
"shared-worker-fetch.https.window-expected.txt": [
"0dc5268932503b1922bc3e69b523c6d78d7c29b6",
[]
],
"shared-worker-fetch.window-expected.txt": [
"52b68beee5fb99fa3f008353283abec889ee2396",
[]
],
"shared-worker.https.window-expected.txt": [
"7acfd4c64f5339a5bc11a599d3d447bed545dd7f",
[]
],
"shared-worker.window-expected.txt": [
"8718ffde7bc70a2802ec04ecd5c1e3b42e0dca32",
[]
],
"shared-worker.window.js.ini": [
"afa6f4c187dca0da3e32d890dbc0286982f480b3",
[]
Expand Down Expand Up @@ -358537,7 +358565,13 @@
"document-base-url-initiated-grand-parent.https.window.js.ini": [
"af28c41df64b3dbe2983d474b229003bd6c9d40c",
[]
]
],
"resources": {
"send-back-base-url.html": [
"6fdf81d1db76a752283a740a45b79461aaae071a",
[]
]
}
}
}
},
Expand Down Expand Up @@ -379525,7 +379559,7 @@
[]
],
"nested-contexts.js": [
"c0822943e86a68f43d003e03166fbc987014946e",
"31337ae5da2e181df178fa881bb38c3f394580b1",
[]
],
"nested.css": [
Expand Down Expand Up @@ -388292,6 +388326,24 @@
]
}
},
"top-level-storage-access-api": {
"README.md": [
"31a32b8033e3e3d3b2c6f9a04230b76186fbc1c3",
[]
],
"tentative": {
"requestStorageAccessForOrigin.sub.window.js.ini": [
"108b503429ef94f2b40b6f5a8f3e5db51b410fec",
[]
],
"resources": {
"requestStorageAccessForOrigin-iframe.html": [
"3e2f6d5b6288993714f3ee56ae89631e03d563b9",
[]
]
}
}
},
"touch-events": {
"DIR_METADATA": [
"71b1a71b1fc10f62a9c9b29c86269a4b75f64892",
Expand Down Expand Up @@ -449117,7 +449169,7 @@
},
"css-nesting": {
"cssom.html": [
"c7150cec5db459824e22d2ae445a62db6a484684",
"987c31103677ca662b8d2e2c2d14a542a155103a",
[
null,
{}
Expand Down Expand Up @@ -469717,6 +469769,15 @@
{}
]
],
"requires-width-and-height-to-both-be-specified.https.html": [
"0c707c668e9980901a2250ccb28042eb40c86f8c",
[
null,
{
"testdriver": true
}
]
],
"returns-window-with-document.https.html": [
"a1d7363e54bdc5fbc04a6ad6e0aad30b552ea8d7",
[
Expand Down Expand Up @@ -538526,6 +538587,20 @@
{}
]
],
"document-base-url-changes-after-nav-about-srcdoc.https.window.js": [
"897647a45e1f41a2b3d1eae16a2fa1b6631e0da1",
[
"html/infrastructure/urls/terminology-0/document-base-url-changes-after-nav-about-srcdoc.https.window.html",
{
"script_metadata": [
[
"script",
"/common/get-host-info.sub.js"
]
]
}
]
],
"document-base-url-initiated-grand-parent.https.window.js": [
"1983f02c267837a9152f94d91bdbde4b1c3add6d",
[
Expand Down Expand Up @@ -568204,6 +568279,13 @@
{}
]
],
"mixed-content-cors.https.sub.html": [
"eb7b443df39bbca15767df3ad474a4375d5ab429",
[
null,
{}
]
],
"video-upgrade.https.sub.html": [
"ea2d07309c06af5d56e5553ed7a3f9a9a80bca8f",
[
Expand Down Expand Up @@ -593306,7 +593388,7 @@
]
],
"scroll-timeline-shorthand.tentative.html": [
"b74113a52a20819f2e10d00abc8706128e072e21",
"24597b91e2f1d2b4b224e02b998436d4da1667a6",
[
null,
{}
Expand Down Expand Up @@ -610748,6 +610830,32 @@
]
]
},
"top-level-storage-access-api": {
"tentative": {
"requestStorageAccessForOrigin.sub.window.js": [
"f7dd478a7078673643d91fece6f64bf0148c7ec6",
[
"top-level-storage-access-api/tentative/requestStorageAccessForOrigin.sub.window.html",
{
"script_metadata": [
[
"script",
"/storage-access-api/helpers.js"
],
[
"script",
"/resources/testdriver.js"
],
[
"script",
"/resources/testdriver-vendor.js"
]
]
}
]
]
}
},
"touch-events": {
"expose-legacy-touch-event-apis.html": [
"2dab74dccd60f3b737a7a57362e28aac85a6cbd3",
Expand Down
@@ -0,0 +1,84 @@
<!DOCTYPE html>
<html>
<head>
<title>Test mixed content autoupgrade behavior for CORS request</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/get-host-info.sub.js"></script>
</head>
<body>
<script>
// Test that request with CORS get upgraded for audio elements
async_test(
(t) => assert_other_host_audio_loads(t),
"Cross-Origin audio should get upgraded even if CORS is set"
);

function assert_other_host_audio_loads(test) {
// Since autoupgrades don't upgrade custom ports, we use the https port with an HTTP scheme. A successful autoupgrade will result in the right URL loading (and no autoupgrade will result in failure).
var otherHost = get_host_info().HTTP_NOTSAMESITE_ORIGIN.slice(0, -4); // cut of http port
var url =
otherHost +
"{{ports[https][0]}}/mixed-content/tentative/resources/test.wav?pipe=header(Access-Control-Allow-Origin,*)";
var i = document.createElement("audio");
i.oncanplaythrough = test.step_func_done((_) => {
assert_equals(i.duration, 1, "Length of other host audio is correct");
});
i.onerror = test.unreached_func(
"Audio of other host should load successfully from " + url
);
i.crossOrigin = "anonymous";
i.src = url;
}

// Test that request with CORS get upgraded for image elements
async_test(
(t) => assert_other_host_image_loads(t),
"Cross-Origin image should get upgraded even if CORS is set"
);

function assert_other_host_image_loads(test) {
// Since autoupgrades don't upgrade custom ports, we use the https port with an HTTP scheme. A successful autoupgrade will result in the right URL loading (and no autoupgrade will result in failure).
var otherHost = get_host_info().HTTP_NOTSAMESITE_ORIGIN.slice(0, -4); // cut of http port
var url = new URL(
otherHost +
"{{ports[https][0]}}/mixed-content/tentative/resources/pass.png?pipe=header(Access-Control-Allow-Origin,*)"
);
var i = document.createElement("img");
i.onload = test.step_func_done((_) => {
assert_equals(i.naturalHeight, 64, "Height.");
assert_equals(i.naturalWidth, 168, "Width.");
});
i.crossOrigin = "anonymous";
i.onerror = test.unreached_func(
"image of other host should load successfully from " + url
);
i.src = url;
}

// Test that request with CORS get upgraded for video elements
async_test(
(t) => assert_other_host_video_loads(t),
"Cross-Origin video should get upgraded even if CORS is set"
);

function assert_other_host_video_loads(test) {
// Since autoupgrades don't upgrade custom ports, we use the https port with an HTTP scheme. A successful autoupgrade will result in the right URL loading (and no autoupgrade will result in failure).
var otherHost = get_host_info().HTTP_NOTSAMESITE_ORIGIN.slice(0, -4); // cut of http port
var url = new URL(
otherHost +
"{{ports[https][0]}}/mixed-content/tentative/resources/test.ogv?pipe=header(Access-Control-Allow-Origin,*)"
);
var i = document.createElement("video");
i.oncanplaythrough = test.step_func_done((_) => {
assert_equals(Math.floor(i.duration), 300, "Length. Other host");
});
i.crossOrigin = "anonymous";
i.onerror = test.unreached_func(
"Video of other host should load successfully from " + url
);
i.src = url;
}
</script>
</body>
</html>
@@ -1,6 +1,5 @@
<!DOCTYPE html>
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/6674">
<link rel="help" href="https://drafts.csswg.org/scroll-animations-1/rewrite#scroll-timeline-axis">
<link rel="help" href="https://drafts.csswg.org/scroll-animations-1/#scroll-timeline-shorthand">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/computed-testcommon.js"></script>
Expand All @@ -13,26 +12,38 @@
test_valid_value('scroll-timeline', 'abc horizontal');
test_valid_value('scroll-timeline', 'abc inline');
test_valid_value('scroll-timeline', 'aBc inline');
test_valid_value('scroll-timeline', 'none vertical');
test_valid_value('scroll-timeline', 'inline inline');
test_valid_value('scroll-timeline', 'abc');
test_valid_value('scroll-timeline', 'inline');
test_valid_value('view-timeline', 'a, b, c');
test_valid_value('view-timeline', 'a inline, b block, c vertical', 'a inline, b, c vertical');

test_valid_value('scroll-timeline', 'inline block', 'inline');
test_valid_value('scroll-timeline', 'block block', 'block');
test_valid_value('scroll-timeline', 'vertical block', 'vertical');
test_valid_value('scroll-timeline', 'horizontal block', 'horizontal');

test_valid_value('scroll-timeline', 'a, b, c');
test_valid_value('scroll-timeline', 'a inline, b block, c vertical', 'a inline, b, c vertical');
test_valid_value('scroll-timeline', 'auto');

test_invalid_value('scroll-timeline', '');
test_invalid_value('scroll-timeline', 'abc abc');
test_invalid_value('view-timeline', ',');
test_invalid_value('view-timeline', ',,block,,');
test_invalid_value('scroll-timeline', 'block none');
test_invalid_value('scroll-timeline', 'inline abc');
test_invalid_value('scroll-timeline', 'default');
test_invalid_value('scroll-timeline', ',');
test_invalid_value('scroll-timeline', ',,block,,');

test_computed_value('scroll-timeline', 'none block', 'none');
test_computed_value('scroll-timeline', 'abc inline');
test_computed_value('scroll-timeline', 'none vertical', 'none vertical');
test_computed_value('scroll-timeline', 'none vertical');
test_computed_value('scroll-timeline', 'abc horizontal');
test_computed_value('scroll-timeline', 'vertical vertical');
test_computed_value('scroll-timeline', 'abc');
test_computed_value('view-timeline', 'a, b, c');
test_computed_value('view-timeline', 'a inline, b block, c vertical', 'a inline, b, c vertical');
test_computed_value('scroll-timeline', 'inline block', 'inline');
test_computed_value('scroll-timeline', 'block block', 'block');
test_computed_value('scroll-timeline', 'vertical block', 'vertical');
test_computed_value('scroll-timeline', 'horizontal block', 'horizontal');
test_computed_value('scroll-timeline', 'a, b, c');
test_computed_value('scroll-timeline', 'a inline, b block, c vertical', 'a inline, b, c vertical');

test_shorthand_value('scroll-timeline', 'abc vertical',
{
Expand All @@ -54,4 +65,45 @@
'scroll-timeline-name': 'abc, def',
'scroll-timeline-axis': 'block, block',
});

function test_shorthand_contraction(shorthand, longhands, expected) {
let longhands_fmt = Object.entries(longhands).map((e) => `${e[0]}:${e[1]}`).join(';');
test((t) => {
t.add_cleanup(() => {
for (let shorthand of Object.keys(longhands))
target.style.removeProperty(shorthand);
});
for (let [shorthand, value] of Object.entries(longhands))
target.style.setProperty(shorthand, value);
assert_equals(target.style.getPropertyValue(shorthand), expected, 'Declared value');
assert_equals(getComputedStyle(target).getPropertyValue(shorthand), expected, 'Computed value');
}, `Shorthand contraction of ${longhands_fmt}`);
}

test_shorthand_contraction('scroll-timeline', {
'scroll-timeline-name': 'abc',
'scroll-timeline-axis': 'inline',
}, 'abc inline');

test_shorthand_contraction('scroll-timeline', {
'scroll-timeline-name': 'a, b',
'scroll-timeline-axis': 'inline, block',
}, 'a inline, b');

test_shorthand_contraction('scroll-timeline', {
'scroll-timeline-name': 'none, none',
'scroll-timeline-axis': 'block, block',
}, 'none, none');

// Longhands with different lengths:

test_shorthand_contraction('scroll-timeline', {
'scroll-timeline-name': 'a, b, c',
'scroll-timeline-axis': 'inline, inline',
}, '');

test_shorthand_contraction('scroll-timeline', {
'scroll-timeline-name': 'a, b',
'scroll-timeline-axis': 'inline, inline, inline',
}, '');
</script>
Expand Up @@ -4,7 +4,7 @@
'use strict';

// Note that this file follows the pattern in:
// third_party/blink/web_tests/external/wpt/storage-access-api/requestStorageAccess.sub.window.js
// storage-access-api/requestStorageAccess.sub.window.js
//
// Some tests are run at the top-level, and an iframe is added to validate API
// behavior in that context.
Expand Down

0 comments on commit 343eab0

Please sign in to comment.