| Index: third_party/WebKit/LayoutTests/inspector/device-mode/device-mode-switching-devices.html
|
| diff --git a/third_party/WebKit/LayoutTests/inspector/device-mode/device-mode-switching-devices.html b/third_party/WebKit/LayoutTests/inspector/device-mode/device-mode-switching-devices.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..3dfab90a910ce93f191347864481dba687fecebf
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/inspector/device-mode/device-mode-switching-devices.html
|
| @@ -0,0 +1,62 @@
|
| +<html>
|
| +<head>
|
| +<script src="../../http/tests/inspector/inspector-test.js"></script>
|
| +<script src="device-mode.js"></script>
|
| +<script type="text/javascript">
|
| +function test()
|
| +{
|
| + var verticalMode = {
|
| + "title": "default",
|
| + "orientation": "vertical",
|
| + "insets": { "left": 0, "top": 0, "right": 0, "bottom": 0 }
|
| + };
|
| + var horizontalMode = {
|
| + "title": "default",
|
| + "orientation": "horizontal",
|
| + "insets": { "left": 0, "top": 0, "right": 0, "bottom": 0 }
|
| + };
|
| + var phone0 = InspectorTest.buildFakePhone({ "modes": [verticalMode, horizontalMode] });
|
| + var phone1 = InspectorTest.buildFakePhone({ "modes": [verticalMode, horizontalMode] });
|
| + var phoneWithoutHorizontal = InspectorTest.buildFakePhone({ "modes": [verticalMode] });
|
| +
|
| + var view = new WebInspector.DeviceModeView();
|
| + var toolbar = view._toolbar;
|
| + var model = view._model;
|
| + var viewportSize = new Size(800, 600);
|
| + model.setAvailableSize(viewportSize, viewportSize);
|
| +
|
| + InspectorTest.addResult("Testing orientation preservation.");
|
| +
|
| + toolbar._emulateDevice(phone0);
|
| + InspectorTest.addResult("Phone0 Orientation: " + model._mode.orientation);
|
| + InspectorTest.addResult("Setting mode to horizontal");
|
| + model.emulate(WebInspector.DeviceModeModel.Type.Device, phone0, horizontalMode);
|
| + InspectorTest.addResult("Switch to phone 1");
|
| + toolbar._emulateDevice(phone1);
|
| + InspectorTest.addResult("Phone1 Orientation: " + model._mode.orientation);
|
| + toolbar._emulateDevice(phoneWithoutHorizontal);
|
| + InspectorTest.addResult("Phone without horizontal mode Orientation: " + model._mode.orientation);
|
| +
|
| + InspectorTest.addResult("Switch to phone 0");
|
| + toolbar._emulateDevice(phone0);
|
| +
|
| + InspectorTest.addResult("\nTest that devices remember their scale.");
|
| + InspectorTest.addResult("Setting scale to 0.5");
|
| + toolbar._onScaleMenuChanged(0.5);
|
| + InspectorTest.addResult("Phone0 Scale: " + model._scaleSetting.get());
|
| + InspectorTest.addResult("Switch to phone 1");
|
| + toolbar._emulateDevice(phone1);
|
| + InspectorTest.addResult("Phone1 Scale: " + model._scaleSetting.get());
|
| + InspectorTest.addResult("Switch to phone 0");
|
| + toolbar._emulateDevice(phone0);
|
| + InspectorTest.addResult("Phone0 Scale: " + model._scaleSetting.get());
|
| +
|
| + InspectorTest.completeTest();
|
| +}
|
| +
|
| +</script>
|
| +</head>
|
| +<body onload="runTest()">
|
| +<p>Test preservation of orientation and scale when that switching devices in device mode.</p>
|
| +</body>
|
| +</html>
|
|
|