Skip to content

Commit

Permalink
Bug 1856741 [wpt PR 42228] - Make navigation-api/navigation-methods/ …
Browse files Browse the repository at this point in the history
…resilient to starting with extra NavigationHistoryEntries, a=testonly

Automatic update from web-platform-tests
Make navigation-api/navigation-methods/ 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 web-platform-tests/wpt#33590.

Change-Id: I406474b33d9c17b682d5d54fc88f5c677bc3d3ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4904062
Reviewed-by: Domenic Denicola <domenicchromium.org>
Commit-Queue: Nate Chapin <japhetchromium.org>
Auto-Submit: Nate Chapin <japhetchromium.org>
Cr-Commit-Position: refs/heads/main{#1204876}

--

wpt-commits: e1f2e7c0dd66323b85a8cb90182066ed3e6cef9f
wpt-pr: 42228

UltraBlame original commit: e07bed29cec7132e582ee3c817c246fe2af0e1b9
  • Loading branch information
marco-c committed Oct 30, 2023
1 parent bb95230 commit a17385e
Show file tree
Hide file tree
Showing 28 changed files with 781 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,26 @@
replace
navigation
.
let
start_length
=
navigation
.
entries
(
)
.
length
;
let
start_index
=
navigation
.
currentEntry
.
index
;
await
new
Promise
Expand Down Expand Up @@ -130,7 +150,7 @@
)
.
length
1
start_length
"
step
1
Expand Down Expand Up @@ -202,7 +222,9 @@
)
.
length
2
start_length
+
1
"
step
2
Expand Down Expand Up @@ -276,7 +298,9 @@
)
.
length
2
start_length
+
1
"
step
3
Expand Down Expand Up @@ -320,6 +344,8 @@
currentEntry
.
index
start_index
+
1
"
step
Expand Down Expand Up @@ -431,6 +457,8 @@
currentEntry
.
index
start_index
+
1
"
after
Expand Down Expand Up @@ -519,6 +547,8 @@
currentEntry
.
index
start_index
+
1
"
after
Expand Down Expand Up @@ -609,7 +639,7 @@
currentEntry
.
index
0
start_index
"
after
outer
Expand Down Expand Up @@ -721,6 +751,8 @@
currentEntry
.
index
start_index
+
1
"
after
Expand Down Expand Up @@ -800,7 +832,7 @@
currentEntry
.
index
0
start_index
"
after
outer
Expand Down Expand Up @@ -895,6 +927,8 @@
currentEntry
.
index
start_index
+
1
"
after
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,26 @@
=
>
{
let
start_length
=
navigation
.
entries
(
)
.
length
;
let
start_index
=
navigation
.
currentEntry
.
index
;
/
/
Wait
Expand Down Expand Up @@ -118,7 +138,7 @@
)
.
length
1
start_length
)
;
assert_equals
Expand Down Expand Up @@ -156,7 +176,9 @@
)
.
length
2
start_length
+
1
)
;
assert_equals
Expand Down Expand Up @@ -198,7 +220,9 @@
)
.
length
2
start_length
+
1
)
;
assert_equals
Expand All @@ -224,6 +248,8 @@
currentEntry
.
index
start_index
+
1
)
;
Expand Down Expand Up @@ -327,6 +353,8 @@
currentEntry
.
index
start_index
+
1
)
;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,26 @@
=
>
{
let
start_length
=
navigation
.
entries
(
)
.
length
;
let
start_index
=
navigation
.
currentEntry
.
index
;
/
/
Wait
Expand Down Expand Up @@ -118,7 +138,7 @@
)
.
length
1
start_length
)
;
assert_equals
Expand Down Expand Up @@ -156,7 +176,9 @@
)
.
length
2
start_length
+
1
)
;
assert_equals
Expand Down Expand Up @@ -198,7 +220,9 @@
)
.
length
2
start_length
+
1
)
;
assert_equals
Expand All @@ -224,6 +248,8 @@
currentEntry
.
index
start_index
+
1
)
;
Expand Down Expand Up @@ -289,6 +315,8 @@
currentEntry
.
index
start_index
+
1
)
;
Expand Down Expand Up @@ -332,7 +360,7 @@
currentEntry
.
index
0
start_index
)
;
assert_equals
Expand Down Expand Up @@ -411,6 +439,8 @@
currentEntry
.
index
start_index
+
1
)
;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,26 @@
=
>
{
let
start_length
=
navigation
.
entries
(
)
.
length
;
let
start_index
=
navigation
.
currentEntry
.
index
;
/
/
Wait
Expand Down Expand Up @@ -118,7 +138,7 @@
)
.
length
1
start_length
)
;
assert_equals
Expand Down Expand Up @@ -156,7 +176,9 @@
)
.
length
2
start_length
+
1
)
;
assert_equals
Expand Down Expand Up @@ -225,7 +247,9 @@
)
.
length
2
start_length
+
1
)
;
assert_equals
Expand All @@ -251,6 +275,8 @@
currentEntry
.
index
start_index
+
1
)
;
Expand Down Expand Up @@ -355,6 +381,8 @@
currentEntry
.
index
start_index
+
1
)
;
Expand Down
Loading

0 comments on commit a17385e

Please sign in to comment.