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

Unified Diff: third_party/WebKit/LayoutTests/fast/scrolling/scrollbar-prevent-default.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/fast/scrolling/scrollbar-prevent-default.html
diff --git a/third_party/WebKit/LayoutTests/fast/scrolling/scrollbar-prevent-default.html b/third_party/WebKit/LayoutTests/fast/scrolling/scrollbar-prevent-default.html
index 847e77224b25b27981983666113759af21e138c4..aafc4b4a3713d277a5d1bb8eede462e4e75221a3 100644
--- a/third_party/WebKit/LayoutTests/fast/scrolling/scrollbar-prevent-default.html
+++ b/third_party/WebKit/LayoutTests/fast/scrolling/scrollbar-prevent-default.html
@@ -26,6 +26,8 @@
<pre id="console"></pre>
</body>
<script>
+ jsTestIsAsync = true;
+
description('This tests that scrollbars always receive events even when there is an element underneath the scrollbar which swallows the event. In this case an event handler is added to the window which swallows the event but this may also happen with elements underneath of overlay scrollbars.');
if (window.testRunner)
testRunner.dumpAsText();
@@ -39,27 +41,35 @@
receivedMousedownEvent = true;
});
- // Test the frame scrollbar.
- window.scrollTo(0, 10);
- if (window.eventSender) {
- eventSender.mouseMoveTo(window.innerWidth - 5, 1);
- eventSender.mouseDown();
- eventSender.mouseUp();
+ function testFrameScrollbar() {
+ // Test the frame scrollbar.
+ window.scrollTo(0, 10);
+ if (window.eventSender) {
+ eventSender.mouseMoveTo(window.innerWidth - 5, 1);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ }
+ shouldBe('receivedMousedownEvent', 'true');
+ shouldBecomeEqual('window.scrollY', '0', function() {
+ testDivScrollbar();
+ });
}
- shouldBe('window.scrollY', '0');
- shouldBe('receivedMousedownEvent', 'true');
-
- // Test a div scrollbar.
- receivedMousedownEvent = false;
- var subframe = document.getElementById('subframe');
- subframe.scrollTop = 10;
- if (window.eventSender) {
- eventSender.mouseMoveTo(100 - 5, 1);
- eventSender.mouseDown();
- eventSender.mouseUp();
+ function testDivScrollbar() {
+ // Test a div scrollbar.
+ receivedMousedownEvent = false;
+ var subframe = document.getElementById('subframe');
+ subframe.scrollTop = 10;
+ if (window.eventSender) {
+ eventSender.mouseMoveTo(100 - 5, 1);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ }
+ shouldBe('receivedMousedownEvent', 'true');
+ shouldBecomeEqual('subframe.scrollTop', '0', function(){
+ finishJSTest();
+ });
}
- shouldBe('subframe.scrollTop', '0');
- shouldBe('receivedMousedownEvent', 'true');
+ testFrameScrollbar();
</script>

Powered by Google App Engine
This is Rietveld 408576698