Index: LayoutTests/http/tests/navigation/same-document-scroll-position-restore-pushstate.html |
diff --git a/LayoutTests/http/tests/navigation/same-document-scroll-position-restore-pushstate.html b/LayoutTests/http/tests/navigation/same-document-scroll-position-restore-pushstate.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d282ad5bc43edf79769a4b9f44f1f0f234f15a8b |
--- /dev/null |
+++ b/LayoutTests/http/tests/navigation/same-document-scroll-position-restore-pushstate.html |
@@ -0,0 +1,25 @@ |
+<!DOCTYPE html> |
+<body> |
+<script src="../../../resources/js-test.js"></script> |
+<div style="height: 1100px">scroll down...</div> |
+<button id="a">Push State</button> |
+<div id="log"></div> |
+<script> |
+if (window.testRunner) { |
+ testRunner.dumpAsText(); |
+ testRunner.waitUntilDone(); |
+} |
+ |
+window.onload = function() { |
+ window.scrollBy(0, 1000); |
+ history.pushState({}, '', "#a"); |
+ history.pushState({}, '', "#a"); |
+ scrollOffsetY = window.scrollY; |
+ history.back(); |
+ setTimeout(function() { |
+ document.getElementById('log').innerHTML = 'scrollY should be ' + scrollOffsetY + ': ' + (window.scrollY==scrollOffsetY ? "PASS" : "FAIL"); |
vivekg
2015/04/10 09:00:52
Use shouldBe version instead of using getElementBy
Abhijeet Kandalkar Slow
2015/04/10 18:22:17
Done.
|
+ testRunner.notifyDone(); |
+ }, 100); |
Nate Chapin
2015/04/10 17:32:31
100ms is way too long. Ideally this should be call
Abhijeet Kandalkar Slow
2015/04/10 18:22:17
Done.
|
+}; |
+</script> |
+</body> |