diff --git a/html/cross-origin-opener-policy/header-parsing.https.html b/html/cross-origin-opener-policy/header-parsing.https.html new file mode 100644 index 00000000000000..94901a4649abde --- /dev/null +++ b/html/cross-origin-opener-policy/header-parsing.https.html @@ -0,0 +1,53 @@ + + + + + + + +
+ diff --git a/html/cross-origin-opener-policy/resources/common.js b/html/cross-origin-opener-policy/resources/common.js index 8a3cd133734dc3..f75cd63db94bf6 100644 --- a/html/cross-origin-opener-policy/resources/common.js +++ b/html/cross-origin-opener-policy/resources/common.js @@ -50,7 +50,7 @@ function url_test(t, url, channelName, hasOpener, openerDOMAccess, callback) { } function coop_coep_test(t, host, coop, coep, channelName, hasOpener, openerDOMAccess, callback) { - url_test(t, `${host.origin}/html/cross-origin-opener-policy/resources/coop-coep.py?coop=${encodeURIComponent(coop)}&coep=${coep}&channel=${channelName}`, channelName, hasOpener, openerDOMAccess, callback); + url_test(t, `${host.origin}/html/cross-origin-opener-policy/resources/coop-coep.py?coop=${encodeURIComponent(coop)}&coep=${coep}&channel=${encodeURIComponent(channelName)}`, channelName, hasOpener, openerDOMAccess, callback); } function coop_test(t, host, coop, channelName, hasOpener, callback) { @@ -63,7 +63,7 @@ function run_coop_tests(documentCOOPValueTitle, testArray) { coop_test(t, test[0], test[1], `${documentCOOPValueTitle}_to_${test[0].name}_${test[1].replace(/ /g,"-")}`, test[2], () => { t.done(); }); - }, `${documentCOOPValueTitle} document opening popup to ${test[0].origin} with COOP: "${test[1]}"`); + }, `${documentCOOPValueTitle} document opening popup to ${test[0].origin} with COOP: ${format_value(test[1])}`); } } @@ -91,5 +91,5 @@ function run_coop_test_iframe (documentTitle, iframe_origin, popup_origin, popup assert_equals(payload.name, expects_name? name:"", 'name'); }); document.body.append(frame); - }, `${documentTitle} with ${iframe_origin.name} iframe opening popup a ${popup_origin.name} with COOP: ${popup_coop}`); -} \ No newline at end of file + }, `${documentTitle} with ${iframe_origin.name} iframe opening popup a ${popup_origin.name} with COOP: ${format_value(popup_coop)}`); +} diff --git a/html/cross-origin-opener-policy/resources/coop-coep.py b/html/cross-origin-opener-policy/resources/coop-coep.py index e0a3d90050a624..31490a162ba66f 100644 --- a/html/cross-origin-opener-policy/resources/coop-coep.py +++ b/html/cross-origin-opener-policy/resources/coop-coep.py @@ -70,7 +70,7 @@ def main(request, response): iframe.contentWindow.postMessage(payload, "*"); }; const channelName = new URL(location).searchParams.get("channel"); - iframe.src = `${get_host_info().HTTPS_ORIGIN}/html/cross-origin-opener-policy/resources/postback.html?channel=${channelName}`; + iframe.src = `${get_host_info().HTTPS_ORIGIN}/html/cross-origin-opener-policy/resources/postback.html?channel=${encodeURIComponent(channelName)}`; document.body.appendChild(iframe); } diff --git a/html/cross-origin-opener-policy/resources/coop-same-origin-repeated.asis b/html/cross-origin-opener-policy/resources/coop-same-origin-repeated.asis new file mode 100644 index 00000000000000..082478e1599eb8 --- /dev/null +++ b/html/cross-origin-opener-policy/resources/coop-same-origin-repeated.asis @@ -0,0 +1,24 @@ +HTTP/1.1 200 OK +Cross-Origin-Opener-Policy: same-origin +Cross-Origin-Opener-Policy: same-origin +Server: BaseHTTP/0.3 Python/2.7.15+ +Date: Wed, 18 Dec 2019 00:47:08 GMT + + + + + +