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

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

Issue 2960023003: [DevTools] Migrate inspector-protocol/emulation tests to new harness (Closed)
Patch Set: 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-protocol/emulation/device-emulation-partial.html
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/emulation/device-emulation-partial.html b/third_party/WebKit/LayoutTests/inspector-protocol/emulation/device-emulation-partial.html
deleted file mode 100644
index a041ec86c0cd75aaeb2543c39477efbdcc2de444..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/inspector-protocol/emulation/device-emulation-partial.html
+++ /dev/null
@@ -1,138 +0,0 @@
-<html>
-<head>
-
-<script src="../../http/tests/inspector-protocol/resources/inspector-protocol-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));
- }
- }
-
- var initialMetrics;
-
- function testPartialOverride(name, value, next)
- {
- var params = {width: 0, height: 0, deviceScaleFactor: 0, mobile: false, fitWindow: false};
- if (name === null) {
- InspectorTest.sendCommandOrDie("Emulation.clearDeviceMetricsOverride", {}, getPageMetrics.bind(null, check));
- } else {
- if (name)
- params[name] = value;
- InspectorTest.sendCommandOrDie("Emulation.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.log("[FAIL]: " + metrics[key] + " instead of " + expected + " for " + key);
- fail = true;
- }
- }
- if (!fail)
- InspectorTest.log(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