[chromium] add title text direction attribute to TestRunner
authorjochen@chromium.org <jochen@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Jan 2013 21:34:59 +0000 (21:34 +0000)
committerjochen@chromium.org <jochen@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Jan 2013 21:34:59 +0000 (21:34 +0000)
https://bugs.webkit.org/show_bug.cgi?id=106907

Reviewed by Adam Barth.

* DumpRenderTree/chromium/DRTTestRunner.cpp:
(DRTTestRunner::DRTTestRunner):
(DRTTestRunner::reset):
* DumpRenderTree/chromium/DRTTestRunner.h:
* DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h:
(WebTestRunner::WebTestRunner::setTitleTextDirection):
* DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
(WebTestRunner::TestRunner::TestRunner):
(WebTestRunner::TestRunner::reset):
(WebTestRunner::TestRunner::setTitleTextDirection):
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
(TestRunner):
* DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp:
(WebTestRunner::WebTestProxyBase::didReceiveTitle):
* DumpRenderTree/chromium/WebViewHost.cpp:
(WebViewHost::didReceiveTitle):

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

Tools/ChangeLog
Tools/DumpRenderTree/chromium/DRTTestRunner.cpp
Tools/DumpRenderTree/chromium/DRTTestRunner.h
Tools/DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h
Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp
Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h
Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp
Tools/DumpRenderTree/chromium/WebViewHost.cpp

index 040d7c1..268af6f 100644 (file)
@@ -1,3 +1,28 @@
+2013-01-15  Jochen Eisinger  <jochen@chromium.org>
+
+        [chromium] add title text direction attribute to TestRunner
+        https://bugs.webkit.org/show_bug.cgi?id=106907
+
+        Reviewed by Adam Barth.
+
+        * DumpRenderTree/chromium/DRTTestRunner.cpp:
+        (DRTTestRunner::DRTTestRunner):
+        (DRTTestRunner::reset):
+        * DumpRenderTree/chromium/DRTTestRunner.h:
+        * DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h:
+        (WebTestRunner::WebTestRunner::setTitleTextDirection):
+        * DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
+        (WebTestRunner::TestRunner::TestRunner):
+        (WebTestRunner::TestRunner::reset):
+        (WebTestRunner::TestRunner::setTitleTextDirection):
+        (WebTestRunner):
+        * DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
+        (TestRunner):
+        * DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp:
+        (WebTestRunner::WebTestProxyBase::didReceiveTitle):
+        * DumpRenderTree/chromium/WebViewHost.cpp:
+        (WebViewHost::didReceiveTitle):
+
 2013-01-15  Dirk Pranke  <dpranke@chromium.org>
 
         nrwt: change the default # of locked shards on chromium_win to 1
index 37f2b47..82b769e 100644 (file)
@@ -152,7 +152,6 @@ DRTTestRunner::DRTTestRunner(TestShell* shell)
     // Shared properties.
     // webHistoryItemCount is used by tests in LayoutTests\http\tests\history
     bindProperty("webHistoryItemCount", &m_webHistoryItemCount);
-    bindProperty("titleTextDirection", &m_titleTextDirection);
     bindProperty("interceptPostMessage", &m_interceptPostMessage);
 }
 
@@ -394,7 +393,6 @@ void DRTTestRunner::reset()
         m_shell->webViewHost()->setDeviceScaleFactor(1);
     m_waitUntilDone = false;
     m_webHistoryItemCount.set(0);
-    m_titleTextDirection.set("ltr");
     m_interceptPostMessage.set(false);
 
     webkit_support::SetAcceptAllCookies(false);
index ed4ae55..cf97108 100644 (file)
@@ -44,7 +44,6 @@
 
 #include "TestRunner/src/TestRunner.h"
 #include "WebTask.h"
-#include "WebTextDirection.h"
 #include "platform/WebArrayBufferView.h"
 #include "platform/WebString.h"
 #include "platform/WebURL.h"
@@ -173,10 +172,6 @@ public:
     void setWorkQueueFrozen(bool frozen) { m_workQueue.setFrozen(frozen); }
 
     void setShowDebugLayerTree(bool value) { m_showDebugLayerTree = value; }
-    void setTitleTextDirection(WebKit::WebTextDirection dir)
-    {
-        m_titleTextDirection.set(dir == WebKit::WebTextDirectionLeftToRight ? "ltr" : "rtl");
-    }
 
     bool shouldInterceptPostMessage()
     {
@@ -268,9 +263,6 @@ private:
     // Bound variable counting the number of top URLs visited.
     CppVariant m_webHistoryItemCount;
 
-    // Bound variable tracking the directionality of the <title> tag.
-    CppVariant m_titleTextDirection;
-
     // Bound variable to set whether postMessages should be intercepted or not
     CppVariant m_interceptPostMessage;
 };
