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

Side by Side Diff: LayoutTests/fast/dom/iframe-inner-size-scaling.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 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../js/resources/js-test-pre.js"></script> 4 <script src="../js/resources/js-test-pre.js"></script>
5 <script> 5 <script>
6 description("This tests that innerWidth/innerHeight on an frame window r eturns the size of the frame itself in CSS pixels, regardless of page scale."); 6 description("This tests that innerWidth/innerHeight on an frame window r eturns the size of the frame itself in CSS pixels, regardless of page scale.");
7 window.jsTestIsAsync = true; 7 window.jsTestIsAsync = true;
8 8
9 function runTest() { 9 function runTest() {
10 frame = document.getElementById('iframe'); 10 frame = document.getElementById('iframe');
11 originalWidth = frame.contentWindow.innerWidth; 11 originalWidth = frame.contentWindow.innerWidth;
12 originalHeight = frame.contentWindow.innerHeight; 12 originalHeight = frame.contentWindow.innerHeight;
13 13
14 if (window.internals) 14 if (window.eventSender)
15 window.internals.setPageScaleFactor(2, 0, 0); 15 window.eventSender.setPageScaleFactor(2, 0, 0);
16 16
17 shouldBeNonZero("frame.contentWindow.innerWidth"); 17 shouldBeNonZero("frame.contentWindow.innerWidth");
18 shouldBeNonZero("frame.contentWindow.innerHeight"); 18 shouldBeNonZero("frame.contentWindow.innerHeight");
19 shouldBe("frame.contentWindow.innerWidth", "originalWidth"); 19 shouldBe("frame.contentWindow.innerWidth", "originalWidth");
20 shouldBe("frame.contentWindow.innerHeight", "originalHeight"); 20 shouldBe("frame.contentWindow.innerHeight", "originalHeight");
21 finishJSTest(); 21 finishJSTest();
22 } 22 }
23 23
24 window.onload = function() { 24 window.onload = function() {
25 // We must use setTimeout since the innerWidth/innerHeight are not yet valid for the iframe. 25 // We must use setTimeout since the innerWidth/innerHeight are not yet valid for the iframe.
26 window.setTimeout(runTest, 0); 26 window.setTimeout(runTest, 0);
27 } 27 }
28 </script> 28 </script>
29 </head> 29 </head>
30 <body style="width: 1000px; height: 1000px"> 30 <body style="width: 1000px; height: 1000px">
31 <iframe id="iframe" style="width: 100%; height: 100%;"></iframe> 31 <iframe id="iframe" style="width: 100%; height: 100%;"></iframe>
32 <script src="../js/resources/js-test-post.js"></script> 32 <script src="../js/resources/js-test-post.js"></script>
33 </body> 33 </body>
34 </html> 34 </html>
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/elementFromPoint-scaled-scrolled.html ('k') | LayoutTests/fast/dom/window-inner-size-scaling.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698