Title: [139443] trunk/Tools
Revision
139443
Author
[email protected]
Date
2013-01-11 07:33:57 -0800 (Fri, 11 Jan 2013)

Log Message

[chromium] move some whitespace and resize related methods to TestRunner library
https://bugs.webkit.org/show_bug.cgi?id=106655

Patch by Dan Carney <[email protected]> on 2013-01-11
Reviewed by Jochen Eisinger.

* DumpRenderTree/chromium/DRTTestRunner.cpp:
(DRTTestRunner::DRTTestRunner):
* DumpRenderTree/chromium/DRTTestRunner.h:
(DRTTestRunner):
* DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h:
(WebKit):
(WebTestRunner::WebTestDelegate::setClientWindowRect):
(WebTestRunner::WebTestDelegate::setSelectTrailingWhitespaceEnabled):
(WebTestRunner::WebTestDelegate::setSmartInsertDeleteEnabled):
* DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
(WebTestRunner::TestRunner::TestRunner):
(WebTestRunner::TestRunner::setSmartInsertDeleteEnabled):
(WebTestRunner):
(WebTestRunner::TestRunner::setSelectTrailingWhitespaceEnabled):
(WebTestRunner::TestRunner::enableAutoResizeMode):
(WebTestRunner::TestRunner::disableAutoResizeMode):
* DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
(TestRunner):
* DumpRenderTree/chromium/WebViewHost.cpp:
(WebViewHost::setClientWindowRect):
* DumpRenderTree/chromium/WebViewHost.h:
(WebViewHost):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (139442 => 139443)


--- trunk/Tools/ChangeLog	2013-01-11 15:33:38 UTC (rev 139442)
+++ trunk/Tools/ChangeLog	2013-01-11 15:33:57 UTC (rev 139443)
@@ -1,3 +1,33 @@
+2013-01-11  Dan Carney  <[email protected]>
+
+        [chromium] move some whitespace and resize related methods to TestRunner library
+        https://bugs.webkit.org/show_bug.cgi?id=106655
+
+        Reviewed by Jochen Eisinger.
+
+        * DumpRenderTree/chromium/DRTTestRunner.cpp:
+        (DRTTestRunner::DRTTestRunner):
+        * DumpRenderTree/chromium/DRTTestRunner.h:
+        (DRTTestRunner):
+        * DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h:
+        (WebKit):
+        (WebTestRunner::WebTestDelegate::setClientWindowRect):
+        (WebTestRunner::WebTestDelegate::setSelectTrailingWhitespaceEnabled):
+        (WebTestRunner::WebTestDelegate::setSmartInsertDeleteEnabled):
+        * DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
+        (WebTestRunner::TestRunner::TestRunner):
+        (WebTestRunner::TestRunner::setSmartInsertDeleteEnabled):
+        (WebTestRunner):
+        (WebTestRunner::TestRunner::setSelectTrailingWhitespaceEnabled):
+        (WebTestRunner::TestRunner::enableAutoResizeMode):
+        (WebTestRunner::TestRunner::disableAutoResizeMode):
+        * DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
+        (TestRunner):
+        * DumpRenderTree/chromium/WebViewHost.cpp:
+        (WebViewHost::setClientWindowRect):
+        * DumpRenderTree/chromium/WebViewHost.h:
+        (WebViewHost):
+
 2013-01-11  Mario Sanchez Prada  <[email protected]>
 
         Unreviewed. Update my e-mail addresses.

Modified: trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp (139442 => 139443)


--- trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp	2013-01-11 15:33:38 UTC (rev 139442)
+++ trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp	2013-01-11 15:33:57 UTC (rev 139443)
@@ -113,14 +113,12 @@
     bindMethod("didLosePointerLock", &DRTTestRunner::didLosePointerLock);
     bindMethod("didNotAcquirePointerLock", &DRTTestRunner::didNotAcquirePointerLock);
 #endif
