From 7591309d009237ceaadb5310532f8569abedf01a Mon Sep 17 00:00:00 2001 From: Nate Chapin Date: Wed, 4 Oct 2023 16:35:33 +0000 Subject: [PATCH] Bug 1856740 [wpt PR 42233] - Make navigation-api/navigate-event/ resilient to starting with extra NavigationHistoryEntries, a=testonly Automatic update from web-platform-tests Make navigation-api/navigate-event/ resilient to starting with extra NavigationHistoryEntries When WPT are run in-browser or via wptrunner, there may be additional session history entries when the test starts, so the tests shouldn't assume that they start with navigation.entries().length == 1 or navigation.currentEntry.index == 0. This is a workaround for https://github.com/web-platform-tests/wpt/issues/33590. Change-Id: I978d492d5d31d110716d6a1d84732aff792aca14 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4904223 Reviewed-by: Domenic Denicola Auto-Submit: Nate Chapin Commit-Queue: Nate Chapin Cr-Commit-Position: refs/heads/main@{#1204863} -- wpt-commits: 4cd570dc80fec7b17cad121e7ac866badf62df38 wpt-pr: 42233 --- .../navigate-event/intercept-and-navigate.html | 11 +++++++---- .../intercept-navigation-back.html | 7 +++++-- .../intercept-same-document-history-back.html | 15 +++++++++------ .../navigate-destination-dynamic-index.html | 6 ++++-- .../navigate-history-back-after-fragment.html | 3 ++- .../navigate-history-back-after-pushState.html | 7 ++++--- .../navigate-history-back-noop.html | 16 ++++++++++------ .../navigate-navigation-back-same-document.html | 3 ++- ...gation-back-same-document-preventDefault.html | 9 ++++++--- ...o-in-iframe-same-document-preventDefault.html | 9 ++++++--- ...p-and-same-doc-child-and-cross-doc-child.html | 11 +++++++---- ...document-preventDefault-multiple-windows.html | 11 +++++++---- ...verseTo-top-cancels-cross-document-child.html | 9 ++++++--- .../same-url-replace-cross-document.html | 9 ++++++--- .../same-url-replace-same-document.html | 13 ++++++++----- 15 files changed, 89 insertions(+), 50 deletions(-) diff --git a/testing/web-platform/tests/navigation-api/navigate-event/intercept-and-navigate.html b/testing/web-platform/tests/navigation-api/navigate-event/intercept-and-navigate.html index dfbb67b6b6b1c..e689dd6974e47 100644 --- a/testing/web-platform/tests/navigation-api/navigate-event/intercept-and-navigate.html +++ b/testing/web-platform/tests/navigation-api/navigate-event/intercept-and-navigate.html @@ -3,6 +3,9 @@ diff --git a/testing/web-platform/tests/navigation-api/navigate-event/intercept-navigation-back.html b/testing/web-platform/tests/navigation-api/navigate-event/intercept-navigation-back.html index 8babf2bcdcc5b..7c7b80d510090 100644 --- a/testing/web-platform/tests/navigation-api/navigate-event/intercept-navigation-back.html +++ b/testing/web-platform/tests/navigation-api/navigate-event/intercept-navigation-back.html @@ -3,6 +3,9 @@ diff --git a/testing/web-platform/tests/navigation-api/navigate-event/navigation-traverseTo-in-iframe-same-document-preventDefault.html b/testing/web-platform/tests/navigation-api/navigate-event/navigation-traverseTo-in-iframe-same-document-preventDefault.html index 463746e8f7977..b3b57f2a1abf8 100644 --- a/testing/web-platform/tests/navigation-api/navigate-event/navigation-traverseTo-in-iframe-same-document-preventDefault.html +++ b/testing/web-platform/tests/navigation-api/navigate-event/navigation-traverseTo-in-iframe-same-document-preventDefault.html @@ -5,6 +5,9 @@ diff --git a/testing/web-platform/tests/navigation-api/navigate-event/navigation-traverseTo-navigates-top-and-same-doc-child-and-cross-doc-child.html b/testing/web-platform/tests/navigation-api/navigate-event/navigation-traverseTo-navigates-top-and-same-doc-child-and-cross-doc-child.html index 31cb54fca2a4d..479f54213a95c 100644 --- a/testing/web-platform/tests/navigation-api/navigate-event/navigation-traverseTo-navigates-top-and-same-doc-child-and-cross-doc-child.html +++ b/testing/web-platform/tests/navigation-api/navigate-event/navigation-traverseTo-navigates-top-and-same-doc-child-and-cross-doc-child.html @@ -5,6 +5,9 @@ diff --git a/testing/web-platform/tests/navigation-api/navigate-event/navigation-traverseTo-top-cancels-cross-document-child.html b/testing/web-platform/tests/navigation-api/navigate-event/navigation-traverseTo-top-cancels-cross-document-child.html index 11f07afefc523..4ece3ca8cbc01 100644 --- a/testing/web-platform/tests/navigation-api/navigate-event/navigation-traverseTo-top-cancels-cross-document-child.html +++ b/testing/web-platform/tests/navigation-api/navigate-event/navigation-traverseTo-top-cancels-cross-document-child.html @@ -5,6 +5,9 @@ diff --git a/testing/web-platform/tests/navigation-api/navigate-event/same-url-replace-same-document.html b/testing/web-platform/tests/navigation-api/navigate-event/same-url-replace-same-document.html index 839c687934238..cc4faffe77ab7 100644 --- a/testing/web-platform/tests/navigation-api/navigate-event/same-url-replace-same-document.html +++ b/testing/web-platform/tests/navigation-api/navigate-event/same-url-replace-same-document.html @@ -5,19 +5,22 @@