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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/scroll-behavior/smooth-scroll/ongoing-smooth-scroll-vertical-rl-anchors.html

Issue 2535753008: Deflake virtual/threaded/fast/scroll-behavior/smooth-scroll/ongoing-smooth-scroll-vertical-rl-ancho… (Closed)
Patch Set: Scroll after verifying initial position. Created 3 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
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <script src="../../../resources/testharness.js"></script> 1 <script src="../../../resources/testharness.js"></script>
2 <script src="../../../resources/testharnessreport.js"></script> 2 <script src="../../../resources/testharnessreport.js"></script>
3 <style> 3 <style>
4 html { 4 html {
5 -webkit-writing-mode: vertical-rl; 5 -webkit-writing-mode: vertical-rl;
6 } 6 }
7 body { 7 body {
8 margin: 0px; 8 margin: 0px;
9 height: 2000px; 9 height: 2000px;
10 width: 2000px; 10 width: 2000px;
11 } 11 }
12 #changer { 12 #changer {
13 background-color: #FF7F7F; 13 background-color: #FF7F7F;
14 width: 0px; 14 width: 10px;
15 } 15 }
16 #anchor { 16 #anchor {
17 width: 1500px; 17 width: 1500px;
18 background-color: #84BE6A; 18 background-color: #84BE6A;
19 } 19 }
20 </style> 20 </style>
21 21
22 <div id="changer"></div> 22 <div id="changer"></div>
23 <div id="anchor"></div> 23 <div id="anchor"></div>
24 24
25 <script> 25 <script>
26 var asyncTest = async_test("Verify smooth scroll interaction with scroll anchr oing on page with vertical-lr writing mode"); 26 var asyncTest = async_test("Verify smooth scroll interaction with scroll ancho ring on page with vertical-lr writing mode");
27 27
28 // The element that will change in height. 28 // The element that will change in height.
29 var ch; 29 var ch;
30 // Initital scroll position.
31 var initialX = -10;
32 var initialY = 0;
30 // Amount to smooth scroll by. 33 // Amount to smooth scroll by.
31 var userScrollX = -205; 34 var userScrollX = -205;
32 var userScrollY = 51; 35 var userScrollY = 51;
33 // Amount to change the height of the element above the viewport. 36 // Amount to change the height of the element above the viewport.
34 var changerX = 100; 37 var changerX = 100;
35 // End position: height of ch + userScroll. 38 // End position: height of ch + userScroll.
36 var endX = -305; 39 var endX = -305;
37 var endY = 51; 40 var endY = 51;
38 41
39 function scrollListener() { 42 function scrollListener() {
40 if (window.scrollX == endX && window.scrollY == endY) { 43 if (window.scrollX == endX && window.scrollY == endY) {
41 asyncTest.done(); 44 asyncTest.done();
42 return; 45 return;
43 } 46 }
44 47
45 if (ch.style.width != "100") 48 if (ch.style.width != "100")
46 ch.style.width = changerX; 49 ch.style.width = changerX;
47 } 50 }
48 51
49 window.onload = function() { 52 window.onload = function() {
50 assert_false(!window.internals, 'This test requires internals'); 53 assert_false(!window.internals, 'This test requires internals');
51 internals.runtimeFlags.scrollAnchoringEnabled = true; 54 internals.runtimeFlags.scrollAnchoringEnabled = true;
52 // Turn on smooth scrolling. 55 // Turn on smooth scrolling.
53 internals.settings.setScrollAnimatorEnabled(true); 56 internals.settings.setScrollAnimatorEnabled(true);
54 57
55 ch = document.getElementById("changer"); 58 ch = document.getElementById("changer");
59 window.scrollTo(initialX, initialY);
56 60
57 // Smooth scroll. 61 asyncTest.step(function() {
58 eventSender.mouseMoveTo(100, 100); 62 assert_equals(window.scrollX, initialX);
59 eventSender.continuousMouseScrollBy(-userScrollX, -userScrollY); 63 assert_equals(window.scrollY, initialY);
60 64
61 document.addEventListener("scroll", scrollListener); 65 // Smooth scroll.
66 eventSender.mouseMoveTo(100, 100);
67 eventSender.continuousMouseScrollBy(-userScrollX, -userScrollY);
68
69 document.addEventListener("scroll", scrollListener);
70 });
62 } 71 }
63 </script> 72 </script>
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698