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

Unified Diff: third_party/WebKit/LayoutTests/inspector-protocol/emulation/device-scale-not-persistant.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-scale-not-persistant.html
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/emulation/device-scale-not-persistant.html b/third_party/WebKit/LayoutTests/inspector-protocol/emulation/device-scale-not-persistant.html
deleted file mode 100644
index c673b7ebc64d5727fa7353495da1fecd929248ca..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/inspector-protocol/emulation/device-scale-not-persistant.html
+++ /dev/null
@@ -1,87 +0,0 @@
-<html>
-<head>
-<script src="../../http/tests/inspector-protocol/resources/inspector-protocol-test.js"></script>
-<script type="text/javascript">
-
-function getCurrentSrc()
-{
- return document.getElementById("image-test").currentSrc;
-}
-
-function test()
-{
- function setScaleFactor(value)
- {
- InspectorTest.log("Set deviceScaleFactor: " + value);
- return InspectorTest.sendCommandPromise("Emulation.setDeviceMetricsOverride", {
- deviceScaleFactor: value,
- width: 1,
- height: 1,
- mobile: false,
- fitWindow: false
- });
- }
-
- function clearScaleFactor(value)
- {
- InspectorTest.log("Clear deviceScaleFactor");
- return InspectorTest.sendCommandPromise("Emulation.clearDeviceMetricsOverride", {});
- }
-
- function reloadPage()
- {
- InspectorTest.log("Reloading Page");
- return new Promise(success => InspectorTest.reloadProtocolTest(false, success));
- }
-
- function getSrcsetImage()
- {
- var runInPage = InspectorTest.evaluateInInspectedPage;
- return new Promise(success => runInPage("getCurrentSrc()", result => success(result.result.result.value)));
- }
-
- function dumpImageSrc()
- {
- return getSrcsetImage().then(src => {
- var relativeSrc = src.substring(src.lastIndexOf("/resources/"));
- InspectorTest.log("Used Image: " + relativeSrc);
- });
- }
-
- var initialImage;
-
- // Test chain functions.
- collectMetrics();
-
- function collectMetrics()
- {
- getSrcsetImage().then(src => initialImage = src).then(setLowResScaleFactor);
- }
-
- function setLowResScaleFactor()
- {
- setScaleFactor(1).then(reloadPage).then(dumpImageSrc).then(setHighResScaleFactor);
- }
-
- function setHighResScaleFactor()
- {
- setScaleFactor(2).then(reloadPage).then(dumpImageSrc).then(clearOverride);
- }
-
- function clearOverride()
- {
- clearScaleFactor().then(reloadPage).then(getSrcsetImage).then(value => {
- var initImageEqCurrentImg = initialImage === value ? "Yes" : "No";
- InspectorTest.log("Current image src equal initial image: " + initImageEqCurrentImg);
- InspectorTest.completeTest();
- });
- }
-}
-
-</script>
-</head>
-<body onload="runTest()">
-<p>Test that srcset does not use wrong image when override scalefactor and then disabled.</p>
-<img id="image-test" src="../resources/square.png" srcset="../resources/square.png 1x, ../resources/square200.png 2x" />
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698