OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 | 3 |
4 <script src="../../http/tests/inspector/inspector-test.js"></script> | 4 <script src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></s
cript> |
5 <script src="../../http/tests/inspector/elements-test.js"></script> | |
6 <script src="device-emulation-test.js"></script> | 5 <script src="device-emulation-test.js"></script> |
7 | 6 |
8 <script> | 7 <script> |
9 // This test is based on http://jsbin.com/urowoh/latest. | 8 // This test is based on http://jsbin.com/urowoh/latest. |
10 setMetaViewport(); | 9 setMetaViewport(); |
11 </script> | 10 </script> |
12 | 11 |
13 <style> | 12 <style> |
14 html { | 13 html { |
15 overflow-x: hidden; | 14 overflow-x: hidden; |
(...skipping 23 matching lines...) Expand all Loading... |
39 | 38 |
40 function restore() | 39 function restore() |
41 { | 40 { |
42 function callback(metrics) | 41 function callback(metrics) |
43 { | 42 { |
44 metrics = metrics.value; | 43 metrics = metrics.value; |
45 if (metrics != originalMetrics) | 44 if (metrics != originalMetrics) |
46 InspectorTest._deviceEmulationResults.push("Original metrics not
restored.\n==== Original ===\n" + originalMetrics + "\n==== Restored ====\n" +
metrics); | 45 InspectorTest._deviceEmulationResults.push("Original metrics not
restored.\n==== Original ===\n" + originalMetrics + "\n==== Restored ====\n" +
metrics); |
47 else | 46 else |
48 InspectorTest._deviceEmulationResults.push("Original metrics res
tored correctly."); | 47 InspectorTest._deviceEmulationResults.push("Original metrics res
tored correctly."); |
49 InspectorTest.addResult(InspectorTest._deviceEmulationResults.join("
\n")); | 48 InspectorTest.log(InspectorTest._deviceEmulationResults.join("\n")); |
50 InspectorTest.completeTest(); | 49 InspectorTest.completeTest(); |
51 } | 50 } |
52 | 51 |
53 InspectorTest.applyEmulationAndReload(false, 0, 0, 1, "none", null, unde
fined, InspectorTest.getPageMetrics.bind(InspectorTest, true, callback)); | 52 InspectorTest.applyEmulationAndReload(false, 0, 0, 1, "none", null, unde
fined, InspectorTest.getPageMetrics.bind(InspectorTest, true, callback)); |
54 } | 53 } |
55 } | 54 } |
56 </script> | 55 </script> |
57 | 56 |
58 </head> | 57 </head> |
59 <body onload="runTest()"> | 58 <body onload="runTest()"> |
60 <p> | 59 <p> |
61 Tests that disabling device emulation restores back to original values. | 60 Tests that disabling device emulation restores back to original values. |
62 </p> | 61 </p> |
63 </body> | 62 </body> |
64 </html> | 63 </html> |
OLD | NEW |