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

Unified Diff: third_party/WebKit/LayoutTests/inspector/device-emulation/device-emulation-partial.html

Issue 1638953002: [DevTools] Migrate device-emulation tests from OverridesSupport to inspector-protocol. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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-emulation/device-emulation-partial.html
diff --git a/third_party/WebKit/LayoutTests/inspector/device-emulation/device-emulation-partial.html b/third_party/WebKit/LayoutTests/inspector/device-emulation/device-emulation-partial.html
deleted file mode 100644
index d58f571ffa005ab211e1e11637de6a70aede6a88..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/inspector/device-emulation/device-emulation-partial.html
+++ /dev/null
@@ -1,138 +0,0 @@
-<html>
-<head>
-
-<script src="../../http/tests/inspector/inspector-test.js"></script>
-
-<style>
-body {
- margin: 0;
- min-height: 1000px;
-}
-</style>
-
-<script>
-function dumpMetrics()
-{
- return JSON.stringify({
- width: window.innerWidth,
- height: window.innerHeight,
- screenWidth: window.screen.width,
- screenHeight: window.screen.height,
- screenX: window.screenX,
- screenY: window.screenY,
- deviceScaleFactor: window.devicePixelRatio
- });
-}
-
-function test()
-{
- function getPageMetrics(callback)
- {
- InspectorTest.evaluateInPage("dumpMetrics()", parse);
-
- function parse(json)
- {
- callback(JSON.parse(json.value));
- }
- }
-
- var initialMetrics;
-
- function testPartialOverride(name, value, next)
- {
- var params = {width: 0, height: 0, deviceScaleFactor: 0, mobile: false, fitWindow: false};
- if (name === null) {
- InspectorTest.PageAgent.clearDeviceMetricsOverride(getPageMetrics.bind(null, check));
- } else {
- if (name)
- params[name] = value;
- InspectorTest.PageAgent.invoke_setDeviceMetricsOverride(params, getPageMetrics.bind(null, check));
- }
-
- function check(metrics)
- {
- var fail = false;
- for (var key in initialMetrics) {
- var expected = key === name ? value : initialMetrics[key];
- if (metrics[key] !== expected) {
- InspectorTest.addResult("[FAIL]: " + metrics[key] + " instead of " + expected + " for " + key);
- fail = true;
- }
- }
- if (!fail)
- InspectorTest.addResult(name ? ("[PASS]: " + name + "=" + value) : "[PASS]");
- next();
- }
- }
-
- InspectorTest.runTestSuite([
- function collectMetrics(next)
- {
- function collect(metrics)
- {
- initialMetrics = metrics;
- next();
- }
- getPageMetrics(collect);
- },
-
- function noOverrides(next)
- {
- testPartialOverride("", 0, next);
- },
-
- function width(next)
- {
- testPartialOverride("width", 300, next);
- },
-
- function height(next)
- {
- testPartialOverride("height", 400, next);
- },
-
- function deviceScaleFactor1(next)
- {
- testPartialOverride("deviceScaleFactor", 1, next);
- },
-
- function deviceScaleFactor2(next)
- {
- testPartialOverride("deviceScaleFactor", 2, next);
- },
-
- function clear(next)
- {
- testPartialOverride(null, null, next);
- },
-
- function anotherWidth(next)
- {
- testPartialOverride("width", 400, next);
- },
-
- function anotherHeight(next)
- {
- testPartialOverride("height", 300, next);
- },
-
- function deviceScaleFactor3(next)
- {
- testPartialOverride("deviceScaleFactor", 3, next);
- },
-
- function clear(next)
- {
- testPartialOverride(null, null, next);
- }
- ]);
-}
-</script>
-
-</head>
-<body onload="runTest()">
-<p>
-Tests that overriding only a single parameter does not affect others.
-</p>
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698