-    bindMethod("disableAutoResizeMode", &DRTTestRunner::disableAutoResizeMode);
     bindMethod("display", &DRTTestRunner::display);
     bindMethod("displayInvalidatedRegion", &DRTTestRunner::displayInvalidatedRegion);
     bindMethod("dumpBackForwardList", &DRTTestRunner::dumpBackForwardList);
     bindMethod("dumpProgressFinishedCallback", &DRTTestRunner::dumpProgressFinishedCallback);
     bindMethod("dumpSelectionRect", &DRTTestRunner::dumpSelectionRect);
     bindMethod("dumpStatusCallbacks", &DRTTestRunner::dumpWindowStatusChanges);
-    bindMethod("enableAutoResizeMode", &DRTTestRunner::enableAutoResizeMode);
     bindMethod("evaluateInWebInspector", &DRTTestRunner::evaluateInWebInspector);
 #if ENABLE(NOTIFICATIONS)
     bindMethod("grantWebNotificationPermission", &DRTTestRunner::grantWebNotificationPermission);
@@ -151,9 +149,7 @@
 #endif
     bindMethod("setPOSIXLocale", &DRTTestRunner::setPOSIXLocale);
     bindMethod("setPrinting", &DRTTestRunner::setPrinting);
-    bindMethod("setSelectTrailingWhitespaceEnabled", &DRTTestRunner::setSelectTrailingWhitespaceEnabled);
     bindMethod("setBackingScaleFactor", &DRTTestRunner::setBackingScaleFactor);
-    bindMethod("setSmartInsertDeleteEnabled", &DRTTestRunner::setSmartInsertDeleteEnabled);
     bindMethod("setWillSendRequestClearHeader", &DRTTestRunner::setWillSendRequestClearHeader);
     bindMethod("setWillSendRequestReturnsNull", &DRTTestRunner::setWillSendRequestReturnsNull);
     bindMethod("setWillSendRequestReturnsNullOnRedirect", &DRTTestRunner::setWillSendRequestReturnsNullOnRedirect);
@@ -596,54 +592,7 @@
     result->set(webkit_support::RewriteLayoutTestsURL(url).spec());
 }
 
-void DRTTestRunner::setSmartInsertDeleteEnabled(const CppArgumentList& arguments, CppVariant* result)
-{
-    if (arguments.size() > 0 && arguments[0].isBool())
-        m_shell->webViewHost()->setSmartInsertDeleteEnabled(arguments[0].value.boolValue);
-    result->setNull();
-}
 
-void DRTTestRunner::setSelectTrailingWhitespaceEnabled(const CppArgumentList& arguments, CppVariant* result)
-{
-    if (arguments.size() > 0 && arguments[0].isBool())
-        m_shell->webViewHost()->setSelectTrailingWhitespaceEnabled(arguments[0].value.boolValue);
-    result->setNull();
-}
-
-void DRTTestRunner::enableAutoResizeMode(const CppArgumentList& arguments, CppVariant* result)
-{
-    if (arguments.size() != 4) {
-        result->set(false);
-        return;
-    }
-    int minWidth = cppVariantToInt32(arguments[0]);
-    int minHeight = cppVariantToInt32(arguments[1]);
-    WebKit::WebSize minSize(minWidth, minHeight);
-
-    int maxWidth = cppVariantToInt32(arguments[2]);
-    int maxHeight = cppVariantToInt32(arguments[3]);
-    WebKit::WebSize maxSize(maxWidth, maxHeight);
-
-    m_shell->webView()->enableAutoResizeMode(minSize, maxSize);
-    result->set(true);
-}
-
-void DRTTestRunner::disableAutoResizeMode(const CppArgumentList& arguments, CppVariant* result)
-{
-    if (arguments.size() !=2) {
-        result->set(false);
-        return;
-    }
-    int newWidth = cppVariantToInt32(arguments[0]);
-    int newHeight = cppVariantToInt32(arguments[1]);
-    WebKit::WebSize newSize(newWidth, newHeight);
-
-    m_shell->webViewHost()->setWindowRect(WebRect(0, 0, newSize.width, newSize.height));
-    m_shell->webView()->disableAutoResizeMode();
-    m_shell->webView()->resize(newSize);
-    result->set(true);
-}
-
 #if ENABLE(NOTIFICATIONS)
 void DRTTestRunner::grantWebNotificationPermission(const CppArgumentList& arguments, CppVariant* result)
 {

Modified: trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h (139442 => 139443)


--- trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h	2013-01-11 15:33:38 UTC (rev 139442)
+++ trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h	2013-01-11 15:33:57 UTC (rev 139443)
@@ -139,13 +139,6 @@
     // Converts a URL starting with file:///tmp/ to the local mapping.
     void pathToLocalResource(const CppArgumentList&, CppVariant*);
 
-    // Enable or disable smart insert/delete. This is enabled by default.
-    void setSmartInsertDeleteEnabled(const CppArgumentList&, CppVariant*);
-
-    // Enable or disable trailing whitespace selection on double click.
-    void setSelectTrailingWhitespaceEnabled(const CppArgumentList&, CppVariant*);
-    void enableAutoResizeMode(const CppArgumentList&, CppVariant*);
-    void disableAutoResizeMode(const CppArgumentList&, CppVariant*);
     void dumpSelectionRect(const CppArgumentList&, CppVariant*);
 
 #if ENABLE(NOTIFICATIONS)

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h (139442 => 139443)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h	2013-01-11 15:33:38 UTC (rev 139442)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h	2013-01-11 15:33:57 UTC (rev 139443)
@@ -40,6 +40,7 @@
 class WebGamepads;
 class WebIntentRequest;
 struct WebContextMenuData;
+struct WebRect;
 struct WebURLError;
 }
 
