Fix flaky coop test by dividing its execution
Split coep-navigate-popup-unsafe-inherit.https.html into 4 individual
tests. Indeed navigating the popup often led to timeouts when the tests
were run together. I suspect this is due to waiting for the popup to be fully loaded
before navigating in https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/web_tests/external/wpt/html/cross-origin-opener-policy/resources/common.js;drc=bfb040218e09fb822ee50c821e652c9f56c815d3;l=119
I wonder if we need the two requestAnimationFrame here as it seems to be
the triggering factor for the timeouts.
Bug: 1233840
Change-Id: Ieecde43761eab7dd070d99531e4dc21f7cec8549
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3290404
Reviewed-by: Arthur Hemery <ahemery@chromium.org>
Commit-Queue: Pâris <pmeuleman@chromium.org>
Cr-Commit-Position: refs/heads/main@{#943013}
diff --git a/html/cross-origin-opener-policy/historical/coep-navigate-popup-unsafe-inherit.https.html b/html/cross-origin-opener-policy/historical/coep-navigate-popup-unsafe-inherit.https.html
index 21feef7..8756cb6 100644
--- a/html/cross-origin-opener-policy/historical/coep-navigate-popup-unsafe-inherit.https.html
+++ b/html/cross-origin-opener-policy/historical/coep-navigate-popup-unsafe-inherit.https.html
@@ -1,10 +1,15 @@
<!doctype html>
<title>Historical: Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy: a navigating popup</title>
<meta name=timeout content=long>
+<meta name=variant content=?0-0>
+<meta name=variant content=?1-1>
+<meta name=variant content=?2-2>
+<meta name=variant content=?3-3>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src="/common/get-host-info.sub.js"></script>
<script src="../resources/common.js"></script>
+<script src="/common/subset-tests.js"></script>
<script>
[
{
@@ -19,8 +24,13 @@
"coep": "",
"opener": false
}
-].forEach(variant => {
- ["same-origin", "same-site"].forEach(site => {
+].forEach((variant, i) => {
+ ["same-origin", "same-site"].forEach((site, j) => {
+
+ // Only run specified variants
+ if (!shouldRunSubTest(2*i + j)) {
+ return;
+ }
const title = `Popup navigating to ${site} with ${variant.title}`;
const channel = title.replace(/ /g,"-");
const navigateHost = site === "same-origin" ? SAME_ORIGIN : SAME_SITE;