Update web-platform-tests to revision 2d42384cf21efd71843295d319c1bab85b3acf4a

This commit is contained in:
WPT Sync Bot 2019-01-11 20:32:19 -05:00
parent f2b224d610
commit e851ef0cd2
1014 changed files with 5653 additions and 1590 deletions

View file

@ -24,7 +24,6 @@ function openWindowAndExpectResult(windowURL, scriptURL, type, expectation) {
function runContentSecurityPolicyTests(workletType) {
runSrcTests(workletType);
runMixedContentTests(workletType);
runUpgradeInsecureRequestsTests(workletType);
}
// script-src and worker-src tests.
@ -146,41 +145,3 @@ function runMixedContentTests(workletType) {
scriptConfig.message + ' should be blocked because of mixed contents.');
}
}
// upgrade-insecure-requests tests.
function runUpgradeInsecureRequestsTests(workletType) {
// |kToBeUpgradedURL| is expected to upgraded/loaded successfully with
// upgrade-insecure-requests is specified.
// This relies on some unintuitive cleverness due to WPT's test setup:
// 'Upgrade-Insecure-Requests' does not upgrade the port number, so we use
// URLs in the form `http://[host]:[https-port]`. If the upgrade fails, the
// load will fail, as we don't serve HTTP over the secure port.
const kHost = get_host_info().ORIGINAL_HOST;
const kPort = get_host_info().HTTPS_PORT;
const kToBeUpgradedURL =
`http://${kHost}:${kPort}/worklets/resources/empty-worklet-script-with-cors-header.js`;
const kScriptConfigs = [
{URL: kToBeUpgradedURL,
message: 'An insecure-origin worklet'},
{URL: '/common/redirect.py?location=' +
encodeURIComponent(kToBeUpgradedURL),
message: 'An insecure-origin-redirected worklet'},
{URL: 'import-insecure-origin-empty-worklet-script.sub.js',
message: 'A same-origin worklet importing an insecure-origin script'},
{URL: 'import-insecure-origin-redirected-empty-worklet-script.sub.js',
message: 'A same-origin worklet ' +
'importing an insecure-origin-redirected script'}
];
for (const scriptConfig of kScriptConfigs) {
promise_test(t => {
const kWindowURL =
'resources/addmodule-window.html?pipe=header(' +
'Content-Security-Policy, upgrade-insecure-requests)';
return openWindowAndExpectResult(
kWindowURL, scriptConfig.URL, workletType, 'RESOLVED');
},
scriptConfig.message +
' should not be blocked because of upgrade-insecure-requests.');
}
}