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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/navigation/same-document-scroll-position-restore.html

Issue 1413493005: Update layout tests to work when smooth scrolling is enabled by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: worked on nit Created 5 years, 1 month 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
Index: third_party/WebKit/LayoutTests/http/tests/navigation/same-document-scroll-position-restore.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigation/same-document-scroll-position-restore.html b/third_party/WebKit/LayoutTests/http/tests/navigation/same-document-scroll-position-restore.html
index e4ff4243e84f49103eb549643291a48ab8030c4a..a7f9c4d64aacaa7f5ce90ea504c6200be6163206 100644
--- a/third_party/WebKit/LayoutTests/http/tests/navigation/same-document-scroll-position-restore.html
+++ b/third_party/WebKit/LayoutTests/http/tests/navigation/same-document-scroll-position-restore.html
@@ -3,23 +3,28 @@
<a id="a" href="#bottom">Link to bottom</a>
<div style="height: 1000px"></div>
<a name="bottom"></a>
+<script src="/js-test-resources/js-test.js"></script>
<script>
if (window.testRunner) {
+ window.jsTestIsAsync = true;
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
window.onload = function() {
if (window.eventSender) {
- eventSender.mouseScrollBy(0, -20);
- var a = document.getElementById("a");
- eventSender.mouseMoveTo(a.offsetLeft + 2, a.offsetTop - 798);
- eventSender.mouseDown();
- eventSender.mouseUp();
+ function clickLink() {
+ var a = document.getElementById("a");
+ eventSender.mouseMoveTo(a.offsetLeft + 2, a.offsetTop - 798);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ }
+ eventSender.continuousMouseScrollBy(0, -800);
+ shouldBecomeEqual("window.scrollY == 800", "true", clickLink);
}
};
-var haveSeenHashChange = false;
+var haveSeenHashChange = false;
window.onhashchange = function() {
if (!haveSeenHashChange) {
@@ -27,8 +32,7 @@ window.onhashchange = function() {
history.back();
} else {
document.body.appendChild(document.createTextNode("scrollY should be 800: " + (window.scrollY == 800 ? "PASS" : "FAIL")));
- if (window.testRunner)
- testRunner.notifyDone();
+ finishJSTest();
}
}
</script>

Powered by Google App Engine
This is Rietveld 408576698