Commit 6bdcd688 authored by arthursonzogni's avatar arthursonzogni Committed by Commit Bot

[COOP] access reporting: split property.https.html test.

Since:
https://chromium-review.googlesource.com/c/chromium/src/+/2428976
the "receive" timeout is now infinite. It means all the tests in
property.https.html will either all succeed or if one of them fails, it
will timeout.

This patch split the test in order to get individual results. This
allow us to prevent individual regression.

Bug: 1090273
Change-Id: I5629e4130dbabde44755468bc7b28ea0d0e802f0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2435638Reviewed-by: default avatarPâris Meuleman <pmeuleman@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#811249}
parent d90bffb2
......@@ -6426,8 +6426,11 @@ crbug.com/1066579 http/tests/devtools/har-importer.js [ Pass Failure ]
# The "timeout" was detected by the wpt-importer bot.
crbug.com/1069714 [ Mac10.13 ] external/wpt/webrtc/RTCRtpSender-replaceTrack.https.html [ Pass Failure Timeout ]
# COOP access reporting. This needs to be implemented in chrome to pass.
crbug.com/1090273 external/wpt/html/cross-origin-opener-policy/reporting/access-reporting/property.https.html [ Pass Timeout Failure ]
# COOP access reporting:
crbug.com/1090273 external/wpt/html/cross-origin-opener-policy/reporting/access-reporting/property-frames.https.html [ Timeout ]
crbug.com/1090273 external/wpt/html/cross-origin-opener-policy/reporting/access-reporting/property-opener-set.https.html [ Timeout ]
crbug.com/1090273 external/wpt/html/cross-origin-opener-policy/reporting/access-reporting/property-self.https.html [ Timeout ]
crbug.com/1090273 external/wpt/html/cross-origin-opener-policy/reporting/access-reporting/property-window.https.html [ Timeout ]
# Sheriff 2020-04-17
crbug.com/1071909 external/wpt/html/cross-origin-opener-policy/popup-coop-by-sw.https.html [ Pass Timeout ]
......
......@@ -7,7 +7,6 @@
# bug for the expectation to the new bug.
# https://crbug.com/1126079
crbug.com/1126079 external/wpt/html/cross-origin-opener-policy/reporting/access-reporting/property.https.html [ Failure ]
crbug.com/1126079 external/wpt/html/cross-origin-opener-policy/reporting/access-reporting/reporting-observer.html [ Failure ]
crbug.com/1126079 external/wpt/html/cross-origin-opener-policy/reporting/access-reporting/access-from-coop-page-to-openee_coop-ro.https.html [ Pass CRASH ]
......
......@@ -7,7 +7,6 @@
# bug for the expectation to the new bug.
# https://crbug.com/1126079
crbug.com/1126079 external/wpt/html/cross-origin-opener-policy/reporting/access-reporting/property.https.html [ Failure ]
crbug.com/1126079 external/wpt/html/cross-origin-opener-policy/reporting/access-reporting/reporting-observer.html [ Failure ]
crbug.com/1126079 external/wpt/html/cross-origin-opener-policy/reporting/access-reporting/access-from-coop-page-to-openee_coop-ro.https.html [ Pass CRASH ]
......
......@@ -7,7 +7,6 @@
# bug for the expectation to the new bug.
# https://crbug.com/1126079
crbug.com/1126079 external/wpt/html/cross-origin-opener-policy/reporting/access-reporting/property.https.html [ Failure ]
crbug.com/1126079 external/wpt/html/cross-origin-opener-policy/reporting/access-reporting/reporting-observer.html [ Failure ]
crbug.com/1126079 external/wpt/html/cross-origin-opener-policy/reporting/access-reporting/access-from-coop-page-to-openee_coop-ro.https.html [ Pass CRASH ]
......
<title> Check openee.blur() access is checked</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/common/get-host-info.sub.js></script>
<script src="/common/utils.js"></script>
<script src="../resources/dispatcher.js"></script>
<script src="../resources/test-access-property.js"></script>
<script>
testAccessProperty("blur", w => w.blur());
</script>
<title> Check openee.close() access is checked</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/common/get-host-info.sub.js></script>
<script src="/common/utils.js"></script>
<script src="../resources/dispatcher.js"></script>
<script src="../resources/test-access-property.js"></script>
<script>
testAccessProperty("close", w => w.close());
</script>
<title> Check openee.closed access is checked</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/common/get-host-info.sub.js></script>
<script src="/common/utils.js"></script>
<script src="../resources/dispatcher.js"></script>
<script src="../resources/test-access-property.js"></script>
<script>
testAccessProperty("closed", w => w.closed);
</script>
<title> Check openee.focus() access is checked</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/common/get-host-info.sub.js></script>
<script src="/common/utils.js"></script>
<script src="../resources/dispatcher.js"></script>
<script src="../resources/test-access-property.js"></script>
<script>
testAccessProperty("focus", w => w.focus());
</script>
<title> Check openee.frames access is checked</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/common/get-host-info.sub.js></script>
<script src="/common/utils.js"></script>
<script src="../resources/dispatcher.js"></script>
<script src="../resources/test-access-property.js"></script>
<script>
testAccessProperty("frames", w => w.frames);
</script>
<title> Check openee.length access is checked</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/common/get-host-info.sub.js></script>
<script src="/common/utils.js"></script>
<script src="../resources/dispatcher.js"></script>
<script src="../resources/test-access-property.js"></script>
<script>
testAccessProperty("length", w => w.length);
</script>
<title> Check openee.location access is checked</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/common/get-host-info.sub.js></script>
<script src="/common/utils.js"></script>
<script src="../resources/dispatcher.js"></script>
<script src="../resources/test-access-property.js"></script>
<script>
testAccessProperty("location", w => w.location);
</script>
<title> Check openee.location access is checked</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/common/get-host-info.sub.js></script>
<script src="/common/utils.js"></script>
<script src="../resources/dispatcher.js"></script>
<script src="../resources/test-access-property.js"></script>
<script>
testAccessProperty("location", w => w.location = "#");
</script>
<title> Check openee.opener access is checked</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/common/get-host-info.sub.js></script>
<script src="/common/utils.js"></script>
<script src="../resources/dispatcher.js"></script>
<script src="../resources/test-access-property.js"></script>
<script>
testAccessProperty("opener", w => w.opener);
</script>
<title> Check openee.opener access is checked</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/common/get-host-info.sub.js></script>
<script src="/common/utils.js"></script>
<script src="../resources/dispatcher.js"></script>
<script src="../resources/test-access-property.js"></script>
<script>
testAccessProperty("opener", w => w.opener = "");
</script>
<title> Check openee.postMessage(arg1, arg2) access is checked</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/common/get-host-info.sub.js></script>
<script src="/common/utils.js"></script>
<script src="../resources/dispatcher.js"></script>
<script src="../resources/test-access-property.js"></script>
<script>
testAccessProperty("postMessage", w => w.postMessage("", ""));
</script>
<title> Check openee.postMessage(arg1) access is checked</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/common/get-host-info.sub.js></script>
<script src="/common/utils.js"></script>
<script src="../resources/dispatcher.js"></script>
<script src="../resources/test-access-property.js"></script>
<script>
testAccessProperty("postMessage", w => w.postMessage(""));
</script>
<title> Check openee.self access is checked</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/common/get-host-info.sub.js></script>
<script src="/common/utils.js"></script>
<script src="../resources/dispatcher.js"></script>
<script src="../resources/test-access-property.js"></script>
<script>
testAccessProperty("self", w => w.self);
</script>
<title> Check openee.top access is checked</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/common/get-host-info.sub.js></script>
<script src="/common/utils.js"></script>
<script src="../resources/dispatcher.js"></script>
<script src="../resources/test-access-property.js"></script>
<script>
testAccessProperty("top", w => w.top);
</script>
<title> Check openee.window access is checked</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/common/get-host-info.sub.js></script>
<script src="/common/utils.js"></script>
<script src="../resources/dispatcher.js"></script>
<script src="../resources/test-access-property.js"></script>
<script>
testAccessProperty("window", w => w.window);
</script>
This is a testharness.js-based test.
PASS cross-origin > w => w.blur()
PASS cross-origin > w => w.close()
PASS cross-origin > w => w.closed
PASS cross-origin > w => w.focus()
PASS cross-origin > w => w.frames
PASS cross-origin > w => w.length
PASS cross-origin > w => w.location
PASS cross-origin > w => w.location = "#"
PASS cross-origin > w => w.opener
FAIL cross-origin > w => w.opener = "" assert_not_equals: Report not received got disallowed value "timeout"
PASS cross-origin > w => w.postMessage("")
PASS cross-origin > w => w.postMessage("", "")
PASS cross-origin > w => w.self
PASS cross-origin > w => w.top
PASS cross-origin > w => w.window
PASS same-site > w => w.blur()
PASS same-site > w => w.close()
PASS same-site > w => w.closed
PASS same-site > w => w.focus()
PASS same-site > w => w.frames
PASS same-site > w => w.length
PASS same-site > w => w.location
PASS same-site > w => w.location = "#"
PASS same-site > w => w.opener
PASS same-site > w => w.opener = ""
PASS same-site > w => w.postMessage("")
PASS same-site > w => w.postMessage("", "")
PASS same-site > w => w.self
PASS same-site > w => w.top
FAIL same-site > w => w.window assert_not_equals: Report not received got disallowed value "timeout"
Harness: the test ran to completion.
<title> Check the "report > body > property" is properly populated.</title>
<meta name=timeout content=long>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/common/get-host-info.sub.js></script>
<script src="/common/utils.js"></script>
<script src="../resources/dispatcher.js"></script>
<script>
const directory = "/html/cross-origin-opener-policy/reporting";
const executor_path = directory + "/resources/executor.html?pipe=";
const coep_header = '|header(Cross-Origin-Embedder-Policy,require-corp)';
let origin = [
["cross-origin" , get_host_info().HTTPS_REMOTE_ORIGIN ] ,
["same-site" , get_host_info().HTTPS_ORIGIN ] ,
];
let property= [
["blur" , w => w.blur() ] ,
["close" , w => w.close() ] ,
["closed" , w => w.closed ] ,
["focus" , w => w.focus() ] ,
["frames" , w => w.frames ] ,
["length" , w => w.length ] ,
["location" , w => w.location ] ,
["location" , w => w.location = "#" ] ,
["opener" , w => w.opener ] ,
["opener" , w => w.opener = "" ] ,
["postMessage" , w => w.postMessage("") ] ,
["postMessage" , w => w.postMessage("", "")] ,
["self" , w => w.self ] ,
["top" , w => w.top ] ,
["window" , w => w.window ] ,
const origin = [
["cross-origin", get_host_info().HTTPS_REMOTE_ORIGIN ] ,
["same-site" , get_host_info().HTTPS_ORIGIN ] ,
];
origin.forEach(([origin_name, origin]) => {
property.forEach(([property, op]) => {
let testAccessProperty = (property, op, message) => {
origin.forEach(([origin_name, origin]) => {
promise_test(async t => {
const report_token = token();
const openee_token = token();
......@@ -50,18 +23,20 @@ origin.forEach(([origin_name, origin]) => {
// 1. Make sure the new document to be loaded.
send(openee_token, `send("${opener_token}", "Ready");`);
let reply = await receive(opener_token);
assert_equals(reply, "Ready");
assert_equals(await receive(opener_token), "Ready");
// TODO(arthursozogni): Figure out why 2 round-trip is sometimes
// necessary to ensure the CoopAccessMonitor are installed.
send(openee_token, `send("${opener_token}", "Ready");`);
assert_equals(await receive(opener_token), "Ready");
// 2. Try to access the openee. This shouldn't work because of COOP+COEP.
try {op(openee)} catch(e) {}
// 3. Check a reports is sent to the opener.
let report = await receiveReport(report_token, "access-to-coop-page")
let report = await receiveReport(report_token,
"access-to-coop-page-from-opener");
assert_equals(report.body.property, property);
}, `${origin_name} > ${op}`);
})
});
</script>
};
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