Skip to content

Commit 0be8ae9

Browse files
test: Update WPT (#3888)
Co-authored-by: Uzlopak <[email protected]>
1 parent 21a723f commit 0be8ae9

75 files changed

Lines changed: 3192 additions & 92 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

test/fixtures/wpt/fetch/metadata/generated/audioworklet.https.sub.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,32 @@
266266
assert_not_own_property(headers, 'sec-fetch-user');
267267
});
268268
}, 'sec-fetch-user');
269+
270+
promise_test((t) => {
271+
const key = '{{uuid()}}';
272+
273+
return induceRequest(
274+
makeRequestURL(key, ['httpsCrossSite'], {mime: 'text/javascript'}),
275+
t
276+
)
277+
.then(() => retrieve(key))
278+
.then((headers) => {
279+
assert_not_own_property(headers, 'sec-fetch-storage-access');
280+
});
281+
}, 'sec-fetch-storage-access - Cross-site');
282+
283+
promise_test((t) => {
284+
const key = '{{uuid()}}';
285+
286+
return induceRequest(
287+
makeRequestURL(key, ['httpsSameSite'], {mime: 'text/javascript'}),
288+
t
289+
)
290+
.then(() => retrieve(key))
291+
.then((headers) => {
292+
assert_not_own_property(headers, 'sec-fetch-storage-access');
293+
});
294+
}, 'sec-fetch-storage-access - Same site');
269295
</script>
270296
</body>
271297
</html>

test/fixtures/wpt/fetch/metadata/generated/css-font-face.https.sub.tentative.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,26 @@
225225
assert_not_own_property(headers, 'sec-fetch-user');
226226
});
227227
}, 'sec-fetch-user');
228+
229+
promise_test((t) => {
230+
const key = '{{uuid()}}';
231+
232+
return induceRequest(t, makeRequestURL(key, ['httpsCrossSite']))
233+
.then(() => retrieve(key))
234+
.then((headers) => {
235+
assert_not_own_property(headers, 'sec-fetch-storage-access');
236+
});
237+
}, 'sec-fetch-storage-access - Cross-site');
238+
239+
promise_test((t) => {
240+
const key = '{{uuid()}}';
241+
242+
return induceRequest(t, makeRequestURL(key, ['httpsSameSite']))
243+
.then(() => retrieve(key))
244+
.then((headers) => {
245+
assert_not_own_property(headers, 'sec-fetch-storage-access');
246+
});
247+
}, 'sec-fetch-storage-access - Same site');
228248
</script>
229249
</body>
230250
</html>

test/fixtures/wpt/fetch/metadata/generated/css-font-face.sub.tentative.html

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,36 @@
160160
});
161161
}, 'sec-fetch-user - Not sent to non-trustworthy cross-site destination');
162162

