OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <meta name="viewport" content="width=800"> | 3 <meta name="viewport" content="width=800"> |
4 <script src="../http/tests/inspector/inspector-test.js"></script> | 4 <script src="../http/tests/inspector/inspector-test.js"></script> |
5 <style> | 5 <style> |
6 html { font-size: 16px; } | 6 html { font-size: 16px; } |
7 body { width: 800px; margin: 0; overflow-y: hidden; } | 7 body { width: 800px; margin: 0; overflow-y: hidden; } |
8 </style> | 8 </style> |
9 <script> | 9 <script> |
10 if (window.internals) | 10 if (window.internals) |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 }, | 54 }, |
55 | 55 |
56 function checkAutosizedWithPageAgent(next) { | 56 function checkAutosizedWithPageAgent(next) { |
57 InspectorTest.evaluateInPage("forceAutosizing(true)", function() { | 57 InspectorTest.evaluateInPage("forceAutosizing(true)", function() { |
58 PageAgent.enable(); | 58 PageAgent.enable(); |
59 assertAutosizingResult(true, next); | 59 assertAutosizingResult(true, next); |
60 }); | 60 }); |
61 }, | 61 }, |
62 | 62 |
63 function checkAutosizedWithDeviceMetrics(next) { | 63 function checkAutosizedWithDeviceMetrics(next) { |
64 PageAgent.invoke_setDeviceMetricsOverride({width: 1920, height: 1200, de
viceScaleFactor: 2, emulateViewport: false, fitWindow: true, textAutosizing: tru
e}, function() { | 64 PageAgent.invoke_setDeviceMetricsOverride({width: 0, height: 0, deviceSc
aleFactor: 0, emulateViewport: true, fitWindow: true}, function() { |
65 assertAutosizingResult(true, next); | 65 assertAutosizingResult(true, next); |
66 }); | 66 }); |
67 }, | 67 }, |
68 | 68 |
69 function checkNotAutosizedWithDeviceMetrics(next) { | 69 function checkNotAutosizedWithDeviceMetrics(next) { |
70 PageAgent.invoke_setDeviceMetricsOverride({width: 1920, height: 1200, de
viceScaleFactor: 2, emulateViewport: false, fitWindow: true, textAutosizing: fal
se}, function() { | 70 PageAgent.invoke_setDeviceMetricsOverride({width: 0, height: 0, deviceSc
aleFactor: 0, emulateViewport: false, fitWindow: true}, function() { |
71 assertAutosizingResult(false, next); | 71 assertAutosizingResult(false, next); |
72 }); | 72 }); |
73 }, | 73 }, |
74 | 74 |
75 function checkAutosizedWithoutDeviceMetrics(next) { | 75 function checkAutosizedWithoutDeviceMetrics(next) { |
76 PageAgent.clearDeviceMetricsOverride(function() { | 76 PageAgent.clearDeviceMetricsOverride(function() { |
77 assertAutosizingResult(true, next); | 77 assertAutosizingResult(true, next); |
78 }); | 78 }); |
79 }, | 79 }, |
80 | 80 |
81 function checkNotAutosizedWithoutDeviceMetrics(next) { | 81 function checkNotAutosizedWithoutDeviceMetrics(next) { |
82 InspectorTest.evaluateInPage("forceAutosizing(false)", function() { | 82 InspectorTest.evaluateInPage("forceAutosizing(false)", function() { |
83 PageAgent.clearDeviceMetricsOverride(function() { | 83 PageAgent.clearDeviceMetricsOverride(function() { |
84 assertAutosizingResult(false, next); | 84 assertAutosizingResult(false, next); |
85 }); | 85 }); |
86 }); | 86 }); |
87 }, | 87 }, |
88 | 88 |
89 function checkAutosizedWhenDeviceMetricsOverrideSettings(next) { | 89 function checkAutosizedWhenDeviceMetricsOverrideSettings(next) { |
90 InspectorTest.evaluateInPage("forceAutosizing(false)", function() { | 90 InspectorTest.evaluateInPage("forceAutosizing(false)", function() { |
91 PageAgent.invoke_setDeviceMetricsOverride({width: 1920, height: 1200,
deviceScaleFactor: 2, emulateViewport: false, fitWindow: true, textAutosizing: t
rue}, function() { | 91 PageAgent.invoke_setDeviceMetricsOverride({width: 0, height: 0, device
ScaleFactor: 0, emulateViewport: true, fitWindow: true}, function() { |
92 assertAutosizingResult(true, next); | 92 assertAutosizingResult(true, next); |
93 }); | 93 }); |
94 }); | 94 }); |
95 }, | 95 }, |
96 | 96 |
97 function cleanup(next) { | 97 function cleanup(next) { |
98 InspectorTest.evaluateInPage("var el = document.getElementById('measure'
); el.parentNode.removeChild(el);", next); | 98 PageAgent.clearDeviceMetricsOverride(function() { |
| 99 InspectorTest.evaluateInPage("var el = document.getElementById('measur
e'); el.parentNode.removeChild(el);", next); |
| 100 }); |
99 } | 101 } |
100 ]); | 102 ]); |
101 } | 103 } |
102 </script> | 104 </script> |
103 </head> | 105 </head> |
104 <body onload="runTest()"> | 106 <body onload="runTest()"> |
105 <div id="measure"> | 107 <div id="measure"> |
106 This text should be autosized to 40px computed font-size (16 * 800/320).<br/> | 108 This text should be autosized to 40px computed font-size (16 * 800/320).<br/> |
107 FAIL IF THIS IS VISIBLE<br/> | 109 FAIL IF THIS IS VISIBLE<br/> |
108 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempo
r incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nos
trud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis
aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugia
t nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa
qui officia deserunt mollit anim id est laborum. | 110 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempo
r incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nos
trud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis
aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugia
t nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa
qui officia deserunt mollit anim id est laborum. |
109 </div> | 111 </div> |
110 </body> | 112 </body> |
111 </html> | 113 </html> |
OLD | NEW |