diff options
Diffstat (limited to 'testing/web-platform/tests/html/browsers/history/the-location-interface/location_reload.html')
-rw-r--r-- | testing/web-platform/tests/html/browsers/history/the-location-interface/location_reload.html | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location_reload.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_reload.html new file mode 100644 index 0000000000..0a2d21d8d2 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_reload.html @@ -0,0 +1,43 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>location_reload</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body onload="startTest();"> + <div id="log"></div> + + <iframe></iframe> + + <script> + var history_length; + async_test(function(t) { + + var url = new URL("./location_reload-iframe.html", window.location).href; + + window._pingCount = 0; + window._ping = t.step_func(function(innerURL) { + // Some browsers keep 'about:blank' in the session history + if (_pingCount == 0) { + history_length = history.length; + } + assert_equals(url, innerURL, "iframe url (" + _pingCount + ")"); + assert_equals(history_length, history.length, "history length (" + _pingCount + ")"); + _pingCount++; + if (_pingCount == 5) { + t.done(); + } + }); + }); + + function startTest() { + var url = new URL("./location_reload-iframe.html", window.location).href; + var iframe = document.querySelector("iframe"); + iframe.src = url; + history_length = history.length; + } + </script> + + </body> +</html> |