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

Side by Side Diff: LayoutTests/inspector/styles/device-metrics-fit-window.html

Issue 23187005: [DevTools] Use device metrics emulation implemented in content. (Closed) Base URL: svn://svn.chromium.org/blink/trunk/
Patch Set: Another rebase Created 7 years, 2 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
(Empty)
1 <html>
2 <head>
3
4 <style type="text/css" media="screen">
5 body {
6 margin: 0;
7 }
8
9 #main {
10 width: 1024px;
11 }
12 </style>
13
14 <script src="../../http/tests/inspector/inspector-test.js"></script>
15 <script>
16
17 function mainElement()
18 {
19 return document.getElementById("main");
20 }
21
22 function getDimensions()
23 {
24 if (!window.internals)
25 return "Internals is required";
26 return JSON.stringify({
27 width: internals.unscaledViewportRect().width,
28 height: internals.unscaledViewportRect().height,
29 mainWidth: mainElement().offsetWidth,
30 mainHeight: mainElement().offsetHeight,
31 innerWidth: window.innerWidth,
32 innerHeight: window.innerHeight
33 });
34 }
35
36 function test()
37 {
38 PageAgent.enable();
39 setAndDumpOverride(480, 800, 1.1, false, step1);
40
41 function step1()
42 {
43 setAndDumpOverride(480, 800, 1.1, true, InspectorTest.completeTest.bind( InspectorTest));
44 }
45
46 function setAndDumpOverride(width, height, textSizeRatio, fitWindow, callbac k)
47 {
48 function finalCallback(result)
49 {
50 var value = JSON.parse(result.value);
51 InspectorTest.addResult("document: " + value.width + "x" + value.hei ght + ", #main: " + value.mainWidth + "x" + value.mainHeight + ", window: " + va lue.innerWidth + "x" + value.innerHeight);
52 if (callback)
53 callback();
54 }
55
56 function overrideCallback()
57 {
58 InspectorTest.evaluateInPage("getDimensions()", finalCallback);
59 }
60
61 PageAgent.setDeviceMetricsOverride(width, height, textSizeRatio, fitWind ow, overrideCallback);
62 }
63 }
64 </script>
65 </head>
66
67 <body onload="runTest()">
68 <p>
69 Tests that emulating device metrics with "Fit window" for a small FrameView corr ectly downscales page content.
70 </p>
71
72 <div id="main">
73 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
74 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
75 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
76 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
77 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
78 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
79 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
80 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
81 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
82 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
83 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
84 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
85 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
86 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
87 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
88 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
89 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
90 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
91 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
92 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
93 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
94 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
95 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
96 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
97 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
98 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
99 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
100 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
101 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
102 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
103 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
104 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
105 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
106 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
107 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
108 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
109 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
110 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
111 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
112 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
113 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
114 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
115 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
116 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
117 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
118 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
119 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
120 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
121 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
122 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
123 </div>
124 </body>
125 </html>
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/inspector/styles/device-metrics-fit-window-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698