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

Side by Side Diff: LayoutTests/fast/scroll-behavior/sub-frame-scroll.html

Issue 214953004: Enable Scroll Animation for RenderLayerScrollableArea (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add Layout test Created 6 years, 8 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
« no previous file with comments | « no previous file | Source/core/page/PageAnimator.cpp » ('j') | Source/core/page/PageAnimator.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <style>
5 #scroll {
6 width: 100px;
7 height: 100px;
8 overflow:scroll;
9 }
10
11 #content {
12 width: 10000px;
13 height: 10000px;
14 background-color: blue;
15 }
16 </style>
17 <script src="../../resources/testharness.js"></script>
18 <script src="../../resources/testharnessreport.js"></script>
19 </head>
20 <body>
21 <div id="scroll">
22 <div id="content"></div>
23 </div>
24 <script>
25 /**
26 * This test is to make sure smooth scrolling is turned on sub frame
27 * scrollbars.
28 * Actually animation and calculation is tested by unittest. This only
29 * test that non main frame scrollbars can scroll and they are not just
30 * snapping to the correct position when smooth scrolling is on.
31 */
32 if (window.internals) {
33 window.internals.settings.setScrollAnimatorEnabled(true);
34 }
35
36 function testing() {
37 var div = document.getElementById("scroll");
38
39 test(function() {assert_equals(div.scrollTop, 0)}, "Test starting point" );
40 test(function() {div.scrollByLines(10); assert_not_equals(div.scrollTop, 0)}, "Test div is able to scroll");
41 test(function() {div.scrollTop = 0; assert_equals(div.scrollTop, 0)}, "R eset to starting point");
42
43 var smoothScrollTest = async_test('smooth scrolls');
44 var info = {
45 pos: 0,
46 step: 0
47 };
48
49 div.onscroll = smoothScrollTest.step_func(function() {
50 var cur = div.scrollTop;
51 if (info.step != 0) {
52 assert_true(cur > pos);
53 }
54 info.pos = cur;
55 info.step += 1;
56 });
57
58 test(function() {
59 div.scrollByPages(50);
60 assert_greater_than(info.step, 1);
61 assert_greater_than(div.scrollTop, 0);
62 }, "scroll");
63 smoothScrollTest.done();
64 }
65
66 window.addEventListener('load', testing, false);
67 </script>
68 </body>
69 </html>
OLDNEW
« no previous file with comments | « no previous file | Source/core/page/PageAnimator.cpp » ('j') | Source/core/page/PageAnimator.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698