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

Side by Side Diff: webkit/data/layout_tests/LayoutTests/fast/history/saves-state-after-fragment-nav.html

Issue 164465: Merge WebKit r45890 to the 172 (2.0) branch.... (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/branches/172/src/
Patch Set: Created 11 years, 4 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
« no previous file with comments | « no previous file | webkit/data/layout_tests/LayoutTests/fast/history/saves-state-after-fragment-nav-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <html>
2 <script>
3
4 // Navigation steps:
5 // 1- loads this page
6 // 2- loads this page + hash (doesn't call onload)
7 // 3- loads a data URL that just navigates back
8 // 4- loads this page + hash (calls onload, triggering completion)
9
10 function navigateToHash(field) {
11 location.hash = 'hash';
12 field.value = 'test';
13 }
14
15 function navigateAwayAndBack() {
16 // Assigning to location does not create a history entry, so
17 // instead we simulate a link click.
18 var evt = document.createEvent("MouseEvents");
19 evt.initMouseEvent("click", true, true, window,
20 0, 0, 0, 0, 0, false, false, false, false, 0, null);
21 document.getElementById('anchor').dispatchEvent(evt);
22 }
23
24 function runTestStep() {
25 var hash = location.hash;
26 var field = document.getElementById('field');
27
28 if (hash == "") {
29 if (window.layoutTestController) {
30 layoutTestController.dumpAsText();
31 layoutTestController.waitUntilDone();
32 }
33 navigateToHash(field);
34 navigateAwayAndBack();
35 } else {
36 document.body.innerHTML = (field.value == '') ? 'FAIL' : 'PASS';
37 if (window.layoutTestController)
38 layoutTestController.notifyDone();
39 }
40 }
41
42 </script>
43 <body onload='runTestStep()' onunload='/*suppress page cache*/'>
44 <input id='field'></input>
45 <a id='anchor' href='data:text/html,<body onload="history.back()"></body>'>go away and come back</a>
46 </body>
47 </html>
OLDNEW
« no previous file with comments | « no previous file | webkit/data/layout_tests/LayoutTests/fast/history/saves-state-after-fragment-nav-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698