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

Unified Diff: third_party/WebKit/LayoutTests/inspector/device-mode/forced-viewport-unobserved.html

Issue 2960263002: [DevTools] Move pixel tests from inspector-protocol to inspector (Closed)
Patch Set: rebased Created 3 years, 6 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
Index: third_party/WebKit/LayoutTests/inspector/device-mode/forced-viewport-unobserved.html
diff --git a/third_party/WebKit/LayoutTests/inspector/device-mode/forced-viewport-unobserved.html b/third_party/WebKit/LayoutTests/inspector/device-mode/forced-viewport-unobserved.html
new file mode 100644
index 0000000000000000000000000000000000000000..d012680a6f8645722713db8f4318887de7293fb9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector/device-mode/forced-viewport-unobserved.html
@@ -0,0 +1,63 @@
+<html>
+<head>
+
+<script src="../../http/tests/inspector/inspector-test.js"></script>
+
+<style>
+html {
+ overflow: hidden;
+}
+
+body {
+ margin: 0;
+ min-height: 1000px;
+ overflow: hidden;
+}
+
+#long {
+ height: 2000px;
+ width: 100px;
+ background-color: green;
+}
+</style>
+
+<script>
+function dump()
+{
+ return {
+ w: window.innerWidth,
+ h: window.innerHeight,
+ l: document.documentElement.scrollLeft,
+ t: document.documentElement.scrollTop
+ };
+}
+
+function test()
+{
+ InspectorTest.EmulationAgent.invoke_forceViewport({x: 200, y: 200, scale: 2.0 }).then(overrideActive);
+
+ function overrideActive()
+ {
+ InspectorTest.RuntimeAgent.invoke_evaluate({expression: 'dump()', returnByValue: true}).then(gotResult);
+ }
+
+ function gotResult(result)
+ {
+ var values = result.result.value;
+ InspectorTest.addResult("innerWidth = " + values.w);
+ InspectorTest.addResult("innerHeight = " + values.h);
+ InspectorTest.addResult("scrollLeft = " + values.l);
+ InspectorTest.addResult("scrollTop = " + values.t);
+ InspectorTest.completeTest();
+ }
+}
+</script>
+
+</head>
+<body onload="runTest()">
+<p>
+Tests that a forced viewport does not change metrics that are observable by the page.
+</p>
+<div id="long"></div>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698