Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Update WPT #3888

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,32 @@
assert_not_own_property(headers, 'sec-fetch-user');
});
}, 'sec-fetch-user');

promise_test((t) => {
const key = '{{uuid()}}';

return induceRequest(
makeRequestURL(key, ['httpsCrossSite'], {mime: 'text/javascript'}),
t
)
.then(() => retrieve(key))
.then((headers) => {
assert_not_own_property(headers, 'sec-fetch-storage-access');
});
}, 'sec-fetch-storage-access - Cross-site');

promise_test((t) => {
const key = '{{uuid()}}';

return induceRequest(
makeRequestURL(key, ['httpsSameSite'], {mime: 'text/javascript'}),
t
)
.then(() => retrieve(key))
.then((headers) => {
assert_not_own_property(headers, 'sec-fetch-storage-access');
});
}, 'sec-fetch-storage-access - Same site');
</script>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,26 @@
assert_not_own_property(headers, 'sec-fetch-user');
});
}, 'sec-fetch-user');

promise_test((t) => {
const key = '{{uuid()}}';

return induceRequest(t, makeRequestURL(key, ['httpsCrossSite']))
.then(() => retrieve(key))
.then((headers) => {
assert_not_own_property(headers, 'sec-fetch-storage-access');
});
}, 'sec-fetch-storage-access - Cross-site');

promise_test((t) => {
const key = '{{uuid()}}';

return induceRequest(t, makeRequestURL(key, ['httpsSameSite']))
.then(() => retrieve(key))
.then((headers) => {
assert_not_own_property(headers, 'sec-fetch-storage-access');
});
}, 'sec-fetch-storage-access - Same site');
</script>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,36 @@
});
}, 'sec-fetch-user - Not sent to non-trustworthy cross-site destination');

promise_test((t) => {
const key = '{{uuid()}}';

return induceRequest(t, makeRequestURL(key, ['httpOrigin']))
.then(() => retrieve(key))
.then((headers) => {
assert_not_own_property(headers, 'sec-fetch-storage-access');
});
}, 'sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination');

promise_test((t) => {
const key = '{{uuid()}}';

return induceRequest(t, makeRequestURL(key, ['httpSameSite']))
.then(() => retrieve(key))
.then((headers) => {
assert_not_own_property(headers, 'sec-fetch-storage-access');
});
}, 'sec-fetch-storage-access - Not sent to non-trustworthy same-site destination');

promise_test((t) => {
const key = '{{uuid()}}';

return induceRequest(t, makeRequestURL(key, ['httpCrossSite']))
.then(() => retrieve(key))
.then((headers) => {
assert_not_own_property(headers, 'sec-fetch-storage-access');
});
}, 'sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination');

promise_test((t) => {
const key = '{{uuid()}}';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1374,6 +1374,151 @@
.then(t.step_func_done(), t.unreached_func());
}, 'list-style-image sec-fetch-user');

async_test((t) => {
const key = '{{uuid()}}';
const url = makeRequestURL(key, ['httpsCrossSite']);

declarations.push(`background-image: url("${url}");`);

whenIframeReady
.then(() => retrieve(key))
.then((headers) => {
assert_own_property(headers, 'sec-fetch-storage-access');
assert_equals(headers['sec-fetch-storage-access'], 'none');
})
.then(t.step_func_done(), (error) => t.unreached_func());
}, 'background-image sec-fetch-storage-access - Cross-site');

async_test((t) => {
const key = '{{uuid()}}';
const url = makeRequestURL(key, ['httpsCrossSite']);

declarations.push(`border-image: url("${url}");`);

whenIframeReady
.then(() => retrieve(key))
.then((headers) => {
assert_own_property(headers, 'sec-fetch-storage-access');
assert_array_equals(headers['sec-fetch-storage-access'], ['none']);
})
.then(t.step_func_done(), t.unreached_func());
}, 'border-image sec-fetch-storage-access - Cross-site');