@@ -78,6 +79,9 @@
     virtual WebKit::WebIntentRequest* currentWebIntentRequest() { return 0; }
     virtual std::string makeURLErrorDescription(const WebKit::WebURLError&) { return std::string(); }
     virtual std::string normalizeLayoutTestURL(const std::string&) { return std::string(); }
+    virtual void setClientWindowRect(const WebKit::WebRect&) { }
+    virtual void setSelectTrailingWhitespaceEnabled(bool) { }
+    virtual void setSmartInsertDeleteEnabled(bool) { }
 };
 
 }

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp (139442 => 139443)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp	2013-01-11 15:33:38 UTC (rev 139442)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp	2013-01-11 15:33:57 UTC (rev 139443)
@@ -118,6 +118,10 @@
     bindMethod("setPageVisibility", &TestRunner::setPageVisibility);
     bindMethod("setTextDirection", &TestRunner::setTextDirection);
     bindMethod("textSurroundingNode", &TestRunner::textSurroundingNode);
+    bindMethod("disableAutoResizeMode", &TestRunner::disableAutoResizeMode);
+    bindMethod("enableAutoResizeMode", &TestRunner::enableAutoResizeMode);
+    bindMethod("setSmartInsertDeleteEnabled", &TestRunner::setSmartInsertDeleteEnabled);
+    bindMethod("setSelectTrailingWhitespaceEnabled", &TestRunner::setSelectTrailingWhitespaceEnabled);
 
     // The following modify WebPreferences.
     bindMethod("setUserStyleSheetEnabled", &TestRunner::setUserStyleSheetEnabled);
@@ -886,6 +890,54 @@
     result->set(surroundingText.textContent().utf8());
 }
 
