Skip to content

Commit b3707a7

Browse files
committed
Bug 1692017 [wpt PR 27575] - Fetch: fragments, a=testonly
Automatic update from web-platform-tests Fetch: fragments Tests for whatwg/fetch#696. -- wpt-commits: e8181c07ac768f4fc5c7b74016a8e51226717400 wpt-pr: 27575 UltraBlame original commit: 2cdf82ffca4a04f470664a28dc850457a5ebe88a
1 parent 2752e6a commit b3707a7

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!doctype html>
2+
<meta charset=utf-8>
3+
<title>Subresources and fragment preservation</title>
4+
<script src=/resources/testharness.js></script>
5+
<script src=/resources/testharnessreport.js></script>
6+
<script src=/html/canvas/resources/canvas-tests.js></script>
7+
<div id=log></div>
8+
<!--
9+
The source image is 50h x 100w and its color depends on the fragment.
10+
11+
This image is then drawn on a 50h x 100w transparent black canvas.
12+
-->
13+
<img data-desc="Control"
14+
src="/images/colors.svg#green">
15+
<img data-desc="Redirect with the original URL containing a fragment"
16+
src="../api/resources/redirect.py?simple&location=/images/colors.svg#green">
17+
<img data-desc="Redirect with the response Location header containing a fragment"
18+
src="../api/resources/redirect.py?simple&location=/images/colors.svg%23green">
19+
<img data-desc="Redirect with both the original URL and response Location header containing a fragment"
20+
src="../api/resources/redirect.py?simple&location=/images/colors.svg%23green#red">
21+
<canvas width=100 height=50></canvas>
22+
<script>
23+
setup({ explicit_done:true });
24+
onload = () => {
25+
const canvas = document.querySelector("canvas");
26+
const ctx = canvas.getContext("2d");
27+
document.querySelectorAll("img").forEach(img => {
28+
test(t => {
29+
t.add_cleanup(() => {
30+
ctx.clearRect(0, 0, 100, 50);
31+
});
32+
ctx.drawImage(img, 0, 0);
33+
// canvas, pixelX, pixelY, r, g, b, alpha, ?, ?, tolerance
34+
_assertPixelApprox(canvas, 40, 40, 0, 255, 0, 255, undefined, undefined, 4);
35+
}, img.dataset.desc);
36+
});
37+
done();
38+
};
39+
</script>

0 commit comments

Comments
 (0)