Fixed Layout Mode should be adjustable from layoutTestController for testing on Chrom...
authorfsamuel@chromium.org <fsamuel@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Sep 2011 19:20:27 +0000 (19:20 +0000)
committerfsamuel@chromium.org <fsamuel@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Sep 2011 19:20:27 +0000 (19:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=67723

Reviewed by Adam Barth.

Tools:

* DumpRenderTree/chromium/EventSender.h:
* DumpRenderTree/chromium/LayoutTestController.cpp:
(LayoutTestController::LayoutTestController):
(LayoutTestController::enableFixedLayoutMode):
(LayoutTestController::setFixedLayoutSize):
* DumpRenderTree/chromium/LayoutTestController.h:

LayoutTests:

* platform/chromium/fast/repaint/fixed-layout-360x240-expected.png: Added.
* platform/chromium/fast/repaint/fixed-layout-360x240-expected.txt: Added.
* platform/chromium/fast/repaint/fixed-layout-360x240.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94779 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/chromium/fast/repaint/fixed-layout-360x240-expected.png [new file with mode: 0644]
LayoutTests/platform/chromium/fast/repaint/fixed-layout-360x240-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium/fast/repaint/fixed-layout-360x240.html [new file with mode: 0644]
Tools/ChangeLog
Tools/DumpRenderTree/chromium/EventSender.h
Tools/DumpRenderTree/chromium/LayoutTestController.cpp
Tools/DumpRenderTree/chromium/LayoutTestController.h

index f642934..ab67bf7 100644 (file)
@@ -1,3 +1,14 @@
+2011-09-08  Fady Samuel  <fsamuel@chromium.org>
+
+        Fixed Layout Mode should be adjustable from layoutTestController for testing on Chromium platforms
+        https://bugs.webkit.org/show_bug.cgi?id=67723
+
+        Reviewed by Adam Barth.
+
+        * platform/chromium/fast/repaint/fixed-layout-360x240-expected.png: Added.
+        * platform/chromium/fast/repaint/fixed-layout-360x240-expected.txt: Added.
+        * platform/chromium/fast/repaint/fixed-layout-360x240.html: Added.
+
 2011-04-19  Eric Seidel  <eric@webkit.org>
 
         Reviewed by Ryosuke Niwa.
diff --git a/LayoutTests/platform/chromium/fast/repaint/fixed-layout-360x240-expected.png b/LayoutTests/platform/chromium/fast/repaint/fixed-layout-360x240-expected.png
new file mode 100644 (file)
index 0000000..a8d53a0
Binary files /dev/null and b/LayoutTests/platform/chromium/fast/repaint/fixed-layout-360x240-expected.png differ
diff --git a/LayoutTests/platform/chromium/fast/repaint/fixed-layout-360x240-expected.txt b/LayoutTests/platform/chromium/fast/repaint/fixed-layout-360x240-expected.txt
new file mode 100644 (file)
index 0000000..70bacae
--- /dev/null
@@ -0,0 +1,5 @@
+layer at (0,0) size 360x240
+  RenderView at (0,0) size 360x240
+layer at (0,0) size 360x240
+  RenderBlock {HTML} at (0,0) size 360x240
+    RenderBody {BODY} at (8,8) size 344x224 [bgcolor=#008000]
diff --git a/LayoutTests/platform/chromium/fast/repaint/fixed-layout-360x240.html b/LayoutTests/platform/chromium/fast/repaint/fixed-layout-360x240.html
new file mode 100644 (file)
index 0000000..3da8a6d
--- /dev/null
@@ -0,0 +1,14 @@
+<html>
+<head>
+<script type="text/javascript">
+    function layoutTest()
+    {
+        if (window.layoutTestController) {
+            window.layoutTestController.enableFixedLayoutMode(true);
+            window.layoutTestController.setFixedLayoutSize(360, 240);
+        }
+    }
+</script>
+</head>
+  <body bgcolor='green' onload='layoutTest();'></body>
+</html>
index 87659a5..d29784b 100644 (file)
@@ -1,3 +1,17 @@
+2011-09-08  Fady Samuel  <fsamuel@chromium.org>
+
+        Fixed Layout Mode should be adjustable from layoutTestController for testing on Chromium platforms
+        https://bugs.webkit.org/show_bug.cgi?id=67723
+
+        Reviewed by Adam Barth.
+
+        * DumpRenderTree/chromium/EventSender.h:
+        * DumpRenderTree/chromium/LayoutTestController.cpp:
+        (LayoutTestController::LayoutTestController):
+        (LayoutTestController::enableFixedLayoutMode):
+        (LayoutTestController::setFixedLayoutSize):
+        * DumpRenderTree/chromium/LayoutTestController.h:
+
 2011-09-07  Matthew Delaney  <mdelaney@apple.com>
 
         Add standalone script that filters the output of build-webkit to be more human-readable
index 388888b..d1d1270 100644 (file)
@@ -72,11 +72,13 @@ public:
     void leapForward(const CppArgumentList&, CppVariant*);
     void keyDown(const CppArgumentList&, CppVariant*);
     void dispatchMessage(const CppArgumentList&, CppVariant*);
+    // FIXME: These aren't really events. They should be moved to layout controller.
     void textZoomIn(const CppArgumentList&, CppVariant*);
     void textZoomOut(const CppArgumentList&, CppVariant*);
     void zoomPageIn(const CppArgumentList&, CppVariant*);
     void zoomPageOut(const CppArgumentList&, CppVariant*);
     void scalePageBy(const CppArgumentList&, CppVariant*);
+
     void mouseScrollBy(const CppArgumentList&, CppVariant*);
     void continuousMouseScrollBy(const CppArgumentList&, CppVariant*);
     void scheduleAsynchronousClick(const CppArgumentList&, CppVariant*);
index c030e1c..834d2e8 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()) {
index d2e0ca1..7a0db0f 100644 (file)
@@ -404,6 +404,9 @@ public:
 
     void setShouldStayOnPageAfterHandlingBeforeUnload(const CppArgumentList&, CppVariant*);
 
+    void enableFixedLayoutMode(const CppArgumentList&, CppVariant*);
+    void setFixedLayoutSize(const CppArgumentList&, CppVariant*);
+
 public:
     // The following methods are not exposed to JavaScript.
     void setWorkQueueFrozen(bool frozen) { m_workQueue.setFrozen(frozen); }