index 13cce9f..79a7396 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef WebTestRunner_h
 #define WebTestRunner_h
 
+#include "WebTextDirection.h"
+
 namespace WebKit {
 class WebArrayBufferView;
 class WebPermissionClient;
@@ -72,6 +74,7 @@ public:
     virtual bool sweepHorizontally() const { return false; }
     virtual bool isPrinting() const { return false; }
     virtual bool shouldStayOnPageAfterHandlingBeforeUnload() const { return false; } 
+    virtual void setTitleTextDirection(WebKit::WebTextDirection) { }
 };
 
 }
index 7a6407e..3c3884a 100644 (file)
@@ -184,6 +184,7 @@ TestRunner::TestRunner()
     // Properties.
     bindProperty("workerThreadCount", &TestRunner::workerThreadCount);
     bindProperty("globalFlag", &m_globalFlag);
+    bindProperty("titleTextDirection", &m_titleTextDirection);
     bindProperty("platformName", &m_platformName);
 
     // The following are stubs.
@@ -275,6 +276,7 @@ void TestRunner::reset()
     m_shouldStayOnPageAfterHandlingBeforeUnload = false;
 
     m_globalFlag.set(false);
+    m_titleTextDirection.set("ltr");
     m_platformName.set("chromium");
 
     m_userStyleSheetLocation = WebURL();
@@ -432,6 +434,11 @@ bool TestRunner::shouldStayOnPageAfterHandlingBeforeUnload() const
     return m_shouldStayOnPageAfterHandlingBeforeUnload;
 }
 
+void TestRunner::setTitleTextDirection(WebKit::WebTextDirection dir)
+{
+    m_titleTextDirection.set(dir == WebKit::WebTextDirectionLeftToRight ? "ltr" : "rtl");
+}
+
 void TestRunner::dumpPermissionClientCallbacks(const CppArgumentList&, CppVariant* result)
 {
     m_webPermissions->setDumpCallbacks(true);
index 982b3af..251acee 100644 (file)
@@ -90,6 +90,7 @@ public:
     virtual bool sweepHorizontally() const OVERRIDE;
     virtual bool isPrinting() const OVERRIDE;
     virtual bool shouldStayOnPageAfterHandlingBeforeUnload() const OVERRIDE;
+    virtual void setTitleTextDirection(WebKit::WebTextDirection) OVERRIDE;
 
 protected:
     // FIXME: make these private once the move from DRTTestRunner to TestRunner
@@ -370,6 +371,9 @@ private:
     // Bound variable to return the name of this platform (chromium).
     CppVariant m_platformName;
 
+    // Bound variable tracking the directionality of the <title> tag.
+    CppVariant m_titleTextDirection;
+
     // If true, the test_shell will write a descriptive line for each editing
     // command.
     bool m_dumpEditingCallbacks;
index b7b265d..9ec05ed 100644 (file)
@@ -580,7 +580,7 @@ void WebTestProxyBase::didCommitProvisionalLoad(WebFrame* frame, bool)
     }
 }
 
-void WebTestProxyBase::didReceiveTitle(WebFrame* frame, const WebString& title, WebTextDirection)
+void WebTestProxyBase::didReceiveTitle(WebFrame* frame, const WebString& title, WebTextDirection direction)
 {
     WebCString title8 = title.utf8();
 
@@ -592,6 +592,8 @@ void WebTestProxyBase::didReceiveTitle(WebFrame* frame, const WebString& title,
     if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpTitleChanges())
         m_delegate->printMessage(string("TITLE CHANGED: '") + title8.data() + "'\n");
 
+    if (m_testInterfaces->testRunner())
+        m_testInterfaces->testRunner()->setTitleTextDirection(direction);
 }
 
 void WebTestProxyBase::didFinishDocumentLoad(WebFrame* frame)
index da2e4fb..a9faa99 100644 (file)
@@ -854,7 +854,6 @@ void WebViewHost::didClearWindowObject(WebFrame* frame)
 void WebViewHost::didReceiveTitle(WebFrame* frame, const WebString& title, WebTextDirection direction)
 {
     setPageTitle(title);
-    testRunner()->setTitleTextDirection(direction);
 }
 
 void WebViewHost::didFailLoad(WebFrame* frame, const WebURLError& error)