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

Unified Diff: LayoutTests/inspector/device-emulation/device-emulation-test.js

Issue 1328553003: Store parsed meta viewport even when it's currently disabled. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 3 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: LayoutTests/inspector/device-emulation/device-emulation-test.js
diff --git a/LayoutTests/inspector/device-emulation/device-emulation-test.js b/LayoutTests/inspector/device-emulation/device-emulation-test.js
index c4814f21a73ef7f531eb1b308b6f6b9e310aa166..97281768b7622a14fa3bf7fe7c9033381f4e3a18 100644
--- a/LayoutTests/inspector/device-emulation/device-emulation-test.js
+++ b/LayoutTests/inspector/device-emulation/device-emulation-test.js
@@ -1,4 +1,4 @@
-function setMetaViewport()
+function setMetaViewport(override)
{
var VIEWPORTS = {
"w=320": "width=320",
@@ -14,6 +14,8 @@ function setMetaViewport()
break;
}
}
+ if (override)
+ viewport = VIEWPORTS[override];
if (viewport != VIEWPORTS["none"])
document.write('<meta name="viewport" content="'+viewport+'">');
}
@@ -187,7 +189,7 @@ InspectorTest.getPageMetrics = function(full, callback)
InspectorTest.evaluateInPage("dumpMetrics(" + full + ")", callback);
}
-InspectorTest.applyEmulationAndReload = function(enabled, width, height, deviceScaleFactor, viewport, insets, callback)
+InspectorTest.applyEmulationAndReload = function(enabled, width, height, deviceScaleFactor, viewport, insets, noReload, callback)
{
function PageResizer()
{
@@ -218,15 +220,18 @@ InspectorTest.applyEmulationAndReload = function(enabled, width, height, deviceS
var warning = WebInspector.overridesSupport.warningMessage();
if (warning)
InspectorTest._deviceEmulationResults.push("Emulation warning: " + warning);
- InspectorTest.navigate(InspectorTest._deviceEmulationPageUrl + "?" + viewport, callback);
+ if (noReload)
+ callback();
+ else
+ InspectorTest.navigate(InspectorTest._deviceEmulationPageUrl + "?" + viewport, callback);
}
};
-InspectorTest.emulateAndGetMetrics = function(width, height, deviceScaleFactor, viewport, insets, callback)
+InspectorTest.emulateAndGetMetrics = function(width, height, deviceScaleFactor, viewport, insets, noReload, callback)
{
InspectorTest._deviceEmulationResults.push("Emulating device: " + width + "x" + height + "x" + deviceScaleFactor + " viewport='" + viewport + "'");
var full = !!width && !!height && !!deviceScaleFactor;
- InspectorTest.applyEmulationAndReload(true, width, height, deviceScaleFactor, viewport, insets, InspectorTest.getPageMetrics.bind(InspectorTest, full, printMetrics));
+ InspectorTest.applyEmulationAndReload(true, width, height, deviceScaleFactor, viewport, insets, noReload, InspectorTest.getPageMetrics.bind(InspectorTest, full, printMetrics));
function printMetrics(metrics)
{
@@ -235,11 +240,11 @@ InspectorTest.emulateAndGetMetrics = function(width, height, deviceScaleFactor,
}
};
-InspectorTest.testDeviceEmulation = function(pageUrl, width, height, deviceScaleFactor, viewport, insets)
+InspectorTest.testDeviceEmulation = function(pageUrl, width, height, deviceScaleFactor, viewport, insets, noReload)
{
InspectorTest._deviceEmulationPageUrl = pageUrl;
InspectorTest._deviceEmulationResults = [];
- InspectorTest.emulateAndGetMetrics(width, height, deviceScaleFactor, viewport, insets, callback);
+ InspectorTest.emulateAndGetMetrics(width, height, deviceScaleFactor, viewport, insets, noReload, callback);
function callback()
{
« no previous file with comments | « LayoutTests/inspector/device-emulation/device-emulation-small-dw-expected.txt ('k') | Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698