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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/data/layout_tests/LayoutTests/fast/history/saves-state-after-fragment-nav.html
===================================================================
--- webkit/data/layout_tests/LayoutTests/fast/history/saves-state-after-fragment-nav.html (revision 0)
+++ webkit/data/layout_tests/LayoutTests/fast/history/saves-state-after-fragment-nav.html (revision 20356)
@@ -0,0 +1,47 @@
+<html>
+<script>
+
+// Navigation steps:
+// 1- loads this page
+// 2- loads this page + hash (doesn't call onload)
+// 3- loads a data URL that just navigates back
+// 4- loads this page + hash (calls onload, triggering completion)
+
+function navigateToHash(field) {
+ location.hash = 'hash';
+ field.value = 'test';
+}
+
+function navigateAwayAndBack() {
+ // Assigning to location does not create a history entry, so
+ // instead we simulate a link click.
+ var evt = document.createEvent("MouseEvents");
+ evt.initMouseEvent("click", true, true, window,
+ 0, 0, 0, 0, 0, false, false, false, false, 0, null);
+ document.getElementById('anchor').dispatchEvent(evt);
+}
+
+function runTestStep() {
+ var hash = location.hash;
+ var field = document.getElementById('field');
+
+ if (hash == "") {
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+ }
+ navigateToHash(field);
+ navigateAwayAndBack();
+ } else {
+ document.body.innerHTML = (field.value == '') ? 'FAIL' : 'PASS';
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ }
+}
+
+</script>
+<body onload='runTestStep()' onunload='/*suppress page cache*/'>
+ <input id='field'></input>
+ <a id='anchor' href='data:text/html,<body onload="history.back()"></body>'>go away and come back</a>
+</body>
+</html>
« 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