0

[Credentialless] Fix flakes about iframeTest.js

- Increase the timeout to 6000ms to avoid false-positive.
- Split the tests in 3 to avoid timeout.
- Tweak the test to start the timer after the fetch request has to
  create the iframe has been sent.

R: titouan@chromium.org
CC: lyf@chromium.org
Fixed: 1215956
Bug: 1175099
Change-Id: I517d255e5850bb1bd59286aa4de1a7b97cb17e74
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2945197
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Titouan Rigoudy <titouan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#890288}
This commit is contained in:
arthursonzogni
2021-06-08 16:47:36 +00:00
committed by Chromium LUCI CQ
parent 7f10bf7b19
commit 7af83bdedf
5 changed files with 55 additions and 39 deletions

@@ -3518,9 +3518,6 @@ crbug.com/626703 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftest
crbug.com/626703 external/wpt/encoding/eof-utf-8-three.html [ Failure ]
crbug.com/626703 external/wpt/encoding/eof-utf-8-two.html [ Failure ]
crbug.com/626703 external/wpt/html/browsers/windows/noreferrer-window-name.html [ Timeout ]
crbug.com/1215956 [ Linux ] external/wpt/html/cross-origin-embedder-policy/credentialless/iframe-coep-credentialless.tentative.https.html [ Pass Failure ]
crbug.com/1215956 [ Linux ] external/wpt/html/cross-origin-embedder-policy/credentialless/iframe-coep-require-corp.tentative.https.html [ Pass Failure ]
crbug.com/1215956 [ Linux ] external/wpt/html/cross-origin-embedder-policy/credentialless/iframe-coep-none.tentative.https.html [ Pass Failure ]
crbug.com/626703 external/wpt/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-04.html [ Failure ]
crbug.com/626703 external/wpt/html/semantics/embedded-content/the-video-element/video_initially_paused.html [ Failure ]
crbug.com/626703 external/wpt/html/semantics/grouping-content/the-li-element/grouping-li-reftest-list-owner-menu.html [ Failure ]