163+
promise_test((t) => {
164+
const key = '{{uuid()}}';
165+
166+
return induceRequest(t, makeRequestURL(key, ['httpOrigin']))
167+
.then(() => retrieve(key))
168+
.then((headers) => {
169+
assert_not_own_property(headers, 'sec-fetch-storage-access');
170+
});
171+
}, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination');
172+
173+
promise_test((t) => {
174+
const key = '{{uuid()}}';
175+
176+
return induceRequest(t, makeRequestURL(key, ['httpSameSite']))
177+
.then(() => retrieve(key))
178+
.then((headers) => {
179+
assert_not_own_property(headers, 'sec-fetch-storage-access');
180+
});
181+
}, 'sec-fetch-storage-access - Not sent to non-trustworthy same-site destination');
182+
183+
promise_test((t) => {
184+
const key = '{{uuid()}}';
185+
186+
return induceRequest(t, makeRequestURL(key, ['httpCrossSite']))
187+
.then(() => retrieve(key))
188+
.then((headers) => {
189+
assert_not_own_property(headers, 'sec-fetch-storage-access');
190+
});
191+
}, 'sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination');
192+
163193
promise_test((t) => {
164194
const key = '{{uuid()}}';
165195

test/fixtures/wpt/fetch/metadata/generated/css-images.https.sub.tentative.html

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,6 +1374,151 @@
13741374
.then(t.step_func_done(), t.unreached_func());
13751375
}, 'list-style-image sec-fetch-user');
13761376

1377+
async_test((t) => {
1378+
const key = '{{uuid()}}';
1379+
const url = makeRequestURL(key, ['httpsCrossSite']);
1380+
1381+
declarations.push(`background-image: url("${url}");`);
1382+
1383+
whenIframeReady
1384+
.then(() => retrieve(key))
1385+
.then((headers) => {
1386+
assert_own_property(headers, 'sec-fetch-storage-access');
1387+
assert_equals(headers['sec-fetch-storage-access'], 'none');
1388+
})
1389+
.then(t.step_func_done(), (error) => t.unreached_func());
1390+
}, 'background-image sec-fetch-storage-access - Cross-site');
1391+
1392+
async_test((t) => {
1393+
const key = '{{uuid()}}';
1394+
const url = makeRequestURL(key, ['httpsCrossSite']);
1395+
1396+
declarations.push(`border-image: url("${url}");`);
1397+
1398+
whenIframeReady
1399+
.then(() => retrieve(key))
1400+
.then((headers) => {
1401+
assert_own_property(headers, 'sec-fetch-storage-access');
1402+
assert_array_equals(headers['sec-fetch-storage-access'], ['none']);
1403+
})
1404+
.then(t.step_func_done(), t.unreached_func());
1405+
}, 'border-image sec-fetch-storage-access - Cross-site');
1406+
1407+
async_test((t) => {
1408+
const key = '{{uuid()}}';
1409+
const url = makeRequestURL(key, ['httpsCrossSite']);
1410+
1411+
declarations.push(`content: url("${url}");`);
1412+
1413+
whenIframeReady
1414+
.then(() => retrieve(key))
1415+
.then((headers) => {
1416+
assert_own_property(headers, 'sec-fetch-storage-access');
1417+
assert_array_equals(headers['sec-fetch-storage-access'], ['none']);
1418+
})
1419+
.then(t.step_func_done(), t.unreached_func());
1420+
}, 'content sec-fetch-storage-access - Cross-site');
1421+
1422+
async_test((t) => {
1423+
const key = '{{uuid()}}';
1424+
const url = makeRequestURL(key, ['httpsCrossSite']);
1425+
1426+
declarations.push(`cursor: url("${url}"), auto;`);
1427+
1428+
whenIframeReady
1429+
.then(() => retrieve(key))
1430+
.then((headers) => {
1431+
assert_own_property(headers, 'sec-fetch-storage-access');
1432+
assert_array_equals(headers['sec-fetch-storage-access'], ['none']);
1433+
})
1434+
.then(t.step_func_done(), t.unreached_func());
1435+
}, 'cursor sec-fetch-storage-access - Cross-site');
1436+
1437+
async_test((t) => {
1438+
const key = '{{uuid()}}';
1439+
const url = makeRequestURL(key, ['httpsCrossSite']);
1440+
1441+
declarations.push(`list-style-image: url("${url}");`);
1442+
1443+
whenIframeReady
1444+
.then(() => retrieve(key))
1445+
.then((headers) => {
1446+
assert_own_property(headers, 'sec-fetch-storage-access');
1447+
assert_array_equals(headers['sec-fetch-storage-access'], ['none']);
1448+
})
1449+
.then(t.step_func_done(), t.unreached_func());
1450+
}, 'list-style-image sec-fetch-storage-access - Cross-site');
1451+
1452+
async_test((t) => {
1453+
const key = '{{uuid()}}';
1454+
const url = makeRequestURL(key, ['httpsSameSite']);
1455+
1456+
declarations.push(`background-image: url("${url}");`);
1457+
1458+
whenIframeReady
1459+
.then(() => retrieve(key))
1460+
.then((headers) => {
1461+
assert_not_own_property(headers, 'sec-fetch-storage-access');
1462+
})
1463+
.then(t.step_func_done(), (error) => t.unreached_func());
1464+
}, 'background-image sec-fetch-storage-access - Same site');
1465+
1466+
async_test((t) => {
1467+
const key = '{{uuid()}}';
1468+
const url = makeRequestURL(key, ['httpsSameSite']);
1469+
1470+
declarations.push(`border-image: url("${url}");`);
1471+
1472+
whenIframeReady
1473+
.then(() => retrieve(key))
1474+
.then((headers) => {
1475+
assert_not_own_property(headers, 'sec-fetch-storage-access');
1476+
})
1477+
.then(t.step_func_done(), t.unreached_func());
1478+
}, 'border-image sec-fetch-storage-access - Same site');
1479+
1480+
async_test((t) => {
1481+
const key = '{{uuid()}}';
1482+
const url = makeRequestURL(key, ['httpsSameSite']);
1483+
1484+
declarations.push(`content: url("${url}");`);
1485+
1486+
whenIframeReady
1487+
.then(() => retrieve(key))
1488+
.then((headers) => {
1489+
assert_not_own_property(headers, 'sec-fetch-storage-access');
1490+
})
1491+
.then(t.step_func_done(), t.unreached_func());
1492+
}, 'content sec-fetch-storage-access - Same site');
1493+
1494+
async_test((t) => {
1495+
const key = '{{uuid()}}';
1496+
const url = makeRequestURL(key, ['httpsSameSite']);
1497+
1498+
declarations.push(`cursor: url("${url}"), auto;`);
1499+
1500+
whenIframeReady
1501+
.then(() => retrieve(key))
1502+
.then((headers) => {
1503+
assert_not_own_property(headers, 'sec-fetch-storage-access');
1504+
})
1505+
.then(t.step_func_done(), t.unreached_func());
1506+
}, 'cursor sec-fetch-storage-access - Same site');
1507+
1508+
async_test((t) => {
1509+
const key = '{{uuid()}}';
1510+
const url = makeRequestURL(key, ['httpsSameSite']);
1511+
1512+
declarations.push(`list-style-image: url("${url}");`);
1513+
1514+
whenIframeReady
1515+
.then(() => retrieve(key))
1516+
.then((headers) => {
1517+
assert_not_own_property(headers, 'sec-fetch-storage-access');
1518+
})
1519+
.then(t.step_func_done(), t.unreached_func());
1520+
}, 'list-style-image sec-fetch-storage-access - Same site');
1521+
13771522
iframe.srcdoc = declarations.map((declaration, index) => `
13781523
<style>.el${index} { ${declaration} }</style><div class="el${index}"></div>`
13791524
).join('');

0 commit comments

Comments
 (0)