diff options
Diffstat (limited to 'testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-1.html')
-rw-r--r-- | testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-1.html | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-1.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-1.html new file mode 100644 index 000000000..996942798 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-1.html @@ -0,0 +1,27 @@ +<!doctype html> +<iframe></iframe> +<script> +var t = opener.t; +var iframe = document.getElementsByTagName("iframe")[0]; +var history_length; + +function load_frame(src) { + history_length = history.length; + iframe.src = src; + var button = document.getElementsByTagName("button")[0]; + button.parentNode.removeChild(button); +} + +remove_frame = t.step_func(function() { + try { + opener.assert_equals(history.length, history_length + 1, "History length after loading page in iframe"); + iframe.parentNode.removeChild(iframe); + opener.assert_equals(history.length, history_length, "History length after removing iframe"); + t.done(); + } finally { + window.close(); + } +}); + +</script> +<button onclick="load_frame('discard_iframe_history_1-2.html')">Click here</button> |