@@ -1,3 +1,6 @@
<meta name="variant" content="?1-4">
<meta name="variant" content="?5-9">
<meta name="variant" content="?9-last">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/get-host-info.sub.js"></script>
@@ -5,35 +8,35 @@
<script src="./resources/common.js"></script>
<script src="./resources/dispatcher.js"></script>
<script src="./resources/iframeTest.js"></script>
<script src="/common/subset-tests.js"></script>
<script>
const parent_coep_credentialless = newWindow(coep_credentialless);
iframeTest("COEP:credentialless embeds same-origin COEP:none",
subsetTest(iframeTest, "COEP:credentialless embeds same-origin COEP:none",
parent_coep_credentialless, same_origin, coep_none, EXPECT_BLOCK);
iframeTest("COEP:credentialless embeds cross-origin COEP:none",
subsetTest(iframeTest, "COEP:credentialless embeds cross-origin COEP:none",
parent_coep_credentialless, cross_origin, coep_none, EXPECT_BLOCK);
iframeTest("COEP:credentialless embeds same-origin COEP:credentialless",
subsetTest(iframeTest, "COEP:credentialless embeds same-origin COEP:credentialless",
parent_coep_credentialless, same_origin, coep_credentialless, EXPECT_LOAD);
iframeTest("COEP:credentialless embeds cross-origin COEP:credentialless",
subsetTest(iframeTest, "COEP:credentialless embeds cross-origin COEP:credentialless",
parent_coep_credentialless, cross_origin, coep_credentialless, EXPECT_BLOCK);
iframeTest("COEP:credentialless embeds same-origin COEP:require-corp",
subsetTest(iframeTest, "COEP:credentialless embeds same-origin COEP:require-corp",
parent_coep_credentialless, same_origin, coep_require_corp, EXPECT_LOAD);
iframeTest("COEP:credentialless embeds cross-origin COEP:require-corp",
subsetTest(iframeTest, "COEP:credentialless embeds cross-origin COEP:require-corp",
parent_coep_credentialless, cross_origin, coep_require_corp, EXPECT_BLOCK);
// Using CORP:cross-origin might unblock previously blocked iframes.
iframeTestCORP("COEP:credentialless embeds same-origin COEP:none",
subsetTest(iframeTestCORP, "COEP:credentialless embeds same-origin COEP:none",
parent_coep_credentialless, same_origin, coep_none, EXPECT_BLOCK);
iframeTestCORP("COEP:credentialless embeds cross-origin COEP:none",
subsetTest(iframeTestCORP, "COEP:credentialless embeds cross-origin COEP:none",
parent_coep_credentialless, cross_origin, coep_none, EXPECT_BLOCK);
iframeTestCORP("COEP:credentialless embeds same-origin COEP:credentialless",
subsetTest(iframeTestCORP, "COEP:credentialless embeds same-origin COEP:credentialless",
parent_coep_credentialless, same_origin, coep_credentialless, EXPECT_LOAD);
iframeTestCORP("COEP:credentialless embeds cross-origin COEP:credentialless",
subsetTest(iframeTestCORP, "COEP:credentialless embeds cross-origin COEP:credentialless",
parent_coep_credentialless, cross_origin, coep_credentialless, EXPECT_LOAD);
iframeTestCORP("COEP:credentialless embeds same-origin COEP:require-corp",
subsetTest(iframeTestCORP, "COEP:credentialless embeds same-origin COEP:require-corp",
parent_coep_credentialless, same_origin, coep_require_corp, EXPECT_LOAD);
iframeTestCORP("COEP:credentialless embeds cross-origin COEP:require-corp",
subsetTest(iframeTestCORP, "COEP:credentialless embeds cross-origin COEP:require-corp",
parent_coep_credentialless, cross_origin, coep_require_corp, EXPECT_LOAD);
</script>

@@ -1,3 +1,5 @@
<meta name="variant" content="?1-4">
<meta name="variant" content="?5-last">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/get-host-info.sub.js"></script>
@@ -5,21 +7,21 @@
<script src="./resources/common.js"></script>
<script src="./resources/dispatcher.js"></script>
<script src="./resources/iframeTest.js"></script>
<script src="/common/subset-tests.js"></script>
<script>
const parent_coep_none = newWindow(coep_none);
iframeTest("COEP:none embeds same-origin COEP:none",
subsetTest(iframeTest, "COEP:none embeds same-origin COEP:none",
parent_coep_none, same_origin, coep_none, EXPECT_LOAD);
iframeTest("COEP:none embeds cross-origin COEP:none",
subsetTest(iframeTest, "COEP:none embeds cross-origin COEP:none",
parent_coep_none, cross_origin, coep_none, EXPECT_LOAD);
iframeTest("COEP:none embeds same-origin COEP:credentialless",
subsetTest(iframeTest, "COEP:none embeds same-origin COEP:credentialless",
parent_coep_none, same_origin, coep_credentialless, EXPECT_LOAD);
iframeTest("COEP:none embeds cross-origin COEP:credentialless",
subsetTest(iframeTest, "COEP:none embeds cross-origin COEP:credentialless",
parent_coep_none, cross_origin, coep_credentialless, EXPECT_LOAD);
iframeTest("COEP:none embeds same-origin COEP:require-corp",
subsetTest(iframeTest, "COEP:none embeds same-origin COEP:require-corp",
parent_coep_none, same_origin, coep_require_corp, EXPECT_LOAD);
iframeTest("COEP:none embeds cross-origin COEP:require-corp",
subsetTest(iframeTest, "COEP:none embeds cross-origin COEP:require-corp",
parent_coep_none, cross_origin, coep_require_corp, EXPECT_LOAD);
</script>

@@ -1,3 +1,6 @@
<meta name="variant" content="?1-4">
<meta name="variant" content="?5-9">
<meta name="variant" content="?9-last">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/get-host-info.sub.js"></script>
@@ -5,35 +8,36 @@
<script src="./resources/common.js"></script>
<script src="./resources/dispatcher.js"></script>
<script src="./resources/iframeTest.js"></script>
<script src="/common/subset-tests.js"></script>
<script>
const parent_coep_require_corp = newWindow(coep_require_corp);
iframeTest("COEP:require-corp embeds same-origin COEP:none",
subsetTest(iframeTest, "COEP:require-corp embeds same-origin COEP:none",
parent_coep_require_corp, same_origin, coep_none, EXPECT_BLOCK);
iframeTest("COEP:require-corp embeds cross-origin COEP:none",
subsetTest(iframeTest, "COEP:require-corp embeds cross-origin COEP:none",
parent_coep_require_corp, cross_origin, coep_none, EXPECT_BLOCK);
iframeTest("COEP:require-corp embeds same-origin COEP:credentialless",
subsetTest(iframeTest, "COEP:require-corp embeds same-origin COEP:credentialless",
parent_coep_require_corp, same_origin, coep_credentialless, EXPECT_LOAD);
iframeTest("COEP:require-corp embeds cross-origin COEP:credentialless",
subsetTest(iframeTest, "COEP:require-corp embeds cross-origin COEP:credentialless",
parent_coep_require_corp, cross_origin, coep_credentialless, EXPECT_BLOCK);
iframeTest("COEP:require-corp embeds same-origin COEP:require-corp",
subsetTest(iframeTest, "COEP:require-corp embeds same-origin COEP:require-corp",
parent_coep_require_corp, same_origin, coep_require_corp, EXPECT_LOAD);
iframeTest("COEP:require-corp embeds cross-origin COEP:require-corp",
subsetTest(iframeTest, "COEP:require-corp embeds cross-origin COEP:require-corp",
parent_coep_require_corp, cross_origin, coep_require_corp, EXPECT_BLOCK);
// Using CORP:cross-origin might unblock previously blocked iframes.
iframeTestCORP("COEP:require-corp embeds same-origin COEP:none",
subsetTest(iframeTestCORP, "COEP:require-corp embeds same-origin COEP:none",
parent_coep_require_corp, same_origin, coep_none, EXPECT_BLOCK);
iframeTestCORP("COEP:require-corp embeds cross-origin COEP:none",
subsetTest(iframeTestCORP, "COEP:require-corp embeds cross-origin COEP:none",
parent_coep_require_corp, cross_origin, coep_none, EXPECT_BLOCK);
iframeTestCORP("COEP:require-corp embeds same-origin COEP:credentialless",
subsetTest(iframeTestCORP, "COEP:require-corp embeds same-origin COEP:credentialless",
parent_coep_require_corp, same_origin, coep_credentialless, EXPECT_LOAD);
iframeTestCORP("COEP:require-corp embeds cross-origin COEP:credentialless",
subsetTest(iframeTestCORP, "COEP:require-corp embeds cross-origin COEP:credentialless",
parent_coep_require_corp, cross_origin, coep_credentialless, EXPECT_LOAD);
iframeTestCORP("COEP:require-corp embeds same-origin COEP:require-corp",
subsetTest(iframeTestCORP, "COEP:require-corp embeds same-origin COEP:require-corp",
parent_coep_require_corp, same_origin, coep_require_corp, EXPECT_LOAD);
iframeTestCORP("COEP:require-corp embeds cross-origin COEP:require-corp",
subsetTest(iframeTestCORP, "COEP:require-corp embeds cross-origin COEP:require-corp",
parent_coep_require_corp, cross_origin, coep_require_corp, EXPECT_LOAD);
</script>

@@ -48,20 +48,30 @@ const iframeTest = function(
const child_url = child_origin + executor_path + child_headers +
`&uuid=${child_token}`;
send(parent_token, `
await send(parent_token, `
let iframe = document.createElement("iframe");
iframe.src = "${child_url}";
document.body.appendChild(iframe);
`);
send(child_token, `
await send(child_token, `
send("${test_token}", "load");
`);
// There are no interoperable ways to check an iframe failed to load. So a
// timeout is being used.
// See https://github.com/whatwg/html/issues/125
step_timeout(()=>send(test_token, "block"), 3000);
// Use a shorter timeout when it is expected to be reached.
// - The long delay reduces the false-positive rate. False-positive causes
// stability problems on bot, so a big delay is used to vanish them.
// https://crbug.com/1215956.
// - The short delay avoids delaying too much the test(s) for nothing and
// timing out. False-negative are not a problem, they just need not to
// overwhelm the true-negative, which is trivial to get.
step_timeout(()=>send(test_token, "block"), expectation == EXPECT_BLOCK
? 2000
: 6000
);
assert_equals(await receive(test_token), expectation);
}, description);