+void TestRunner::setSmartInsertDeleteEnabled(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() > 0 && arguments[0].isBool())
+        m_delegate->setSmartInsertDeleteEnabled(arguments[0].value.boolValue);
+    result->setNull();
+}
+
+void TestRunner::setSelectTrailingWhitespaceEnabled(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() > 0 && arguments[0].isBool())
+        m_delegate->setSelectTrailingWhitespaceEnabled(arguments[0].value.boolValue);
+    result->setNull();
+}
+
+void TestRunner::enableAutoResizeMode(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() != 4) {
+        result->set(false);
+        return;
+    }
+    int minWidth = cppVariantToInt32(arguments[0]);
+    int minHeight = cppVariantToInt32(arguments[1]);
+    WebKit::WebSize minSize(minWidth, minHeight);
+
+    int maxWidth = cppVariantToInt32(arguments[2]);
+    int maxHeight = cppVariantToInt32(arguments[3]);
+    WebKit::WebSize maxSize(maxWidth, maxHeight);
+
+    m_webView->enableAutoResizeMode(minSize, maxSize);
+    result->set(true);
+}
+
+void TestRunner::disableAutoResizeMode(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() !=2) {
+        result->set(false);
+        return;
+    }
+    int newWidth = cppVariantToInt32(arguments[0]);
+    int newHeight = cppVariantToInt32(arguments[1]);
+    WebKit::WebSize newSize(newWidth, newHeight);
+
+    m_delegate->setClientWindowRect(WebRect(0, 0, newSize.width, newSize.height));
+    m_webView->disableAutoResizeMode();
+    m_webView->resize(newSize);
+    result->set(true);
+}
+
 void TestRunner::setUserStyleSheetEnabled(const CppArgumentList& arguments, CppVariant* result)
 {
     if (arguments.size() > 0 && arguments[0].isBool()) {

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h (139442 => 139443)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h	2013-01-11 15:33:38 UTC (rev 139442)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h	2013-01-11 15:33:57 UTC (rev 139443)
@@ -169,6 +169,14 @@
     // length to retrieve.
     void textSurroundingNode(const CppArgumentList&, CppVariant*);
 
+    // Enable or disable smart insert/delete. This is enabled by default.
+    void setSmartInsertDeleteEnabled(const CppArgumentList&, CppVariant*);
+
+    // Enable or disable trailing whitespace selection on double click.
+    void setSelectTrailingWhitespaceEnabled(const CppArgumentList&, CppVariant*);
+    void enableAutoResizeMode(const CppArgumentList&, CppVariant*);
+    void disableAutoResizeMode(const CppArgumentList&, CppVariant*);
+
     ///////////////////////////////////////////////////////////////////////////
     // Methods modifying WebPreferences.
 

Modified: trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp (139442 => 139443)


--- trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp	2013-01-11 15:33:38 UTC (rev 139442)
+++ trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp	2013-01-11 15:33:57 UTC (rev 139443)
@@ -1197,6 +1197,11 @@
     // allows both.
 }
 
+void WebViewHost::setClientWindowRect(const WebKit::WebRect& rect)
+{
+    setWindowRect(rect);
+}
+
 void WebViewHost::setLogConsoleOutput(bool enabled)
 {
     m_logConsoleOutput = enabled;

Modified: trunk/Tools/DumpRenderTree/chromium/WebViewHost.h (139442 => 139443)


--- trunk/Tools/DumpRenderTree/chromium/WebViewHost.h	2013-01-11 15:33:38 UTC (rev 139442)
+++ trunk/Tools/DumpRenderTree/chromium/WebViewHost.h	2013-01-11 15:33:57 UTC (rev 139443)
@@ -89,8 +89,6 @@
     WebTestRunner::WebTestProxyBase* proxy() const;
     void setProxy(WebTestRunner::WebTestProxyBase*);
     void reset();
-    void setSelectTrailingWhitespaceEnabled(bool);
-    void setSmartInsertDeleteEnabled(bool);
     void setLogConsoleOutput(bool);
     void waitForPolicyDelegate();
     void setCustomPolicyDelegate(bool, bool);
@@ -150,6 +148,9 @@
     virtual WebKit::WebIntentRequest* currentWebIntentRequest() OVERRIDE;
     virtual std::string makeURLErrorDescription(const WebKit::WebURLError&) OVERRIDE;
     virtual std::string normalizeLayoutTestURL(const std::string&) OVERRIDE;
+    virtual void setSelectTrailingWhitespaceEnabled(bool) OVERRIDE;
+    virtual void setSmartInsertDeleteEnabled(bool) OVERRIDE;
+    virtual void setClientWindowRect(const WebKit::WebRect&) OVERRIDE;
 
     // NavigationHost
     virtual bool navigate(const TestNavigationEntry&, bool reload);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to