Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Side by Side Diff: LayoutTests/fast/history/history-length-append-subframe-with-hash.html

Issue 201773002: Do not trigger new history entry if iframe URL doesn't change (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix tests. Somehow getting different iframe dump on some bots. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <p id="description"></p>
8 <pre id="console"></pre>
9
10 <script>
11 var jsTestIsAsync = true;
12
13 description('Tests that appending iframe with with no URL and setting its UR L later (including hash part) does not overwrite current history entry.');
14
15 if (window.testRunner)
16 testRunner.clearBackForwardList();
17
18 onload = beginTest;
19
20 function beginTest() {
21 // The frame must be appened both on initial load and after navigating
22 // back. On first load we must set the same SRC as after navigating away .
23 var iframe = document.createElement('iframe');
24 document.body.appendChild(iframe);
25
26 if (location.hash.indexOf('wentBack') == -1) {
27 // Run else code path after going back.
28 location.hash = 'wentBack';
29
30 setFrameSrc();
31
32 // Navigate forward and back to create forward navigation entry.
33 // Must be done outside the load handler to generate history entry.
34 window.setTimeout(function() {
35 location.href = 'data:text/html,<body onload="history.back()">Mu st not see this text!!!</body>';
36 }, 0);
37 } else {
38 window.setTimeout(setFrameSrcAndfinishTest, 100);
39 }
40 }
41
42 function setFrameSrc() {
43 document.querySelector('iframe').src = 'about:blank/#identifier';
44 }
45
46 function setFrameSrcAndfinishTest() {
47 document.querySelector('iframe').src = 'about:blank/#identifier';
48 testRunner.dumpBackForwardList();
49 finishJSTest();
50 }
51 </script>
52 </body>
53 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698