Chromium Code Reviews| 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..2b892bd763ac3bee382774cbbdd1450d7d98aac1 |
| --- /dev/null |
| +++ b/LayoutTests/http/tests/navigation/same-document-scroll-position-restore-pushstate.html |
| @@ -0,0 +1,25 @@ |
| +<!DOCTYPE html> |
| +<body> |
| +<script src="/js-test-resources/js-test.js"></script> |
| +<div style="height: 1100px">scroll down...</div> |
| +<button id="a">Push State</button> |
|
Nate Chapin
2015/04/10 19:57:03
Nit: Remove this line.
Abhijeet Kandalkar Slow
2015/04/12 17:54:34
Done.
|
| +<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() { |
| + shouldBeTrue('window.scrollY == scrollOffsetY'); |
| + testRunner.notifyDone(); |
|
Nate Chapin
2015/04/10 19:57:03
Nit: this should have an "if (window.testRunner)"
Abhijeet Kandalkar Slow
2015/04/12 17:54:33
Done.
|
| + }, 0); |
| +}; |
| +</script> |
| +</body> |