fune/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-cross-document-double.html
Clark DuVall d85404c542 Bug 1776484 [wpt PR 34586] - Reland "Add TimedHTMLParserBudget to fieldtrial_testing_config.json", a=testonly
Automatic update from web-platform-tests
Reland "Add TimedHTMLParserBudget to fieldtrial_testing_config.json"

This is a reland of commit 8538a928dc7750dfa8a3fe1661e518f86882995b

This adds a couple more fixes to tests that were failing on the MSan
bot, see crbug.com/1339319. Changes from original are from patchset
1 on.

Original change's description:
> Add TimedHTMLParserBudget to fieldtrial_testing_config.json
>
> This exposed cases where some web_tests were implicitly depending on
> the parser yielding at specific times. The fixes here should make
> these tests less brittle in general.
>
> These issues can be reproduced with the current token based parser
> logic by inserting a bunch of <span>s at certain places in the HTML
> to force the parser to yield. The list of fixes:
> - createImageBitmap-sizeOverflow.html: this test was just broken in
>   general. It was not waiting for the assert_throws_dom code to run.
>   The test is now fixed by switching to a promise_test.
> - resource-selection-invoke-*: These tests were depending on not
>   yielding between scripts. The check they had in the separate
>   script was not very important and was brittle, and in the sync version
>   was already failing (see FAIL in expectations file).
> - track-selection-metadata.html: this test was depending on the parser
>   not yielding after executing the script. This was fixed by moving
>   the script outside the <video> element.
> - execution-timing/080.html: depended on the parser not yielding
>   between scripts.
> - about-blank-replacement-blank-nested-frame.html: depended on parser
>   not yielding between scripts.
> - fast/frames/*: exposed an existing bug where frame borders would not
>   be drawn if the parser yields at certain times. Filed this at
>   crbug.com/1338331. I fixed this by using CSS borders for the frames
>   instead of frameborder.
>
> Bug: 1314493
> Change-Id: I8ad7708659bc9690be2641a22bf4d5f24165dc8c
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3716825
> Reviewed-by: Mason Freed <masonf@chromium.org>
> Commit-Queue: Clark DuVall <cduvall@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1017439}

Bug: 1314493, 1339319
Change-Id: I5f21f6f12b34dab4ede2e99fa7c6aca75084db3f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3723814
Commit-Queue: Clark DuVall <cduvall@chromium.org>
Reviewed-by: Mason Freed <masonf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1017774}

--

wpt-commits: 8eed32ff410e0ed182a20ce00a232a6b5ca87643
wpt-pr: 34586
2022-06-29 10:23:56 +00:00

52 lines
1.7 KiB
HTML

<!doctype html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<iframe id="i"></iframe>
<script type="module">
import { Recorder } from "./resources/helpers.mjs";
promise_test(async t => {
await new Promise(resolve => {
i.src = "/common/blank.html";
i.onload = () => t.step_timeout(resolve, 0)
});
const fromStart = i.contentWindow.navigation.currentEntry;
const recorder = new Recorder({
window: i.contentWindow,
finalExpectedEvent: "promise microtask"
});
recorder.setUpNavigationAPIListeners();
// Use https://web-platform-tests.org/writing-tests/server-pipes.html to make
// sure the response doesn't come back quickly, since once the response comes
// back the page would be unloaded and that would break our test.
const result1 = i.contentWindow.navigation.navigate("?pipe=trickle(d100)");
recorder.setUpResultListeners(result1, " 1");
const result2 = i.contentWindow.navigation.navigate("?2");
recorder.setUpResultListeners(result2, " 2");
Promise.resolve().then(() => recorder.record("promise microtask"));
await recorder.readyToAssert;
recorder.assert([
/* event name, location.hash value, navigation.transition properties */
["navigate", "", null],
["AbortSignal abort", "", null],
["navigateerror", "", null],
["navigate", "", null],
["committed rejected 1", "", null],
["finished rejected 1", "", null],
["promise microtask", "", null]
]);
recorder.assertErrorsAreAbortErrors();
}, "event and promise ordering when navigate() is called to a cross-document destination, interrupting another navigate() to a cross-document destination");
</script>