Commit 1f146124 authored by Hiroshige Hayashizaki's avatar Hiroshige Hayashizaki Committed by Commit Bot

[WPT/common/security-features] Remove {mixed-content,referrer-policy}-test-case.sub.js

This CL merges getSubresourceOrigin() from *test-case.js into `common.sub.js`.

This removes the dependency from `common.sub.js` to *test-case.js.
Previously, some manually-written tests includes
`<script src=referrer-policy-test-case.sub.js>`
because of this dependency, and now we can remove such `<script>`s.

After then, no scripts uses {mixed-content,referrer-policy}-test-case.sub.js
and this CL removes them.

Bug: 906850
Change-Id: I93acf8477037276e0a0289afabbbdc7a484734f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1787166
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: default avatarKenichi Ishibashi <bashi@chromium.org>
Reviewed-by: default avatarHiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#694150}
parent bae8f7b8
......@@ -956,6 +956,52 @@ for (const workletType of ['animation', 'audio', 'layout', 'paint']) {
/common/security-features/subresource/subresource.py for valid values.
*/
/**
Construct subresource (and related) origin.
@param {string} originType
@returns {object} the origin of the subresource.
*/
function getSubresourceOrigin(originType) {
const httpProtocol = "http";
const httpsProtocol = "https";
const wsProtocol = "ws";
const wssProtocol = "wss";
const sameOriginHost = "{{host}}";
const crossOriginHost = "{{domains[www1]}}";
// These values can evaluate to either empty strings or a ":port" string.
const httpPort = getNormalizedPort(parseInt("{{ports[http][0]}}", 10));
const httpsPort = getNormalizedPort(parseInt("{{ports[https][0]}}", 10));
const wsPort = getNormalizedPort(parseInt("{{ports[ws][0]}}", 10));
const wssPort = getNormalizedPort(parseInt("{{ports[wss][0]}}", 10));
/**
@typedef OriginType
@type {string}
Represents the origin of the subresource request URL.
The keys of `originMap` below are the valid values.
Note that there can be redirects from the specified origin
(see RedirectionType), and thus the origin of the subresource
response URL might be different from what is specified by OriginType.
*/
const originMap = {
"same-https": httpsProtocol + "://" + sameOriginHost + httpsPort,
"same-http": httpProtocol + "://" + sameOriginHost + httpPort,
"cross-https": httpsProtocol + "://" + crossOriginHost + httpsPort,
"cross-http": httpProtocol + "://" + crossOriginHost + httpPort,
"same-wss": wssProtocol + "://" + sameOriginHost + wssPort,
"same-ws": wsProtocol + "://" + sameOriginHost + wsPort,
"cross-wss": wssProtocol + "://" + crossOriginHost + wssPort,
"cross-ws": wsProtocol + "://" + crossOriginHost + wsPort,
};
return originMap[originType];
}
/**
Construct subresource (and related) URLs.
......
/**
* @fileoverview Test case for mixed-content in Web Platform Tests.
* @author burnik@google.com (Kristijan Burnik)
*/
// TODO: This function is currently placed and duplicated at:
// - mixed-content/generic/mixed-content-test-case.js
// - referrer-policy/generic/referrer-policy-test-case.js
// but should be moved to /common/security-features/resources/common.js.
function getSubresourceOrigin(originType) {
const httpProtocol = "http";
const httpsProtocol = "https";
const wsProtocol = "ws";
const wssProtocol = "wss";
const sameOriginHost = "{{host}}";
const crossOriginHost = "{{domains[www1]}}";
// These values can evaluate to either empty strings or a ":port" string.
const httpPort = getNormalizedPort(parseInt("{{ports[http][0]}}", 10));
const httpsPort = getNormalizedPort(parseInt("{{ports[https][0]}}", 10));
const wsPort = getNormalizedPort(parseInt("{{ports[ws][0]}}", 10));
const wssPort = getNormalizedPort(parseInt("{{ports[wss][0]}}", 10));
/**
@typedef OriginType
@type {string}
Represents the origin of the subresource request URL.
The keys of `originMap` below are the valid values.
Note that there can be redirects from the specified origin
(see RedirectionType), and thus the origin of the subresource
response URL might be different from what is specified by OriginType.
*/
const originMap = {
"same-https": httpsProtocol + "://" + sameOriginHost + httpsPort,
"same-http": httpProtocol + "://" + sameOriginHost + httpPort,
"cross-https": httpsProtocol + "://" + crossOriginHost + httpsPort,
"cross-http": httpProtocol + "://" + crossOriginHost + httpPort,
"same-wss": wssProtocol + "://" + sameOriginHost + wssPort,
"same-ws": wsProtocol + "://" + sameOriginHost + wsPort,
"cross-wss": wssProtocol + "://" + crossOriginHost + wssPort,
"cross-ws": wsProtocol + "://" + crossOriginHost + wsPort,
};
return originMap[originType];
}
/**
* MixedContentTestCase exercises all the tests for checking browser behavior
* when resources regarded as mixed-content are requested. A single run covers
* only a single scenario.
* @param {object} scenario A JSON describing the test arrangement and
* expectation(s). Refer to /mixed-content/spec.src.json for details.
* @param {string} description The test scenario verbose description.
* @param {SanityChecker} sanityChecker Instance of an object used to check the
* running scenario. Useful in debug mode. See ./sanity-checker.js.
* Run {@code ./tools/generate.py -h} for info on test generating modes.
* @return {object} Object wrapping the start method used to run the test.
*/
function MixedContentTestCase(scenario, description, sanityChecker) {
sanityChecker.checkScenario(scenario, subresourceMap);
let sourceContextList = [];
let subresourceType = scenario.subresource;
if (subresourceType === 'classic-data-worker-fetch') {
// Currently 'classic-data-worker-fetch' (fetch API from inside classic
// data: worker) is handled as a kind of subresource request
// on the genarator side, but should be processed using the combination of
// SourceContext list (classic data: worker) + Subresource (fetch API)
// on the JavaScript side.
// We bridge this inconsistency here, and will later pass these information
// directly from the generated tests and remove this conversion here.
subresourceType = 'fetch-request';
sourceContextList = [{sourceContextType: 'worker-classic-data'}];
}
const originTypeConversion = {
"same-host-https": "same-https",
"same-host-http": "same-http",
"cross-origin-https": "cross-https",
"cross-origin-http": "cross-http",
"same-host-wss": "same-wss",
"same-host-ws": "same-ws",
"cross-origin-wss": "cross-wss",
"cross-origin-ws": "cross-ws",
};
const urls = getRequestURLs(subresourceType,
originTypeConversion[scenario.origin],
scenario.redirection);
const checkResult = _ => {
// Send request to check if the key has been torn down.
return xhrRequest(urls.assertUrl)
.then(assertResult => {
// Now check if the value has been torn down. If it's still there,
// we have blocked the request to mixed-content.
assert_equals(assertResult.status, scenario.expectation,
"The resource request should be '" + scenario.expectation + "'.");
});
};
function runTest() {
/** @type {Subresource} */
const subresource = {
subresourceType: subresourceType,
url: urls.testUrl,
policyDeliveries: []
};
promise_test(() => {
return xhrRequest(urls.announceUrl)
// Send out the real resource request.
// This should tear down the key if it's not blocked.
.then(_ => invokeRequest(subresource, sourceContextList))
// We check the key state, regardless of whether the main request
// succeeded or failed.
.then(checkResult, checkResult);
}, description);
} // runTest
return {start: runTest};
} // MixedContentTestCase
......@@ -3,50 +3,6 @@
* @author burnik@google.com (Kristijan Burnik)
*/
// TODO: This function is currently placed and duplicated at:
// - mixed-content/generic/mixed-content-test-case.js
// - referrer-policy/generic/referrer-policy-test-case.js
// but should be moved to /common/security-features/resources/common.js.
function getSubresourceOrigin(originType) {
const httpProtocol = "http";
const httpsProtocol = "https";
const wsProtocol = "ws";
const wssProtocol = "wss";
const sameOriginHost = "{{host}}";
const crossOriginHost = "{{domains[www1]}}";
// These values can evaluate to either empty strings or a ":port" string.
const httpPort = getNormalizedPort(parseInt("{{ports[http][0]}}", 10));
const httpsPort = getNormalizedPort(parseInt("{{ports[https][0]}}", 10));
const wsPort = getNormalizedPort(parseInt("{{ports[ws][0]}}", 10));
const wssPort = getNormalizedPort(parseInt("{{ports[wss][0]}}", 10));
/**
@typedef OriginType
@type {string}
Represents the origin of the subresource request URL.
The keys of `originMap` below are the valid values.
Note that there can be redirects from the specified origin
(see RedirectionType), and thus the origin of the subresource
response URL might be different from what is specified by OriginType.
*/
const originMap = {
"same-https": httpsProtocol + "://" + sameOriginHost + httpsPort,
"same-http": httpProtocol + "://" + sameOriginHost + httpPort,
"cross-https": httpsProtocol + "://" + crossOriginHost + httpsPort,
"cross-http": httpProtocol + "://" + crossOriginHost + httpPort,
"same-wss": wssProtocol + "://" + sameOriginHost + wssPort,
"same-ws": wsProtocol + "://" + sameOriginHost + wsPort,
"cross-wss": wssProtocol + "://" + crossOriginHost + wssPort,
"cross-ws": wsProtocol + "://" + crossOriginHost + wsPort,
};
return originMap[originType];
}
/**
* MixedContentTestCase exercises all the tests for checking browser behavior
* when resources regarded as mixed-content are requested. A single run covers
......
......@@ -7,7 +7,6 @@
<script src="/common/utils.js"></script>
<!-- Common global functions for referrer-policy tests. -->
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
<meta name="referrer" content="origin">
</head>
<body>
......
......@@ -7,7 +7,6 @@
<script src="/common/utils.js"></script>
<!-- Common global functions for referrer-policy tests. -->
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
<meta name="referrer" content="never">
</head>
<body>
......
......@@ -7,7 +7,6 @@
<script src="/common/utils.js"></script>
<!-- Common global functions for referrer-policy tests. -->
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
<meta name="referrer" content="origin">
</head>
<body>
......
......@@ -7,7 +7,6 @@
<script src="/common/utils.js"></script>
<!-- Common global functions for referrer-policy tests. -->
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
<meta name="referrer" content="never">
</head>
<body>
......
......@@ -7,7 +7,6 @@
<script src="/common/utils.js"></script>
<!-- Common global functions for referrer-policy tests. -->
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
<meta name="referrer" content="never">
</head>
<body>
......
......@@ -7,7 +7,6 @@
<script src="/common/utils.js"></script>
<!-- Common global functions for referrer-policy tests. -->
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
<meta name="referrer" content="origin">
</head>
<body>
......
......@@ -7,7 +7,6 @@
<script src="/common/utils.js"></script>
<!-- Common global functions for referrer-policy tests. -->
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
<meta name="referrer" content="origin">
</head>
<body>
......
......@@ -7,7 +7,6 @@
<script src="/common/utils.js"></script>
<!-- Common global functions for referrer-policy tests. -->
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
<meta name="referrer" content="never">
</head>
<body>
......
......@@ -7,7 +7,6 @@
<script src="/common/utils.js"></script>
<!-- Common global functions for referrer-policy tests. -->
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
<meta name="referrer" content="never">
</head>
<body>
......
......@@ -7,7 +7,6 @@
<script src="/common/utils.js"></script>
<!-- Common global functions for referrer-policy tests. -->
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
<meta name="referrer" content="never">
</head>
<body>
......
......@@ -7,7 +7,6 @@
<script src="/common/utils.js"></script>
<!-- Common global functions for referrer-policy tests. -->
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
<meta name="referrer" content="origin">
</head>
<body>
......
......@@ -7,7 +7,6 @@
<script src="/common/utils.js"></script>
<!-- Common global functions for referrer-policy tests. -->
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
<meta name="referrer" content="origin">
</head>
<body>
......
......@@ -7,7 +7,6 @@
<script src="/common/utils.js"></script>
<!-- Common global functions for referrer-policy tests. -->
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
<meta name="referrer" content="origin">
</head>
<body>
......
......@@ -7,7 +7,6 @@
<script src="/common/utils.js"></script>
<!-- Common global functions for referrer-policy tests. -->
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
<meta name="referrer" content="origin">
</head>
<body>
......
......@@ -7,7 +7,6 @@
<script src="/common/utils.js"></script>
<!-- Common global functions for referrer-policy tests. -->
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
<meta name="referrer" content="never">
</head>
<body>
......
......@@ -7,7 +7,6 @@
<script src="/common/utils.js"></script>
<!-- Common global functions for referrer-policy tests. -->
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
<!-- Helper functions for referrer-policy css tests. -->
<script src="/referrer-policy/css-integration/css-test-helper.js"></script>
<meta name="referrer" content="never">
......
......@@ -7,7 +7,6 @@
<script src="/common/utils.js"></script>
<!-- Common global functions for referrer-policy tests. -->
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
<!-- Helper functions for referrer-policy css tests. -->
<script src="/referrer-policy/css-integration/css-test-helper.js"></script>
<meta name="referrer" content="origin">
......
......@@ -7,7 +7,6 @@
<script src="/common/utils.js"></script>
<!-- Common global functions for referrer-policy tests. -->
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
<!-- Helper functions for referrer-policy css tests. -->
<script src="/referrer-policy/css-integration/css-test-helper.js"></script>
<meta name="referrer" content="origin">
......
......@@ -8,7 +8,6 @@
<script src="/common/utils.js"></script>
<!-- Common global functions for referrer-policy tests. -->
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
<!-- Helper functions for referrer-policy css tests. -->
<script src="/referrer-policy/css-integration/css-test-helper.js"></script>
<meta name="referrer" content="origin">
......
......@@ -8,7 +8,6 @@
<script src="/common/utils.js"></script>
<!-- Common global functions for referrer-policy tests. -->
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
<!-- Helper functions for referrer-policy css tests. -->
<script src="/referrer-policy/css-integration/css-test-helper.js"></script>
<meta name="referrer" content="origin">
......
......@@ -7,7 +7,6 @@
<script src="/resources/testharnessreport.js"></script>
<!-- Common global functions for referrer-policy tests. -->
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
<meta name="referrer" content="origin">
</head>
<body onload="runTest()">
......@@ -23,7 +22,6 @@
var iframe = document.createElement("iframe");
iframe.srcdoc =
`<script src = "/common/security-features/resources/common.sub.js"></` + `script>
<script src = "/referrer-policy/generic/referrer-policy-test-case.sub.js"></` + `script>
<script>
var urlPath = "/common/security-features/subresource/xhr.py";
var url = "${location.protocol}//www1.${location.hostname}:${location.port}" + urlPath;
......
......@@ -6,7 +6,6 @@
<script src="/resources/testharnessreport.js"></script>
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
</head>
<body>
<h1>Referrer Policy: multiple Referrer-Policy header and header values are allowed</h1>
......
......@@ -6,7 +6,6 @@
<script src="/resources/testharnessreport.js"></script>
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
</head>
<body>
<h1>Referrer Policy: multiple Referrer-Policy header values are allowed</h1>
......
......@@ -6,7 +6,6 @@
<script src="/resources/testharnessreport.js"></script>
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
</head>
<body>
<h1>Referrer Policy: multiple Referrer-Policy headers with one invalid</h1>
......
......@@ -6,7 +6,6 @@
<script src="/resources/testharnessreport.js"></script>
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
</head>
<body>
<h1>Referrer Policy: multiple Referrer-Policy headers with one invalid</h1>
......
......@@ -6,7 +6,6 @@
<script src="/resources/testharnessreport.js"></script>
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
</head>
<body>
<h1>Referrer Policy: multiple Referrer-Policy headers are allowed</h1>
......
......@@ -8,7 +8,6 @@
<script src="/resources/testharnessreport.js"></script>
<!-- Common global functions for referrer-policy tests. -->
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
</head>
<body>
<h1>Referrer Policy: A document with an opaque origin doesn't send referrers</h1>
......@@ -27,7 +26,6 @@
iframe.srcdoc = `
<meta name = "referrer" content = "always">
<script src = "/common/security-features/resources/common.sub.js"></` + `script>
<script src = "/referrer-policy/generic/referrer-policy-test-case.sub.js"></` + `script>
<script>
var urlPath = "/common/security-features/subresource/xhr.py";
var url = "${location.protocol}//www1.${location.hostname}:${location.port}" + urlPath;
......
......@@ -7,7 +7,6 @@
<script src="/resources/testharnessreport.js"></script>
<!-- Common global functions for referrer-policy tests. -->
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
</head>
<body>
<h1>Area Link messaging - cross-origin Area Link navigation</h1>
......
......@@ -7,7 +7,6 @@
<script src="/resources/testharnessreport.js"></script>
<!-- Common global functions for referrer-policy tests. -->
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
</head>
<body>
<h1>Fetch messaging - same-origin Fetch request</h1>
......
......@@ -7,7 +7,6 @@
<script src="/resources/testharnessreport.js"></script>
<!-- Common global functions for referrer-policy tests. -->
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
</head>
<body>
<h1>Iframe messaging - cross-origin iframe request</h1>
......
......@@ -7,7 +7,6 @@
<script src="/resources/testharnessreport.js"></script>
<!-- Common global functions for referrer-policy tests. -->
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
</head>
<body>
<h1>Image decoding - cross-origin image request</h1>
......
......@@ -7,7 +7,6 @@
<script src="/resources/testharnessreport.js"></script>
<!-- Common global functions for referrer-policy tests. -->
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
</head>
<body>
<h1>Link messaging - cross-origin Link navigation</h1>
......
......@@ -7,7 +7,6 @@
<script src="/resources/testharnessreport.js"></script>
<!-- Common global functions for referrer-policy tests. -->
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
</head>
<body>
<h1>Script messaging - cross-origin Script request</h1>
......
......@@ -7,7 +7,6 @@
<script src="/resources/testharnessreport.js"></script>
<!-- Common global functions for referrer-policy tests. -->
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
</head>
<body>
<h1>Worker messaging - same-origin Worker request</h1>
......
......@@ -7,7 +7,6 @@
<script src="/resources/testharnessreport.js"></script>
<!-- Common global functions for referrer-policy tests. -->
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
</head>
<body>
<h1>XHR messaging - cross-origin XHR request</h1>
......
// TODO: This function is currently placed and duplicated at:
// - mixed-content/generic/mixed-content-test-case.js
// - referrer-policy/generic/referrer-policy-test-case.sub.js
// but should be moved to /common/security-features/resources/common.js.
function getSubresourceOrigin(originType) {
const httpProtocol = "http";
const httpsProtocol = "https";
const wsProtocol = "ws";
const wssProtocol = "wss";
const sameOriginHost = "{{host}}";
const crossOriginHost = "{{domains[www1]}}";
// These values can evaluate to either empty strings or a ":port" string.
const httpPort = getNormalizedPort(parseInt("{{ports[http][0]}}", 10));
const httpsPort = getNormalizedPort(parseInt("{{ports[https][0]}}", 10));
const wsPort = getNormalizedPort(parseInt("{{ports[ws][0]}}", 10));
const wssPort = getNormalizedPort(parseInt("{{ports[wss][0]}}", 10));
/**
@typedef OriginType
@type {string}
Represents the origin of the subresource request URL.
The keys of `originMap` below are the valid values.
Note that there can be redirects from the specified origin
(see RedirectionType), and thus the origin of the subresource
response URL might be different from what is specified by OriginType.
*/
const originMap = {
"same-https": httpsProtocol + "://" + sameOriginHost + httpsPort,
"same-http": httpProtocol + "://" + sameOriginHost + httpPort,
"cross-https": httpsProtocol + "://" + crossOriginHost + httpsPort,
"cross-http": httpProtocol + "://" + crossOriginHost + httpPort,
"same-wss": wssProtocol + "://" + sameOriginHost + wssPort,
"same-ws": wsProtocol + "://" + sameOriginHost + wsPort,
"cross-wss": wssProtocol + "://" + crossOriginHost + wssPort,
"cross-ws": wsProtocol + "://" + crossOriginHost + wsPort,
};
return originMap[originType];
}
// NOTE: This method only strips the fragment and is not in accordance to the
// recommended draft specification:
// https://w3c.github.io/webappsec/specs/referrer-policy/#null
......
......@@ -7,7 +7,6 @@
<script src="/resources/testharnessreport.js"></script>
<!-- Common global functions for referrer-policy tests. -->
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.sub.js"></script>
</head>
<body>
<h1>Referrer Policy: CSP 'referrer' directive should not be supported</h1>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment