Automatic update from web-platform-tests Shared Storage: Align createWorklet's default data origin w/addModule's We align the default data origin for createWorklet with that of addModule to be the invoking context's origin. We also hook up the dataOrigin option in createWorklet's options dictionary, so that the script origin can be manually specified to be used as the data origin instead. See https://github.com/WICG/shared-storage/pull/158, https://github.com/WICG/shared-storage/pull/161, and https://groups.google.com/a/chromium.org/g/blink-dev/c/YZ4XGewKVuk. Bug: 353738488 Change-Id: I3578e48f14c9fb1005211b94889ce01ef209162c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5716903 Reviewed-by: Yao Xiao <yaoxia@chromium.org> Commit-Queue: Cammie Smith Barnes <cammie@chromium.org> Cr-Commit-Position: refs/heads/main@{#1333189} -- wpt-commits: 71b107815a391a469b081cbb9242e1723ede50fb wpt-pr: 47296
42 lines
1.5 KiB
HTML
42 lines
1.5 KiB
HTML
<!doctype html>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="/common/utils.js"></script>
|
|
<script src="/shared-storage/resources/util.js"></script>
|
|
<script src="/private-aggregation/resources/util.js"></script>
|
|
<script src="/fenced-frame/resources/utils.js"></script>
|
|
|
|
<body>
|
|
<script>
|
|
'use strict';
|
|
|
|
const paa_data = {
|
|
enableDebugMode: true,
|
|
contributions: [{bucket: 1n, value: 2}]
|
|
};
|
|
|
|
const cross_origin = 'https://{{domains[www]}}:{{ports[https][0]}}';
|
|
|
|
promise_test(async () => {
|
|
await VerifyContributeToHistogram(paa_data);
|
|
}, 'In a page with "private-aggregation=(self)" permissions policy, ' +
|
|
'initialize the worklet via sharedStorage.worklet.addModule(), and then ' +
|
|
'execute contributeToHistogram() inside the worklet');
|
|
|
|
promise_test(async () => {
|
|
await CreateWorkletAndVerifyContributeToHistogram(
|
|
/*shared_storage_origin=*/'', paa_data);
|
|
}, 'In a page with "private-aggregation=(self)" permissions policy, ' +
|
|
'createWorklet() with same-origin script, and then execute ' +
|
|
'contributeToHistogram() inside the worklet');
|
|
|
|
promise_test(async () => {
|
|
await CreateWorkletAndVerifyContributeToHistogram(
|
|
/*shared_storage_origin=*/cross_origin, paa_data, /*expected_error=*/true);
|
|
}, 'In a page with "private-aggregation=(self)" permissions policy, ' +
|
|
'createWorklet() with cross-origin script and script data origin, and then '
|
|
+ 'execute contributeToHistogram() inside the worklet');
|
|
|
|
</script>
|
|
</body>
|