| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="device-mode-test.js"></script> | 4 <script src="device-mode-test.js"></script> |
| 5 <script type="text/javascript"> | 5 <script type="text/javascript"> |
| 6 function test() | 6 function test() |
| 7 { | 7 { |
| 8 var phone0 = InspectorTest.buildFakePhone(); | 8 var phone0 = InspectorTest.buildFakePhone(); |
| 9 var phone1 = InspectorTest.buildFakePhone(); | 9 var phone1 = InspectorTest.buildFakePhone(); |
| 10 | 10 |
| 11 var view = new Emulation.DeviceModeView(); | 11 var view = new Emulation.DeviceModeView(); |
| 12 var toolbar = view._toolbar; | 12 var toolbar = view._toolbar; |
| 13 var model = view._model; | 13 var model = view._model; |
| 14 var viewportSize = new Size(800, 600); | 14 var viewportSize = new UI.Size(800, 600); |
| 15 model.setAvailableSize(viewportSize, viewportSize); | 15 model.setAvailableSize(viewportSize, viewportSize); |
| 16 | 16 |
| 17 InspectorTest.addResult("\nTest that devices remember their scale."); | 17 InspectorTest.addResult("\nTest that devices remember their scale."); |
| 18 InspectorTest.addResult("Switch to phone 0"); | 18 InspectorTest.addResult("Switch to phone 0"); |
| 19 toolbar._emulateDevice(phone0); | 19 toolbar._emulateDevice(phone0); |
| 20 InspectorTest.addResult("Setting scale to 0.5"); | 20 InspectorTest.addResult("Setting scale to 0.5"); |
| 21 toolbar._onScaleMenuChanged(0.5); | 21 toolbar._onScaleMenuChanged(0.5); |
| 22 InspectorTest.addResult("Phone0 Scale: " + model._scaleSetting.get()); | 22 InspectorTest.addResult("Phone0 Scale: " + model._scaleSetting.get()); |
| 23 InspectorTest.addResult("Switch to phone 1"); | 23 InspectorTest.addResult("Switch to phone 1"); |
| 24 toolbar._emulateDevice(phone1); | 24 toolbar._emulateDevice(phone1); |
| 25 InspectorTest.addResult("Phone1 Scale: " + model._scaleSetting.get()); | 25 InspectorTest.addResult("Phone1 Scale: " + model._scaleSetting.get()); |
| 26 InspectorTest.addResult("Switch to phone 0"); | 26 InspectorTest.addResult("Switch to phone 0"); |
| 27 toolbar._emulateDevice(phone0); | 27 toolbar._emulateDevice(phone0); |
| 28 InspectorTest.addResult("Phone0 Scale: " + model._scaleSetting.get()); | 28 InspectorTest.addResult("Phone0 Scale: " + model._scaleSetting.get()); |
| 29 | 29 |
| 30 InspectorTest.completeTest(); | 30 InspectorTest.completeTest(); |
| 31 } | 31 } |
| 32 | 32 |
| 33 </script> | 33 </script> |
| 34 </head> | 34 </head> |
| 35 <body onload="runTest()"> | 35 <body onload="runTest()"> |
| 36 <p>Test preservation of orientation and scale when that switching devices in dev
ice mode.</p> | 36 <p>Test preservation of orientation and scale when that switching devices in dev
ice mode.</p> |
| 37 </body> | 37 </body> |
| 38 </html> | 38 </html> |
| OLD | NEW |