| OLD | NEW |
| 1 function setMetaViewport(override) | 1 function setMetaViewport(override) |
| 2 { | 2 { |
| 3 var VIEWPORTS = { | 3 var VIEWPORTS = { |
| 4 "w=320": "width=320", | 4 "w=320": "width=320", |
| 5 "w=dw": "width=device-width", | 5 "w=dw": "width=device-width", |
| 6 "w=980": "width=980", | 6 "w=980": "width=980", |
| 7 "none": "no viewport (desktop site)" | 7 "none": "no viewport (desktop site)" |
| 8 }; | 8 }; |
| 9 | 9 |
| 10 var viewport = VIEWPORTS["none"]; | 10 var viewport = VIEWPORTS["none"]; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 testMQDimension("height", document.documentElement.clientHeight); | 98 testMQDimension("height", document.documentElement.clientHeight); |
| 99 } | 99 } |
| 100 testJS("document.documentElement.clientHeight"); | 100 testJS("document.documentElement.clientHeight"); |
| 101 testJS("document.documentElement.offsetHeight"); | 101 testJS("document.documentElement.offsetHeight"); |
| 102 testJS("document.documentElement.scrollHeight"); | 102 testJS("document.documentElement.scrollHeight"); |
| 103 if (full) | 103 if (full) |
| 104 testJS("document.body.clientHeight"); | 104 testJS("document.body.clientHeight"); |
| 105 testJS("document.body.offsetHeight"); | 105 testJS("document.body.offsetHeight"); |
| 106 testJS("document.body.scrollHeight"); | 106 testJS("document.body.scrollHeight"); |
| 107 | 107 |
| 108 var measured = document.querySelectorAll(".device-emulation-measure"); |
| 109 for (var i = 0; i < measured.length; ++i) |
| 110 writeResult("measured " + measured[i].getAttribute("type") + ": " + meas
ured[i].offsetWidth + "x" + measured[i].offsetHeight); |
| 111 |
| 108 return results.join("\n"); | 112 return results.join("\n"); |
| 109 } | 113 } |
| 110 | 114 |
| 111 function testJS(expr, unit) | 115 function testJS(expr, unit) |
| 112 { | 116 { |
| 113 if (unit === undefined) | 117 if (unit === undefined) |
| 114 unit = "px"; | 118 unit = "px"; |
| 115 | 119 |
| 116 var ans = eval(expr); | 120 var ans = eval(expr); |
| 117 if (typeof ans == "number") | 121 if (typeof ans == "number") |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 InspectorTest.emulateAndGetMetrics(width, height, deviceScaleFactor, viewpor
t, insets, noReload, callback); | 250 InspectorTest.emulateAndGetMetrics(width, height, deviceScaleFactor, viewpor
t, insets, noReload, callback); |
| 247 | 251 |
| 248 function callback() | 252 function callback() |
| 249 { | 253 { |
| 250 InspectorTest.log(InspectorTest._deviceEmulationResults.join("\n")); | 254 InspectorTest.log(InspectorTest._deviceEmulationResults.join("\n")); |
| 251 InspectorTest.completeTest(); | 255 InspectorTest.completeTest(); |
| 252 } | 256 } |
| 253 }; | 257 }; |
| 254 | 258 |
| 255 }; | 259 }; |
| OLD | NEW |