window-open-history-length.html (1163B)
1 <!DOCTYPE html> 2 <meta charset="UTF-8"> 3 <title>history.length value on window.open()-ed window</title> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <script src="resources/helpers.js"></script> 7 <body></body> 8 <script> 9 /* 10 When a new window is opened through window.open() it will contain the initial 11 empty document, and the history.length value should be 1. 12 */ 13 14 promise_test(async t => { 15 const openedWindow = windowOpenNoURL(t); 16 assert_equals(openedWindow.history.length, 1, 17 "history.length should start at 1 for newly opened window"); 18 }, "Starting history.length for window.open()"); 19 20 promise_test(async t => { 21 const openedWindow = windowOpenAboutBlank(t); 22 assert_equals(openedWindow.history.length, 1, 23 "history.length should start at 1 for newly opened window"); 24 }, "Starting history.length for window.open(about:blank)"); 25 26 promise_test(async t => { 27 const openedWindow = windowOpen204(t); 28 assert_equals(openedWindow.history.length, 1, 29 "history.length should start at 1 for newly opened window"); 30 }, "Starting history.length for window.open(url-with-204-response)"); 31 </script>