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

Side by Side Diff: LayoutTests/fast/events/scale-and-scroll-window.html

Issue 18546003: Fix tests to avoid page scale reset when setting page scale. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove internals.setPageScaleFactor, rename eventSender.scalePageBy. Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <style> 3 <style>
4 ::-webkit-scrollbar { 4 ::-webkit-scrollbar {
5 width: 0px; 5 width: 0px;
6 height: 0px; 6 height: 0px;
7 } 7 }
8 </style> 8 </style>
9 <script> 9 <script>
10 window.enablePixelTesting = true; 10 window.enablePixelTesting = true;
11 11
12 function scroll() { 12 function scroll() {
13 // The page scale, as set by window.internals.setPageScaleFactor shoul d not be apparent 13 // The page scale, as set by window.eventSender.setPageScaleFactor sho uld not be apparent
14 // to javascript. So, we expect scrolling to (100,100) to be page coor dinates, rather 14 // to javascript. So, we expect scrolling to (100,100) to be page coor dinates, rather
15 // than device pixels. 15 // than device pixels.
16 window.scrollTo(100,100); 16 window.scrollTo(100,100);
17 17
18 shouldBe("window.document.body.scrollTop", "100"); 18 shouldBe("window.document.body.scrollTop", "100");
19 shouldBe("window.document.body.scrollLeft", "100"); 19 shouldBe("window.document.body.scrollLeft", "100");
20 shouldBe("window.scrollX", "100"); 20 shouldBe("window.scrollX", "100");
21 shouldBe("window.scrollY", "100"); 21 shouldBe("window.scrollY", "100");
22 } 22 }
23 23
24 function scaleWithEventSender() { 24 function scaleWithEventSender() {
25 var scaleFactor = 2.0; 25 var scaleFactor = 2.0;
26 var scaleOffset = 0; 26 var scaleOffset = 0;
27 if (window.internals) { 27 if (window.eventSender) {
28 window.internals.setPageScaleFactor(scaleFactor, scaleOffset, scale Offset); 28 eventSender.setInitialPageScaleOverride(-1);
29 eventSender.setPageScaleFactor(scaleFactor, scaleOffset, scaleOffset );
29 } 30 }
30 } 31 }
31 32
32 function test() { 33 function test() {
33 scaleWithEventSender(); 34 scaleWithEventSender();
34 scroll(); 35 scroll();
35 } 36 }
36 </script> 37 </script>
37 <script src="../js/resources/js-test-pre.js"></script> 38 <script src="../js/resources/js-test-pre.js"></script>
38 </head> 39 </head>
39 <body style="width:2000px; height:2000px; margin:0px;" onload="test();"> 40 <body style="width:2000px; height:2000px; margin:0px;" onload="test();">
40 <div style="left:0; top:0; width:100px; height:100px; position:absolute; bac kground:yellow;"></div> 41 <div style="left:0; top:0; width:100px; height:100px; position:absolute; bac kground:yellow;"></div>
41 <div style="left:100px; top:0; width:100px; height:100px; position:absolute; background:green;"></div> 42 <div style="left:100px; top:0; width:100px; height:100px; position:absolute; background:green;"></div>
42 <div style="left:200px; top:0; width:100px; height:100px; position:absolute; background:blue;"></div> 43 <div style="left:200px; top:0; width:100px; height:100px; position:absolute; background:blue;"></div>
43 44
44 <div style="left:0; top:100px; width:100px; height:100px; position:absolute; background: green;"></div> 45 <div style="left:0; top:100px; width:100px; height:100px; position:absolute; background: green;"></div>
45 <div style="left:100px; top:100px; width:100px; height:100px; position:absol ute; background:blue;"></div> 46 <div style="left:100px; top:100px; width:100px; height:100px; position:absol ute; background:blue;"></div>
46 <div style="left:200px; top:100px; width:100px; height:100px; position:absol ute; background:yellow;"></div> 47 <div style="left:200px; top:100px; width:100px; height:100px; position:absol ute; background:yellow;"></div>
47 48
48 <div id="console"></div> 49 <div id="console"></div>
49 </body> 50 </body>
50 </html> 51 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698