Fixed Layout Mode should be adjustable from layoutTestController for testing on Chrom...
[WebKit-https.git] / Tools / DumpRenderTree / chromium / LayoutTestController.cpp
index c030e1c0c9fa0e524b8563f22f5086b519dffb0d..834d2e8c923aaebae84be9f41c2dcefe721b5978 100644 (file)
@@ -224,6 +224,8 @@ LayoutTestController::LayoutTestController(TestShell* shell)
     bindMethod("observeStorageTrackerNotifications", &LayoutTestController::observeStorageTrackerNotifications);
     bindMethod("syncLocalStorage", &LayoutTestController::syncLocalStorage);
     bindMethod("setShouldStayOnPageAfterHandlingBeforeUnload", &LayoutTestController::setShouldStayOnPageAfterHandlingBeforeUnload);
+    bindMethod("enableFixedLayoutMode", &LayoutTestController::enableFixedLayoutMode);
+    bindMethod("setFixedLayoutSize", &LayoutTestController::setFixedLayoutSize);
     
     // The fallback method is called when an unknown method is invoked.
     bindFallbackMethod(&LayoutTestController::fallbackMethod);
@@ -1857,6 +1859,25 @@ void LayoutTestController::setShouldStayOnPageAfterHandlingBeforeUnload(const Cp
     result->setNull();
 }
 
+void LayoutTestController::enableFixedLayoutMode(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() <  1 || !arguments[0].isBool())
+        return;
+    bool enableFixedLayout = arguments[0].toBoolean();
+    m_shell->webView()->enableFixedLayoutMode(enableFixedLayout);
+    result->setNull();
+}
+
+void LayoutTestController::setFixedLayoutSize(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() <  2 || !arguments[0].isNumber() || !arguments[1].isNumber())
+        return;
+    int width = arguments[0].toInt32();
+    int height = arguments[1].toInt32();
+    m_shell->webView()->setFixedLayoutSize(WebSize(width, height));
+    result->setNull();
+}
+
 void LayoutTestController::setPluginsEnabled(const CppArgumentList& arguments, CppVariant* result)
 {
     if (arguments.size() > 0 && arguments[0].isBool()) {