Bug 1619281 [wpt PR 22039] - Update worklet referrer tests to match spec PR, a=testonly

Automatic update from web-platform-tests
Update worklet referrer tests to match spec PR (#22039)

--

wpt-commits: 4cec5596c806088cd8f1781bdaab1d10abb72394
wpt-pr: 22039
This commit is contained in:
Dominic Farolino 2020-03-12 12:12:52 +00:00 коммит произвёл moz-wptsync-bot
Родитель df9316abbb
Коммит 5d638c20a9
2 изменённых файлов: 5 добавлений и 3 удалений

Просмотреть файл

@ -188,7 +188,7 @@ function runReferrerTests(workletType) {
scriptOrigins: { topLevel: 'remote',
descendant: 'same' } });
}, 'Importing a same-origin script from a remote-origin worklet script ' +
'that has "same-origin" referrer policy should send referrer.');
'that has "same-origin" referrer policy should not send referrer.');
promise_test(() => {
return runReferrerTest({ workletType: workletType,
@ -197,7 +197,7 @@ function runReferrerTests(workletType) {
scriptOrigins: { topLevel: 'remote',
descendant: 'remote' } });
}, 'Importing a remote-origin script from a remote-origin worklet script ' +
'that has "same-origin" referrer policy should not send referrer.');
'that has "same-origin" referrer policy should send referrer.');
// TODO(domfarolino): Add tests for more referrer policies.
}

Просмотреть файл

@ -51,8 +51,10 @@ function createScriptURLForDecendant(scriptOrigins) {
function isDestinationCrossOrigin(fetchType, scriptOrigins) {
if (fetchType === 'top-level')
return scriptOrigins.topLevel === 'remote';
// Compute a descendant's cross-origin-ness relative to the top-level script.
if (fetchType === 'descendant')
return scriptOrigins.descendant === 'remote';
return scriptOrigins.descendant !== scriptOrigins.topLevel;
assert_unreached('fetchType has an invalid value.');
}