| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 | |
| 4 <script src="../../http/tests/inspector-protocol/resources/inspector-protocol-te
st.js"></script> | |
| 5 <script src="../resources/device-emulation-test.js"></script> | |
| 6 | |
| 7 <script> | |
| 8 // This test is based on http://jsbin.com/urowoh/latest. | |
| 9 setMetaViewport(); | |
| 10 </script> | |
| 11 | |
| 12 <style> | |
| 13 html { | |
| 14 overflow-x: hidden; | |
| 15 } | |
| 16 | |
| 17 body { | |
| 18 margin: 0; | |
| 19 min-height: 1000px; | |
| 20 overflow-x: hidden; | |
| 21 } | |
| 22 </style> | |
| 23 | |
| 24 <script> | |
| 25 function test() | |
| 26 { | |
| 27 InspectorTest._deviceEmulationPageUrl = "device-emulation-restore.html"; | |
| 28 InspectorTest._deviceEmulationResults = []; | |
| 29 var originalMetrics; | |
| 30 | |
| 31 InspectorTest.applyEmulationAndReload(false, 0, 0, 1, "none", null, undefine
d, InspectorTest.getPageMetrics.bind(InspectorTest, true, saveMetrics)); | |
| 32 | |
| 33 function saveMetrics(metrics) | |
| 34 { | |
| 35 originalMetrics = metrics.value; | |
| 36 InspectorTest.emulateAndGetMetrics(1200, 1000, 1, "w=320", null, undefin
ed, restore); | |
| 37 } | |
| 38 | |
| 39 function restore() | |
| 40 { | |
| 41 function callback(metrics) | |
| 42 { | |
| 43 metrics = metrics.value; | |
| 44 if (metrics != originalMetrics) | |
| 45 InspectorTest._deviceEmulationResults.push("Original metrics not
restored.\n==== Original ===\n" + originalMetrics + "\n==== Restored ====\n" +
metrics); | |
| 46 else | |
| 47 InspectorTest._deviceEmulationResults.push("Original metrics res
tored correctly."); | |
| 48 InspectorTest.log(InspectorTest._deviceEmulationResults.join("\n")); | |
| 49 InspectorTest.completeTest(); | |
| 50 } | |
| 51 | |
| 52 InspectorTest.applyEmulationAndReload(false, 0, 0, 1, "none", null, unde
fined, InspectorTest.getPageMetrics.bind(InspectorTest, true, callback)); | |
| 53 } | |
| 54 } | |
| 55 </script> | |
| 56 | |
| 57 </head> | |
| 58 <body onload="runTest()"> | |
| 59 <p> | |
| 60 Tests that disabling device emulation restores back to original values. | |
| 61 </p> | |
| 62 </body> | |
| 63 </html> | |
| OLD | NEW |