Title: [147543] trunk/Tools
Revision
147543
Author
[email protected]
Date
2013-04-03 05:33:41 -0700 (Wed, 03 Apr 2013)

Log Message

[Qt] Move logic of simple forwarding functions to TestRunner.
https://bugs.webkit.org/show_bug.cgi?id=113863

Reviewed by Simon Hausmann.

* DumpRenderTree/qt/TestRunnerQt.cpp:
(TestRunner::setTextDirection):
(TestRunner::goBack):
(TestRunner::evaluateScriptInIsolatedWorld):
(TestRunner::addUserStyleSheet):
* DumpRenderTree/qt/TestRunnerQt.h:
(TestRunnerQt):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (147542 => 147543)


--- trunk/Tools/ChangeLog	2013-04-03 12:15:54 UTC (rev 147542)
+++ trunk/Tools/ChangeLog	2013-04-03 12:33:41 UTC (rev 147543)
@@ -1,3 +1,18 @@
+2013-04-03  Zeno Albisser  <[email protected]>
+
+        [Qt] Move logic of simple forwarding functions to TestRunner.
+        https://bugs.webkit.org/show_bug.cgi?id=113863
+
+        Reviewed by Simon Hausmann.
+
+        * DumpRenderTree/qt/TestRunnerQt.cpp:
+        (TestRunner::setTextDirection):
+        (TestRunner::goBack):
+        (TestRunner::evaluateScriptInIsolatedWorld):
+        (TestRunner::addUserStyleSheet):
+        * DumpRenderTree/qt/TestRunnerQt.h:
+        (TestRunnerQt):
+
 2013-04-03  Tor Arne Vestbø  <[email protected]>
 
         [Qt] Disable media support using QuickTime if deployment target != SDK

Modified: trunk/Tools/DumpRenderTree/qt/TestRunnerQt.cpp (147542 => 147543)


--- trunk/Tools/DumpRenderTree/qt/TestRunnerQt.cpp	2013-04-03 12:15:54 UTC (rev 147542)
+++ trunk/Tools/DumpRenderTree/qt/TestRunnerQt.cpp	2013-04-03 12:33:41 UTC (rev 147543)
@@ -421,11 +421,6 @@
     DumpRenderTreeSupportQt::webInspectorExecuteScript(m_drt->pageAdapter(), callId, script);
 }
 
-void TestRunnerQt::goBack()
-{
-    DumpRenderTreeSupportQt::goBack(m_drt->pageAdapter());
-}
-
 void TestRunnerQt::setDefersLoading(bool flag)
 {
     DumpRenderTreeSupportQt::setDefersLoading(m_drt->pageAdapter(), flag);
@@ -746,22 +741,6 @@
         DumpRenderTreeSupportQt::setMockGeolocationPosition(page->handle(), latitude, longitude, accuracy);
 }
 
-void TestRunnerQt::startSpeechInput(const QString& inputElement)
-{
-    // FIXME: Implement for speech input layout tests.
-    // See https://bugs.webkit.org/show_bug.cgi?id=39485.
-}
-
-void TestRunnerQt::evaluateScriptInIsolatedWorld(int worldID, const QString& script)
-{
-    DumpRenderTreeSupportQt::evaluateScriptInIsolatedWorld(m_drt->mainFrameAdapter(), worldID, script);
-}
-
-void TestRunnerQt::addUserStyleSheet(const QString& sourceCode)
-{
-    DumpRenderTreeSupportQt::addUserStyleSheet(m_drt->pageAdapter(), sourceCode);
-}
-
 void TestRunnerQt::removeAllVisitedLinks()
 {
     QWebHistory* history = m_drt->webPage()->history();
@@ -774,16 +753,6 @@
     DumpRenderTreeSupportQt::addURLToRedirect(origin, destination);
 }
 
-void TestRunnerQt::setTextDirection(const QString& directionName)
-{
-    if (directionName == "auto")
-        m_drt->webPage()->triggerAction(QWebPage::SetTextDirectionDefault);
-    else if (directionName == "rtl")
-        m_drt->webPage()->triggerAction(QWebPage::SetTextDirectionRightToLeft);
-    else if (directionName == "ltr")
-        m_drt->webPage()->triggerAction(QWebPage::SetTextDirectionLeftToRight);
-}
-
 void TestRunnerQt::setAlwaysAcceptCookies(bool accept)
 {
     QWebSettings* globalSettings = QWebSettings::globalSettings();
@@ -859,8 +828,15 @@
 {
 }
 
-void TestRunner::setTextDirection(JSStringRef)
+void TestRunner::setTextDirection(JSStringRef directionName)
 {
+    QWebPage* webPage = DumpRenderTree::instance()->webPage();
+    if (JSStringIsEqualToUTF8CString(directionName, "auto"))
+        webPage->triggerAction(QWebPage::SetTextDirectionDefault);
+    else if (JSStringIsEqualToUTF8CString(directionName, "rtl"))
+        webPage->triggerAction(QWebPage::SetTextDirectionRightToLeft);
+    else if (JSStringIsEqualToUTF8CString(directionName, "ltr"))
+        webPage->triggerAction(QWebPage::SetTextDirectionLeftToRight);
 }
 
 void TestRunner::notifyDone()
@@ -990,6 +966,7 @@
 
 void TestRunner::goBack()
 {
+    DumpRenderTreeSupportQt::goBack(DumpRenderTree::instance()->pageAdapter());
 }
 
 JSValueRef TestRunner::originsWithApplicationCache(JSContextRef context)
@@ -1199,6 +1176,7 @@
 
 void TestRunner::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script)
 {
+    DumpRenderTreeSupportQt::evaluateScriptInIsolatedWorld(DumpRenderTree::instance()->mainFrameAdapter(), worldID, JSStringCopyQString(script));
 }
 
 void TestRunner::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script)
@@ -1212,6 +1190,7 @@
 
 void TestRunner::addUserStyleSheet(JSStringRef source, bool allFrames)
 {
+    DumpRenderTreeSupportQt::addUserStyleSheet(DumpRenderTree::instance()->pageAdapter(), JSStringCopyQString(source));
 }
 
 void TestRunner::execCommand(JSStringRef name, JSStringRef value)

Modified: trunk/Tools/DumpRenderTree/qt/TestRunnerQt.h (147542 => 147543)


--- trunk/Tools/DumpRenderTree/qt/TestRunnerQt.h	2013-04-03 12:15:54 UTC (rev 147542)
+++ trunk/Tools/DumpRenderTree/qt/TestRunnerQt.h	2013-04-03 12:33:41 UTC (rev 147543)
@@ -179,8 +179,6 @@
     bool isGeolocationPermissionSet() const { return m_isGeolocationPermissionSet; }
     bool geolocationPermission() const { return m_geolocationPermission; }
 
-    void startSpeechInput(const QString& inputElement);
-
     void addURLToRedirect(const QString& origin, const QString& destination);
 
     /*
@@ -189,11 +187,6 @@
     */
     void setScrollbarPolicy(const QString& orientation, const QString& policy);
 
-    void evaluateScriptInIsolatedWorld(int worldID, const QString& script);
-    void addUserStyleSheet(const QString& sourceCode);
-    
-    void setTextDirection(const QString& directionName);
-    void goBack();
     void setDefersLoading(bool);
     void setAlwaysAcceptCookies(bool);
     void setAlwaysBlockCookies(bool);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to