Commit f141259f authored by arthursonzogni's avatar arthursonzogni Committed by Commit Bot

COOP access reporting:

This updates some variable names in the access-reporting/ WPT test
direction. This doesn't change the WPT test behaviors.

The first iteration of tests were using:
 - callback_token
 - executor_token

while the new one are using:
 - openee_token
 - opener_token
 - test_window_token

This patch upgrades every names to the last iteration, to maintain
consistency.

Bug: 1090273
Change-Id: If49be91fd99d93d14271693fda11ce68a866217d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2346351
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: default avatarPâris Meuleman <pmeuleman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#796753}
parent e194a58a
...@@ -18,21 +18,21 @@ const coep_header = '|header(Cross-Origin-Embedder-Policy,require-corp)'; ...@@ -18,21 +18,21 @@ const coep_header = '|header(Cross-Origin-Embedder-Policy,require-corp)';
promise_test(async t => { promise_test(async t => {
const report_token = token(); const report_token = token();
const executor_token = token(); const openee_token = token();
const callback_token = token(); const opener_token = token(); // The current test window.
const reportTo = reportToHeaders(report_token); const reportTo = reportToHeaders(report_token);
const openee_url = cross_origin + executor_path + const openee_url = cross_origin + executor_path +
reportTo.header + reportTo.coopReportOnlySameOriginHeader + coep_header + reportTo.header + reportTo.coopReportOnlySameOriginHeader + coep_header +
`&uuid=${executor_token}`; `&uuid=${openee_token}`;
const openee = window.open(openee_url); const openee = window.open(openee_url);
t.add_cleanup(() => send(executor_token, "window.close()")) t.add_cleanup(() => send(openee_token, "window.close()"))
// 1. Make sure the new document to be loaded. // 1. Make sure the new document to be loaded.
send(executor_token, ` send(openee_token, `
send("${callback_token}", "Ready"); send("${opener_token}", "Ready");
`); `);
let reply = await receive(callback_token); let reply = await receive(opener_token);
assert_equals(reply, "Ready"); assert_equals(reply, "Ready");
// 2. Try to access the openee. A report is sent, because of COOP-RO+COEP. // 2. Try to access the openee. A report is sent, because of COOP-RO+COEP.
......
...@@ -18,21 +18,21 @@ const coep_header = '|header(Cross-Origin-Embedder-Policy,require-corp)'; ...@@ -18,21 +18,21 @@ const coep_header = '|header(Cross-Origin-Embedder-Policy,require-corp)';
promise_test(async t => { promise_test(async t => {
const report_token = token(); const report_token = token();
const executor_token = token(); const openee_token = token();
const callback_token = token(); const opener_token = token(); // The current test window.
const reportTo = reportToHeaders(report_token); const reportTo = reportToHeaders(report_token);
const openee_url = cross_origin + executor_path + const openee_url = cross_origin + executor_path +
reportTo.header + reportTo.coopSameOriginHeader + coep_header + reportTo.header + reportTo.coopSameOriginHeader + coep_header +
`&uuid=${executor_token}`; `&uuid=${openee_token}`;
const openee = window.open(openee_url); const openee = window.open(openee_url);
t.add_cleanup(() => send(executor_token, "window.close()")) t.add_cleanup(() => send(openee_token, "window.close()"))
// 1. Make sure the new document to be loaded. // 1. Make sure the new document to be loaded.
send(executor_token, ` send(openee_token, `
send("${callback_token}", "Ready"); send("${opener_token}", "Ready");
`); `);
let reply = await receive(callback_token); let reply = await receive(opener_token);
assert_equals(reply, "Ready"); assert_equals(reply, "Ready");
// 2. Try to access the openee. This shouldn't work because of COOP+COEP. // 2. Try to access the openee. This shouldn't work because of COOP+COEP.
......
...@@ -18,18 +18,17 @@ const coep_header = '|header(Cross-Origin-Embedder-Policy,require-corp)'; ...@@ -18,18 +18,17 @@ const coep_header = '|header(Cross-Origin-Embedder-Policy,require-corp)';
promise_test(async t => { promise_test(async t => {
const report_token = token(); const report_token = token();
const executor_token = token(); const openee_token = token();
const callback_token = token();
const reportTo = reportToHeaders(report_token); const reportTo = reportToHeaders(report_token);
const openee_url = cross_origin + executor_path + const openee_url = cross_origin + executor_path +
reportTo.header + reportTo.coopReportOnlySameOriginHeader + coep_header + reportTo.header + reportTo.coopReportOnlySameOriginHeader + coep_header +
`&uuid=${executor_token}`; `&uuid=${openee_token}`;
const openee = window.open(openee_url); const openee = window.open(openee_url);
t.add_cleanup(() => send(executor_token, "window.close()")) t.add_cleanup(() => send(openee_token, "window.close()"))
// 1. Try to access the opener. A report is sent, because of COOP-RO+COEP. // 1. Try to access the opener. A report is sent, because of COOP-RO+COEP.
send(executor_token, ` send(openee_token, `
tryAccess(opener); tryAccess(opener);
`); `);
......
...@@ -18,18 +18,17 @@ const coep_header = '|header(Cross-Origin-Embedder-Policy,require-corp)'; ...@@ -18,18 +18,17 @@ const coep_header = '|header(Cross-Origin-Embedder-Policy,require-corp)';
promise_test(async t => { promise_test(async t => {
const report_token = token(); const report_token = token();
const executor_token = token(); const openee_token = token();
const callback_token = token();
const reportTo = reportToHeaders(report_token); const reportTo = reportToHeaders(report_token);
const openee_url = cross_origin + executor_path + const openee_url = cross_origin + executor_path +
reportTo.header + reportTo.coopSameOriginHeader + coep_header + reportTo.header + reportTo.coopSameOriginHeader + coep_header +
`&uuid=${executor_token}`; `&uuid=${openee_token}`;
const openee = window.open(openee_url); const openee = window.open(openee_url);
t.add_cleanup(() => send(executor_token, "window.close()")); t.add_cleanup(() => send(openee_token, "window.close()"));
// 1. Try to access the opener. A report is sent, because of COOP+COEP. // 1. Try to access the opener. A report is sent, because of COOP+COEP.
send(executor_token, ` send(openee_token, `
tryAccess(opener); tryAccess(opener);
`); `);
......
...@@ -40,19 +40,19 @@ origin.forEach(([origin_name, origin]) => { ...@@ -40,19 +40,19 @@ origin.forEach(([origin_name, origin]) => {
property.forEach(([property, op]) => { property.forEach(([property, op]) => {
promise_test(async t => { promise_test(async t => {
const report_token = token(); const report_token = token();
const executor_token = token(); const openee_token = token();
const callback_token = token(); const opener_token = token(); // The current test window.
const reportTo = reportToHeaders(report_token); const reportTo = reportToHeaders(report_token);
const openee_url = origin+ executor_path + const openee_url = origin+ executor_path +
reportTo.header + reportTo.coopReportOnlySameOriginHeader + coep_header + reportTo.header + reportTo.coopReportOnlySameOriginHeader + coep_header +
`&uuid=${executor_token}`; `&uuid=${openee_token}`;
const openee = window.open(openee_url); const openee = window.open(openee_url);
t.add_cleanup(() => send(executor_token, "window.close()")) t.add_cleanup(() => send(openee_token, "window.close()"))
// 1. Make sure the new document to be loaded. // 1. Make sure the new document to be loaded.
send(executor_token, `send("${callback_token}", "Ready");`); send(openee_token, `send("${opener_token}", "Ready");`);
let reply = await receive(callback_token); let reply = await receive(opener_token);
assert_equals(reply, "Ready"); assert_equals(reply, "Ready");
// 2. Try to access the openee. This shouldn't work because of COOP+COEP. // 2. Try to access the openee. This shouldn't work because of COOP+COEP.
......
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