async_test((t) => {
const key = '{{uuid()}}';
const url = makeRequestURL(key, ['httpsCrossSite']);

declarations.push(`content: url("${url}");`);

whenIframeReady
.then(() => retrieve(key))
.then((headers) => {
assert_own_property(headers, 'sec-fetch-storage-access');
assert_array_equals(headers['sec-fetch-storage-access'], ['none']);
})
.then(t.step_func_done(), t.unreached_func());
}, 'content sec-fetch-storage-access - Cross-site');

async_test((t) => {
const key = '{{uuid()}}';
const url = makeRequestURL(key, ['httpsCrossSite']);

declarations.push(`cursor: url("${url}"), auto;`);

whenIframeReady
.then(() => retrieve(key))
.then((headers) => {
assert_own_property(headers, 'sec-fetch-storage-access');
assert_array_equals(headers['sec-fetch-storage-access'], ['none']);
})
.then(t.step_func_done(), t.unreached_func());
}, 'cursor sec-fetch-storage-access - Cross-site');

async_test((t) => {
const key = '{{uuid()}}';
const url = makeRequestURL(key, ['httpsCrossSite']);

declarations.push(`list-style-image: url("${url}");`);

whenIframeReady
.then(() => retrieve(key))
.then((headers) => {
assert_own_property(headers, 'sec-fetch-storage-access');
assert_array_equals(headers['sec-fetch-storage-access'], ['none']);
})
.then(t.step_func_done(), t.unreached_func());
}, 'list-style-image sec-fetch-storage-access - Cross-site');

async_test((t) => {
const key = '{{uuid()}}';
const url = makeRequestURL(key, ['httpsSameSite']);

declarations.push(`background-image: url("${url}");`);

whenIframeReady
.then(() => retrieve(key))
.then((headers) => {
assert_not_own_property(headers, 'sec-fetch-storage-access');
})
.then(t.step_func_done(), (error) => t.unreached_func());
}, 'background-image sec-fetch-storage-access - Same site');

async_test((t) => {
const key = '{{uuid()}}';
const url = makeRequestURL(key, ['httpsSameSite']);

declarations.push(`border-image: url("${url}");`);

whenIframeReady
.then(() => retrieve(key))
.then((headers) => {
assert_not_own_property(headers, 'sec-fetch-storage-access');
})
.then(t.step_func_done(), t.unreached_func());
}, 'border-image sec-fetch-storage-access - Same site');

async_test((t) => {
const key = '{{uuid()}}';
const url = makeRequestURL(key, ['httpsSameSite']);

declarations.push(`content: url("${url}");`);

whenIframeReady
.then(() => retrieve(key))
.then((headers) => {
assert_not_own_property(headers, 'sec-fetch-storage-access');
})
.then(t.step_func_done(), t.unreached_func());
}, 'content sec-fetch-storage-access - Same site');

async_test((t) => {
const key = '{{uuid()}}';
const url = makeRequestURL(key, ['httpsSameSite']);

declarations.push(`cursor: url("${url}"), auto;`);

whenIframeReady
.then(() => retrieve(key))
.then((headers) => {
assert_not_own_property(headers, 'sec-fetch-storage-access');
})
.then(t.step_func_done(), t.unreached_func());
}, 'cursor sec-fetch-storage-access - Same site');

async_test((t) => {
const key = '{{uuid()}}';
const url = makeRequestURL(key, ['httpsSameSite']);

declarations.push(`list-style-image: url("${url}");`);

whenIframeReady
.then(() => retrieve(key))
.then((headers) => {
assert_not_own_property(headers, 'sec-fetch-storage-access');
})
.then(t.step_func_done(), t.unreached_func());
}, 'list-style-image sec-fetch-storage-access - Same site');

iframe.srcdoc = declarations.map((declaration, index) => `
<style>.el${index} { ${declaration} }</style><div class="el${index}"></div>`
).join('');
Expand Down
Loading
Loading