summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/window-open-history-length.html
blob: ab89bc40980d6b5cc36adc2bde38954627491fac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<!DOCTYPE html>
<meta charset="UTF-8">
<title>history.length value on window.open()-ed window</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/helpers.js"></script>
<body></body>
<script>
/*
  When a new window is opened through window.open() it will contain the initial
  empty document, and the history.length value should be 1.
*/

promise_test(async t => {
  const openedWindow = windowOpenNoURL(t);
  assert_equals(openedWindow.history.length, 1,
    "history.length should start at 1 for newly opened window");
}, "Starting history.length for window.open()");

promise_test(async t => {
  const openedWindow = windowOpenAboutBlank(t);
  assert_equals(openedWindow.history.length, 1,
    "history.length should start at 1 for newly opened window");
}, "Starting history.length for window.open(about:blank)");

promise_test(async t => {
  const openedWindow = windowOpen204(t);
  assert_equals(openedWindow.history.length, 1,
    "history.length should start at 1 for newly opened window");
}, "Starting history.length for window.open(url-with-204-response)");
</script>