Bug 1592477 - determinstic output for popup-redirect-cache.https.html, r=annevk

Differential Revision: https://phabricator.services.mozilla.com/D51025

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Junior Hsu 2019-10-31 22:38:47 +00:00
Родитель 625d43df34
Коммит 0585e8416d
1 изменённых файлов: 14 добавлений и 12 удалений

Просмотреть файл

@ -1,10 +1,10 @@
<!doctype html>
<meta charset=utf-8>
<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="resources/common.js"></script>
<script src="/common/utils.js"></script> <!-- Use token() to allow running tests in parallel -->
<div id=log></div>
<script>
@ -44,27 +44,29 @@ function coop_redirect_cache_test(t, hostA, hostB, coop, coep, redirectCache, de
function run_redirect_cache_tests(documentCOOPValueTitle, testArray) {
for (const test of tests) {
async_test(t => {
coop_redirect_cache_test(t, test[0], test[1], "same-origin", "require-corp", test[2], test[3], test[4], test[5]);
// Use a consistent channel name for deterministic failure output
let channelName = `${test[0].name}_${test[1].name}${test[2] ? "" : "_not"}_cache_redirect${test[3] ? "" : "_not"}_cache_destination`;
coop_redirect_cache_test(t, test[0], test[1], "same-origin", "require-corp", test[2], test[3], channelName, test[4]);
}, `${documentCOOPValueTitle} document opening popup redirect from ${test[0].origin} to ${test[1].origin} with redirectCache ${test[2]} and destCache ${test[3]}`);
}
}
let tests = [
// popup Origin, final Origin, isCacheRedirect, isCacheDestination, channelName, hasOpener
// popup Origin, final Origin, isCacheRedirect, isCacheDestination, hasOpener
// Origin A->A->B
[SAME_ORIGIN, CROSS_ORIGIN, true, false, token(), false],
[SAME_ORIGIN, CROSS_ORIGIN, false, true, token(), false],
[SAME_ORIGIN, CROSS_ORIGIN, true, true, token(), false],
[SAME_ORIGIN, CROSS_ORIGIN, true, false, false],
[SAME_ORIGIN, CROSS_ORIGIN, false, true, false],
[SAME_ORIGIN, CROSS_ORIGIN, true, true, false],
// Origin A->B->B
[CROSS_ORIGIN, SAME_ORIGIN, true, false, token(), false],
[CROSS_ORIGIN, SAME_ORIGIN, false, true, token(), false],
[CROSS_ORIGIN, SAME_ORIGIN, true, true, token(), false],
[CROSS_ORIGIN, SAME_ORIGIN, true, false, false],
[CROSS_ORIGIN, SAME_ORIGIN, false, true, false],
[CROSS_ORIGIN, SAME_ORIGIN, true, true, false],
// Origin A->B->C
[SAME_SITE, CROSS_ORIGIN, true, false, token(), false],
[SAME_SITE, CROSS_ORIGIN, false, true, token(), false],
[SAME_SITE, CROSS_ORIGIN, true, true, token(), false],
[SAME_SITE, CROSS_ORIGIN, true, false, false],
[SAME_SITE, CROSS_ORIGIN, false, true, false],
[SAME_SITE, CROSS_ORIGIN, true, true, false],
];
run_redirect_cache_tests("same-origin", tests);