-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shared Storage: Add non-live dataOption to createWorklet for use counter
We proposed a breaking change to sharedStorage.createWorklet() in WICG/shared-storage#158. We add a use counter for how frequently createWorklet is called in a non-forward-compatible way according to the proposal (i.e. with a cross-origin script but without the option dataOrigin: "script- origin"). This will help us determine what the impact of this change would be. Bug: 348445878 Change-Id: I3b882a9ec859beb5265ba31d3169fb5e1239cac4
- Loading branch information
1 parent
9228c24
commit cf9cea1
Showing
3 changed files
with
112 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
shared-storage/cross-origin-create-worklet-data-origin-option.tentative.https.sub.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!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="/shared-storage/resources/util.sub.js"></script> | ||
<script src="/fenced-frame/resources/utils.js"></script> | ||
|
||
<body> | ||
<script> | ||
'use strict'; | ||
|
||
async_test(t => { | ||
testCreateWorkletWithDataOption( | ||
t, "context-origin", "key0", "value0", /*is_same_origin_script=*/false, | ||
/*expect_success=*/true); | ||
}, 'For cross-origin createWorklet with dataOrigin option "context-origin", ' | ||
+ 'there is no error.'); | ||
|
||
async_test(t => { | ||
testCreateWorkletWithDataOption( | ||
t, "script-origin", "key0", "value0", /*is_same_origin_script=*/false, | ||
/*expect_success=*/true); | ||
}, 'For cross-origin createWorklet with dataOrigin option "script-origin", ' | ||
+ 'there is no error.'); | ||
|
||
async_test(t => { | ||
testCreateWorkletWithDataOption( | ||
t, "invalid", "key0", "value0", /*is_same_origin_script=*/false, | ||
/*expect_success=*/false); | ||
}, 'For cross-origin createWorklet with dataOrigin option "invalid", ' | ||
+ 'there is a TypeError thrown.'); | ||
|
||
</script> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
shared-storage/same-origin-create-worklet-data-origin-option.tentative.https.sub.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!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="/shared-storage/resources/util.sub.js"></script> | ||
<script src="/fenced-frame/resources/utils.js"></script> | ||
|
||
<body> | ||
<script> | ||
'use strict'; | ||
|
||
async_test(t => { | ||
testCreateWorkletWithDataOption( | ||
t, "context-origin", "key0", "value0", /*is_same_origin_script=*/true, | ||
/*expect_success=*/true); | ||
}, 'For same-origin createWorklet with dataOrigin option "context-origin", ' | ||
+ 'there is no error.'); | ||
|
||
async_test(t => { | ||
testCreateWorkletWithDataOption( | ||
t, "script-origin", "key0", "value0", /*is_same_origin_script=*/true, | ||
/*expect_success=*/true); | ||
}, 'For same-origin createWorklet with dataOrigin option "script-origin", ' | ||
+ 'there is no error.'); | ||
|
||
async_test(t => { | ||
testCreateWorkletWithDataOption( | ||
t, "invalid", "key0", "value0", /*is_same_origin_script=*/true, | ||
/*expect_success=*/false); | ||
}, 'For same-origin createWorklet with dataOrigin option "invalid", ' | ||
+ 'there is a TypeError thrown.'); | ||
|
||
</script> | ||
</body> |