Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Unified Diff: third_party/WebKit/LayoutTests/inspector/device-mode/device-mode-responsive.html

Issue 2446113004: DevTools: add tests for device mode's responsive mode (Closed)
Patch Set: ac Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/device-mode/device-mode-responsive-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/inspector/device-mode/device-mode-responsive.html
diff --git a/third_party/WebKit/LayoutTests/inspector/device-mode/device-mode-responsive.html b/third_party/WebKit/LayoutTests/inspector/device-mode/device-mode-responsive.html
new file mode 100644
index 0000000000000000000000000000000000000000..d6b38487818349457bbd49f7900cbcd57da6ca33
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector/device-mode/device-mode-responsive.html
@@ -0,0 +1,77 @@
+<html>
+<head>
+<script src="../../http/tests/inspector/inspector-test.js"></script>
+<script src="device-mode-test.js"></script>
+<script type="text/javascript">
+function test()
+{
+ var phone0 = InspectorTest.buildFakePhone();
+ var phone1 = InspectorTest.buildFakePhone();
+
+ var view = new WebInspector.DeviceModeView();
+ var toolbar = view._toolbar;
+ var model = view._model;
+ var viewportSize = new Size(320, 480);
+ model.setAvailableSize(viewportSize, viewportSize);
+
+ InspectorTest.addResult("\nSetting device mode to responsive mode with viewport of size: " + JSON.stringify(viewportSize));
+ toolbar._switchToResponsive();
+ dumpModelInfo();
+
+ var width = viewportSize.width - 1;
+ InspectorTest.addResult("Setting width to " + width);
+ toolbar._applyWidth(width);
+ dumpModelInfo();
+
+ width = viewportSize.width + 1;
+ InspectorTest.addResult("Setting width to " + width);
+ toolbar._applyWidth(width);
+ dumpModelInfo();
+
+ InspectorTest.addResult("Setting width to " + viewportSize.width);
+ toolbar._applyWidth(viewportSize.width);
+ dumpModelInfo();
+
+
+ var height = viewportSize.height - 1;
+ InspectorTest.addResult("Setting height to " + height);
+ toolbar._applyHeight(height);
+ dumpModelInfo();
+
+ height = viewportSize.height + 1;
+ InspectorTest.addResult("Setting height to " + height);
+ toolbar._applyHeight(height);
+ dumpModelInfo();
+
+ InspectorTest.addResult("Setting height to " + viewportSize.height);
+ toolbar._applyHeight(viewportSize.height);
+ dumpModelInfo();
+
+
+ InspectorTest.addResult("\nSetting scale to 0.5");
+ toolbar._onScaleMenuChanged(0.5);
+ dumpModelInfo();
+
+ InspectorTest.addResult("Setting scale to 1");
+ toolbar._onScaleMenuChanged(1);
+ dumpModelInfo();
+
+ InspectorTest.addResult("Setting scale to 1.25");
+ toolbar._onScaleMenuChanged(1.25);
+ dumpModelInfo();
+
+ InspectorTest.completeTest();
+
+ function dumpModelInfo()
+ {
+ InspectorTest.addResult("Scale: " + model.scale() + ", appliedDeviceSize: " + JSON.stringify(model.appliedDeviceSize()) + ", screenRect: " + JSON.stringify(model.screenRect()) + ", visiblePageRect: " + JSON.stringify(model.visiblePageRect()) + ", outlineRect: " + JSON.stringify(model.outlineRect()));
+ }
+}
+
+
+</script>
+</head>
+<body onload="runTest()">
+<p>Test that device mode's responsive mode behaves correctly when adjusting inputs.</p>
+</body>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/device-mode/device-mode-responsive-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698