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

Side by Side Diff: LayoutTests/fast/scroll-behavior/scroll-customization/scrollstate-consume-deltas-throw.html

Issue 850443002: Scroll Customization Prototype (Not for review, WIP) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase / cleanup / minor bug fixes Created 5 years, 9 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>ScrollState's consumeDelta method throws on invalid deltas</title>
5 <script src="../../../resources/testharness.js"></script>
6 <script src="../../../resources/testharnessreport.js"></script>
7 </head>
8 <body>
9 <script>
10
11 if (!window.internals || !window.internals.runtimeFlags.scrollCustomizationEnabl ed) {
12 console.log("These tests only work with window.internals exposed, " +
13 "and require scroll customization.");
14 done();
15 }
16
17 function testConsumingDelta(dx, dy, consume_x, consume_y, testName, expectedErro r) {
18 test(function() {
19 var scrollState = new ScrollState(dx, dy);
20 assert_throws('InvalidModificationError', function() {
21 scrollState.consumeDelta(consume_x, consume_y);
22 });
23 }, testName);
24 }
25
26 // Consume from an event with a delta of (5, 5).
27 testConsumingDelta(5, 5, 6, 4, "Overconsumed X");
28 testConsumingDelta(5, 5, 4, 6, "Overconsumed Y");
29 testConsumingDelta(5, 5, -1, 4, "Can't increase X delta");
30 testConsumingDelta(5, 5, 4, -1, "Can't increase Y delta");
31
32 // Consume from an event with a delta of (-5, -5).
33 testConsumingDelta(-5, -5, -6, -4, "Overconsumed X with negative delta");
34 testConsumingDelta(-5, -5, -4, -6, "Overconsumed Y with negative delta");
35 testConsumingDelta(-5, -5, 1, -4, "Can't increase X delta magnitude");
36 testConsumingDelta(-5, -5, -4, 1, "Can't increase Y delta magnitude");
37 </script>
38 </body>
39 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698