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

Unified Diff: LayoutTests/fast/events/wheelevent-ctrl.html

Issue 768443002: Honor the wheel event canScroll bit instead of trying to infer it from the ctrl modifier (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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 | LayoutTests/fast/events/wheelevent-ctrl-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/events/wheelevent-ctrl.html
diff --git a/LayoutTests/fast/events/wheelevent-ctrl.html b/LayoutTests/fast/events/wheelevent-ctrl.html
index 6b2b45537a9a18b895899062a2620e9274450939..e3e5e87d1f85fa5d02c1972c20ff1f22f00f2a44 100644
--- a/LayoutTests/fast/events/wheelevent-ctrl.html
+++ b/LayoutTests/fast/events/wheelevent-ctrl.html
@@ -20,16 +20,16 @@ function runTest() {
debug('Test mousewheel events over scrollable div');
- debug('With ctrl modifier set');
+ debug('With ctrl modifier set and canScroll set to be false');
wheelEventCount = 0;
eventSender.mouseMoveTo(testDiv.offsetLeft + 5, testDiv.offsetTop + 5);
- eventSender.mouseScrollBy(0, scrollAmount, false, true, "ctrlKey");
+ eventSender.mouseScrollBy(0, scrollAmount, false, true, "ctrlKey", false);
shouldBe("wheelEventCount", "1");
shouldEvaluateTo("deltaY", expectedDeltaY);
shouldBeTrue("ctrlKey");
shouldBe("testDiv.scrollTop", "0");
- debug('Without ctrl');
+ debug('Without ctrl and canScroll set to be default true');
wheelEventCount = 0;
eventSender.mouseMoveTo(testDiv.offsetLeft + 5, testDiv.offsetTop + 5);
eventSender.mouseScrollBy(0, scrollAmount, false, true);
@@ -42,23 +42,32 @@ function runTest() {
debug('Test mousewheel events over the document');
testDiv = document.getElementById('target2');
- debug('With ctrl modifier set');
+ debug('With ctrl modifier set and canScroll set to be false');
wheelEventCount = 0;
eventSender.mouseMoveTo(testDiv.offsetLeft + 5, testDiv.offsetTop + 5);
- eventSender.mouseScrollBy(0, scrollAmount, false, true, "ctrlKey");
+ eventSender.mouseScrollBy(0, scrollAmount, false, true, "ctrlKey", false);
shouldBe("wheelEventCount", "1");
shouldEvaluateTo("deltaY", expectedDeltaY);
shouldBeTrue("ctrlKey");
- shouldBe("document.body.scrollTop", "0");
+ shouldBe("window.scrollY", "0");
- debug('Now without ctrl');
+ debug('With ctrl modifier set and canScroll set to be true');
+ wheelEventCount = 0;
+ eventSender.mouseMoveTo(testDiv.offsetLeft + 5, testDiv.offsetTop + 5);
+ eventSender.mouseScrollBy(0, scrollAmount, false, true, "ctrlKey", true);
+ shouldBe("wheelEventCount", "1");
+ shouldEvaluateTo("deltaY", expectedDeltaY);
+ shouldBeTrue("ctrlKey");
+ shouldBe("window.scrollY", "deltaY");
+
+ debug('Now without ctrl and canScroll set to be default true');
wheelEventCount = 0;
eventSender.mouseMoveTo(testDiv.offsetLeft + 5, testDiv.offsetTop + 5);
eventSender.mouseScrollBy(0, scrollAmount, false, true);
shouldBe("wheelEventCount", "1");
shouldEvaluateTo("deltaY", expectedDeltaY);
shouldBeFalse("ctrlKey");
- shouldBe("window.scrollY", "deltaY");
+ shouldEvaluateTo("window.scrollY", 2 * expectedDeltaY);
}
var wheelEventCount = 0;
« no previous file with comments | « no previous file | LayoutTests/fast/events/wheelevent-ctrl-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698