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

Side by Side Diff: LayoutTests/fast/events/touch/touch-scaled-scrolled.html

Issue 1301523006: Fixed layout tests to be scroll order agnostic (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 </head> 4 </head>
5 <body onload="runTest();" style="width:2000px;height:2000px;"> 5 <body onload="runTest();" style="width:2000px;height:2000px;">
6 <div>This test is successful if event.clientX/Y are consistent with the generate d input.</div> 6 <div>This test is successful if event.clientX/Y are consistent with the generate d input.</div>
7 <div id="result"></div> 7 <div id="result"></div>
8 <script> 8 <script>
9 function touched(e) { 9 function touched(e) {
10 document.getElementById("result").innerText = e.targetTouches[0].clientX + ' , ' + e.targetTouches[0].clientY; 10 document.getElementById("result").innerText = e.targetTouches[0].clientX + ' , ' + e.targetTouches[0].clientY;
11 if (window.testRunner) 11 if (window.testRunner)
12 window.testRunner.notifyDone() 12 window.testRunner.notifyDone()
13 } 13 }
14 14
15 function runTest() { 15 function runTest() {
16 window.scrollTo(100,100);
majidvp 2015/08/18 20:19:18 Why move this here? client{X,Y} should be independ
bokan 2015/08/19 17:10:45 clientX/Y is relative to the layout viewport, mean
16 if (window.internals) 17 if (window.internals)
17 window.internals.setPageScaleFactor(2); 18 window.internals.setPageScaleFactor(2);
18 window.scrollTo(100,100);
19 19
20 if (window.testRunner) { 20 if (window.testRunner) {
21 testRunner.dumpAsText(); 21 testRunner.dumpAsText();
22 testRunner.waitUntilDone(); 22 testRunner.waitUntilDone();
23 } 23 }
24 24
25 document.addEventListener("touchstart", touched, false); 25 document.addEventListener("touchstart", touched, false);
26 if (window.eventSender && window.internals) { 26 if (window.eventSender && window.internals) {
27 eventSender.clearTouchPoints(); 27 eventSender.clearTouchPoints();
28 eventSender.addTouchPoint(30, 70); 28 eventSender.addTouchPoint(30, 70);
29 eventSender.touchStart(); 29 eventSender.touchStart();
30 } else 30 } else
31 debug("This test requires DumpRenderTree."); 31 debug("This test requires DumpRenderTree.");
32 } 32 }
33 </script> 33 </script>
34 </script> 34 </script>
35 </body> 35 </body>
36 </html> 36 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698