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

Side by Side Diff: LayoutTests/fast/events/scale-and-scroll-iframe-body.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: Use setPageScaleFactorLimits(). Created 7 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 | 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 window.scrollTo(0, 100); 13 window.scrollTo(0, 100);
14 var frame = document.getElementById('frame'); 14 var frame = document.getElementById('frame');
15 frame.contentDocument.body.scrollTop = 100; 15 frame.contentDocument.body.scrollTop = 100;
16 frame.contentDocument.body.scrollLeft = 100; 16 frame.contentDocument.body.scrollLeft = 100;
17 17
18 shouldBe("frame.contentDocument.body.scrollTop", "100"); 18 shouldBe("frame.contentDocument.body.scrollTop", "100");
19 shouldBe("frame.contentDocument.body.scrollLeft", "100"); 19 shouldBe("frame.contentDocument.body.scrollLeft", "100");
20 shouldBe("frame.contentWindow.scrollX", "100"); 20 shouldBe("frame.contentWindow.scrollX", "100");
21 shouldBe("frame.contentWindow.scrollY", "100"); 21 shouldBe("frame.contentWindow.scrollY", "100");
22 } 22 }
23 23
24 function scaleWithEventSender() { 24 function scaleWithEventSender() {
25 var scaleFactor = 0.5; 25 var scaleFactor = 0.5;
26 var scaleOffset = 0; 26 var scaleOffset = 0;
27 if (window.internals) { 27 if (window.eventSender)
28 window.internals.setPageScaleFactor(scaleFactor, scaleOffset, s caleOffset); 28 eventSender.setPageScaleFactor(scaleFactor, scaleOffset, scaleOf fset);
29 }
30 } 29 }
31 30
32 function test() { 31 function test() {
33 scaleWithEventSender(); 32 scaleWithEventSender();
34 scroll(); 33 scroll();
35 } 34 }
36 </script> 35 </script>
37 <script src="../js/resources/js-test-pre.js"></script> 36 <script src="../js/resources/js-test-pre.js"></script>
38 </head> 37 </head>
39 <body onload="test();" style="height: 2000px"> 38 <body onload="test();" style="height: 2000px">
(...skipping 13 matching lines...) Expand all
53 doc.write("<div style='left:100px; top:100px; width:100px; height:100px; position:absolute; background:blue;'></div>"); 52 doc.write("<div style='left:100px; top:100px; width:100px; height:100px; position:absolute; background:blue;'></div>");
54 doc.write("<div style='left:200px; top:100px; width:100px; height:100px; position:absolute; background:green;'></div>"); 53 doc.write("<div style='left:200px; top:100px; width:100px; height:100px; position:absolute; background:green;'></div>");
55 doc.write("<div style='left:300px; top:100px; width:100px; height:100px; position:absolute; background:blue;'></div>"); 54 doc.write("<div style='left:300px; top:100px; width:100px; height:100px; position:absolute; background:blue;'></div>");
56 doc.write("<div style='left:400px; top:100px; width:100px; height:100px; position:absolute; background:green;'></div>"); 55 doc.write("<div style='left:400px; top:100px; width:100px; height:100px; position:absolute; background:green;'></div>");
57 doc.close(); 56 doc.close();
58 frame.contentDocument.body.style.width = "2000px"; 57 frame.contentDocument.body.style.width = "2000px";
59 frame.contentDocument.body.style.height = "2000px"; 58 frame.contentDocument.body.style.height = "2000px";
60 </script> 59 </script>
61 </body> 60 </body>
62 </html> 61 </html>
OLDNEW
« no previous file with comments | « LayoutTests/fast/events/scale-and-scroll-div.html ('k') | LayoutTests/fast/events/scale-and-scroll-iframe-window.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698