Truly independent web browser
Tests/LibWeb: Make Navigation-object-properties.html deterministic
sideshowbarkerc871d1fbdf9d
diff --git a/Tests/LibWeb/TestConfig.ini b/Tests/LibWeb/TestConfig.iniindex 97fcb8a94d0..0b1646bb85e 100644--- a/Tests/LibWeb/TestConfig.ini+++ b/Tests/LibWeb/TestConfig.ini@@ -1442,9 +1442,6 @@ Text/input/wpt-import/html/webappapis/dynamic-markup-insertion/opening-the-inputText/input/wpt-import/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/016-1.htmlText/input/wpt-import/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/document.open-03-frame.html-; See: https://github.com/LadybirdBrowser/ladybird/issues/7931-Text/input/HTML/Navigation-object-properties.html-; Timing out Fullscreen testsRef/input/wpt-import/fullscreen/rendering/backdrop-iframe.htmlRef/input/wpt-import/fullscreen/rendering/backdrop-inherit.htmldiff --git a/Tests/LibWeb/Text/expected/HTML/Navigation-object-properties.txt b/Tests/LibWeb/Text/expected/HTML/Navigation-object-properties.txtindex ca60c46eb2c..7852288cd7f 100644--- a/Tests/LibWeb/Text/expected/HTML/Navigation-object-properties.txt+++ b/Tests/LibWeb/Text/expected/HTML/Navigation-object-properties.txt@@ -1,5 +1,5 @@entries[length - 1] is current entry: truecurrentEntry is a [object NavigationHistoryEntry]transition is null: true-canGoBack: true+canGoBack: falsecanGoForward: falsediff --git a/Tests/LibWeb/Text/input/HTML/Navigation-object-properties.html b/Tests/LibWeb/Text/input/HTML/Navigation-object-properties.htmlindex ded57e1a1d5..387cbdf8f97 100644--- a/Tests/LibWeb/Text/input/HTML/Navigation-object-properties.html+++ b/Tests/LibWeb/Text/input/HTML/Navigation-object-properties.html@@ -1,16 +1,24 @@<!DOCTYPE html><script src="../include.js"></script><script>- test(() => {- let n = window.navigation;+ // A fresh iframe has a session history of its own, so what came before this test can't change its results.+ asyncTest(async done => {+ const iframe = document.createElement("iframe");+ iframe.srcdoc = "<!DOCTYPE html>";+ await new Promise(resolve => {+ iframe.onload = resolve;+ document.body.appendChild(iframe);+ });- let len = n.entries().length;+ const n = iframe.contentWindow.navigation;+ const len = n.entries().length;println(`entries[length - 1] is current entry: ${n.entries()[len - 1] === n.currentEntry}`);println(`currentEntry is a ${n.currentEntry}`);println(`transition is null: ${n.transition == null}`);println(`canGoBack: ${n.canGoBack}`);- println(`canGoForward: ${n.canGoForward}`);+ println(`canGoForward: ${n.canGoForward}`);+ done();});</script>