tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 2b9c925ea7d740f7f36cdc517af6f4f2020fd223
parent 3a834e5c8334a0196d3af2f8c06c54b6e8106b8e
Author: Basuke Suzuki <basuke@apple.com>
Date:   Fri, 14 Nov 2025 10:23:54 +0000

Bug 2000096 [wpt PR 56020] - Simplify assertions in navigation-api iframe history test, a=testonly

Automatic update from web-platform-tests
Simplify assertions in navigation-api iframe history test (#56020)

Review feedback simplified the test assertions in entries-mainframe-with-iframe.html to
be more concise while maintaining the same coverage. The test now uses loops to verify
that main frame entries don't contain iframe hashes and vice versa, rather than checking
each entry individually.

https://github.com/WebKit/WebKit/pull/53770
--

wpt-commits: 221e9fcf17a526cd01c62fa45ef6277a5f93a507
wpt-pr: 56020

Diffstat:
Mtesting/web-platform/tests/navigation-api/navigation-history-entry/entries-mainframe-with-iframe.html | 28+++++++---------------------
1 file changed, 7 insertions(+), 21 deletions(-)

diff --git a/testing/web-platform/tests/navigation-api/navigation-history-entry/entries-mainframe-with-iframe.html b/testing/web-platform/tests/navigation-api/navigation-history-entry/entries-mainframe-with-iframe.html @@ -40,36 +40,22 @@ promise_test(async t => { assert_equals(mainEntries.length, 3, "main frame should have 3 entries"); assert_true(mainEntries[0].url.includes(initialMainURL.split('#')[0]), "main entry 0 should be main frame URL"); - assert_false(mainEntries[0].url.includes("blank.html"), "main entry 0 should not be iframe URL"); - assert_true(mainEntries[1].url.endsWith("#main1"), "main entry 1 should end with #main1"); - assert_false(mainEntries[1].url.includes("blank.html"), "main entry 1 should not be iframe URL"); - assert_true(mainEntries[2].url.endsWith("#main2"), "main entry 2 should end with #main2"); - assert_false(mainEntries[2].url.includes("blank.html"), "main entry 2 should not be iframe URL"); + + for (let entry of mainEntries) + assert_false(entry.url.includes("#iframe"), "main frame entry should not contain iframe hash: " + entry.url); // Verify iframe entries contain only iframe URLs let iframeEntries = i.contentWindow.navigation.entries(); assert_equals(iframeEntries.length, 3, "iframe should have 3 entries"); - assert_true(iframeEntries[0].url.includes("blank.html"), "iframe entry 0 should be iframe URL"); - assert_false(iframeEntries[0].url.includes("mainframe-excludes-iframe-entries.html"), "iframe entry 0 should not be main frame URL"); - - assert_true(iframeEntries[1].url.includes("blank.html") && iframeEntries[1].url.endsWith("#iframe1"), "iframe entry 1 should be blank.html#iframe1"); - assert_false(iframeEntries[1].url.includes("#main"), "iframe entry 1 should not contain main frame hash"); - - assert_true(iframeEntries[2].url.includes("blank.html") && iframeEntries[2].url.endsWith("#iframe2"), "iframe entry 2 should be blank.html#iframe2"); - assert_false(iframeEntries[2].url.includes("#main"), "iframe entry 2 should not contain main frame hash"); - - // Verify no main frame entries contain iframe hashes - for (let entry of mainEntries) { - assert_false(entry.url.includes("#iframe"), "main frame entry should not contain iframe hash: " + entry.url); - } + assert_true(iframeEntries[0].url.includes(initialIframeURL.split('#')[0]), "iframe entry 0 should be iframe URL"); + assert_true(iframeEntries[1].url.endsWith("#iframe1"), "iframe entry 1 should end with #iframe1"); + assert_true(iframeEntries[2].url.endsWith("#iframe2"), "iframe entry 1 should end with #iframe2"); - // Verify no iframe entries contain main frame hashes - for (let entry of iframeEntries) { + for (let entry of iframeEntries) assert_false(entry.url.includes("#main"), "iframe entry should not contain main frame hash: " + entry.url); - } }, "navigation.entries() for main frame excludes iframe history entries"); </script>