From 0be3d71ec724274f866e1da0bacf718aff520418 Mon Sep 17 00:00:00 2001 From: Nate Chapin Date: Tue, 3 Oct 2023 14:53:53 -0700 Subject: [PATCH] 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} --- .../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/navigation-api/navigate-event/intercept-and-navigate.html b/navigation-api/navigate-event/intercept-and-navigate.html index dfbb67b6b6b1c02..e689dd6974e4721 100644 --- a/navigation-api/navigate-event/intercept-and-navigate.html +++ b/navigation-api/navigate-event/intercept-and-navigate.html @@ -3,6 +3,9 @@ diff --git a/navigation-api/navigate-event/intercept-navigation-back.html b/navigation-api/navigate-event/intercept-navigation-back.html index 8babf2bcdcc5bd7..7c7b80d51009061 100644 --- a/navigation-api/navigate-event/intercept-navigation-back.html +++ b/navigation-api/navigate-event/intercept-navigation-back.html @@ -3,6 +3,9 @@ diff --git a/navigation-api/navigate-event/navigation-traverseTo-in-iframe-same-document-preventDefault.html b/navigation-api/navigate-event/navigation-traverseTo-in-iframe-same-document-preventDefault.html index 463746e8f797701..b3b57f2a1abf8e2 100644 --- a/navigation-api/navigate-event/navigation-traverseTo-in-iframe-same-document-preventDefault.html +++ b/navigation-api/navigate-event/navigation-traverseTo-in-iframe-same-document-preventDefault.html @@ -5,6 +5,9 @@ diff --git a/navigation-api/navigate-event/navigation-traverseTo-navigates-top-and-same-doc-child-and-cross-doc-child.html b/navigation-api/navigate-event/navigation-traverseTo-navigates-top-and-same-doc-child-and-cross-doc-child.html index 31cb54fca2a4d5e..479f54213a95ccd 100644 --- a/navigation-api/navigate-event/navigation-traverseTo-navigates-top-and-same-doc-child-and-cross-doc-child.html +++ b/navigation-api/navigate-event/navigation-traverseTo-navigates-top-and-same-doc-child-and-cross-doc-child.html @@ -5,6 +5,9 @@ diff --git a/navigation-api/navigate-event/navigation-traverseTo-top-cancels-cross-document-child.html b/navigation-api/navigate-event/navigation-traverseTo-top-cancels-cross-document-child.html index 11f07afefc5236e..4ece3ca8cbc013e 100644 --- a/navigation-api/navigate-event/navigation-traverseTo-top-cancels-cross-document-child.html +++ b/navigation-api/navigate-event/navigation-traverseTo-top-cancels-cross-document-child.html @@ -5,6 +5,9 @@ diff --git a/navigation-api/navigate-event/same-url-replace-same-document.html b/navigation-api/navigate-event/same-url-replace-same-document.html index 839c687934238d5..cc4faffe77ab732 100644 --- a/navigation-api/navigate-event/same-url-replace-same-document.html +++ b/navigation-api/navigate-event/same-url-replace-same-document.html @@ -5,19 +5,22 @@