[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

andersca at apple.com andersca at apple.com
Wed Dec 22 11:18:32 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 873314fcf46a2990bb0e75bb6302ebfb1d0244c1
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Jul 18 17:01:19 2010 +0000

    Add dumping of statusbar text to WebKitTestRunner
    https://bugs.webkit.org/show_bug.cgi?id=42516
    
    Reviewed by Dan Bernstein.
    
    WebKit2:
    
    * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
    Add setStatusbarText callback to WKBundlePageUIClient.
    
    * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
    (WebKit::InjectedBundlePageUIClient::setStatusbarText):
    Call setStatusbarText.
    
    * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
    * WebProcess/WebCoreSupport/WebChromeClient.cpp:
    (WebKit::WebChromeClient::setStatusbarText):
    Call the bundle page UI client.
    
    WebKitTools:
    
    * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
    (WTR::InjectedBundlePage::InjectedBundlePage):
    (WTR::InjectedBundlePage::_setStatusbarText):
    (WTR::InjectedBundlePage::setStatusbarText):
    Dump the statusbar text.
    
    * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
    * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
    (WTR::LayoutTestController::LayoutTestController):
    Initialize m_dumpStatusCallbacks to false.
    
    (WTR::dumpStatusCallbacksCallback):
    Implement JSC callback.
    
    (WTR::LayoutTestController::staticFunctions):
    Add dumpStatusCallbacks.
    
    * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
    (WTR::LayoutTestController::dumpStatusCallbacks):
    (WTR::LayoutTestController::setDumpStatusCallbacks):
    Add setter and getter for m_dumpStatusCallbacks.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63627 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index e646798..0132ecf 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,22 @@
+2010-07-18  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Add dumping of statusbar text to WebKitTestRunner
+        https://bugs.webkit.org/show_bug.cgi?id=42516
+
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
+        Add setStatusbarText callback to WKBundlePageUIClient.
+
+        * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
+        (WebKit::InjectedBundlePageUIClient::setStatusbarText):
+        Call setStatusbarText.
+
+        * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::setStatusbarText):
+        Call the bundle page UI client.
+
 2010-07-17  Anders Carlsson  <andersca at apple.com>
 
         Reviewed by Maciej Stachowiak.
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
index e0d3853..b1f107c 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
@@ -61,11 +61,13 @@ typedef struct WKBundlePageLoaderClient WKBundlePageLoaderClient;
 
 // UI Client
 typedef void (*WKBundlePageAddMessageToConsoleCallback)(WKBundlePageRef page, WKStringRef message, uint32_t lineNumber, const void *clientInfo);
+typedef void (*WKBundlePageSetStatusbarTextCallback)(WKBundlePageRef page, WKStringRef statusbarText, const void *clientInfo);
 
 struct WKBundlePageUIClient {
     int                                                                 version;
     const void *                                                        clientInfo;
     WKBundlePageAddMessageToConsoleCallback                             addMessageToConsole;
+    WKBundlePageSetStatusbarTextCallback                                setStatusbarText;
 };
 typedef struct WKBundlePageUIClient WKBundlePageUIClient;
 
diff --git a/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp b/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp
index 2f82904..704322a 100644
--- a/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp
@@ -52,4 +52,10 @@ void InjectedBundlePageUIClient::addMessageToConsole(WebPage* page, const String
         m_client.addMessageToConsole(toRef(page), toRef(message.impl()), lineNumber, m_client.clientInfo);
 }
 
+void InjectedBundlePageUIClient::setStatusbarText(WebPage* page, const String& statusbarText)
+{
+    if (m_client.setStatusbarText)
+        m_client.setStatusbarText(toRef(page), toRef(statusbarText.impl()), m_client.clientInfo);
+}
+
 } // namespace WebKit
diff --git a/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h b/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h
index 45f5ff6..e000d97 100644
--- a/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h
+++ b/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h
@@ -42,6 +42,7 @@ public:
     void initialize(WKBundlePageUIClient*);
 
     void addMessageToConsole(WebPage*, const WebCore::String& message, int32_t lineNumber);
+    void setStatusbarText(WebPage*, const WebCore::String&);
 
 private:
     WKBundlePageUIClient m_client;
diff --git a/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp b/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
index 26ad000..8328a6a 100644
--- a/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
+++ b/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
@@ -230,8 +230,11 @@ bool WebChromeClient::runJavaScriptPrompt(Frame*, const String& message, const S
     return false;
 }
 
-void WebChromeClient::setStatusbarText(const String&)
+void WebChromeClient::setStatusbarText(const String& statusbarText)
 {
+    // Notify the bundle client.
+    m_page->injectedBundleUIClient().setStatusbarText(m_page, statusbarText);
+
     notImplemented();
 }
 
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 768851c..e7633f9 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,32 @@
+2010-07-18  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Add dumping of statusbar text to WebKitTestRunner
+        https://bugs.webkit.org/show_bug.cgi?id=42516
+
+        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+        (WTR::InjectedBundlePage::InjectedBundlePage):
+        (WTR::InjectedBundlePage::_setStatusbarText):
+        (WTR::InjectedBundlePage::setStatusbarText):
+        Dump the statusbar text.
+
+        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
+        * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+        (WTR::LayoutTestController::LayoutTestController):
+        Initialize m_dumpStatusCallbacks to false.
+
+        (WTR::dumpStatusCallbacksCallback):
+        Implement JSC callback.
+
+        (WTR::LayoutTestController::staticFunctions):
+        Add dumpStatusCallbacks.
+
+        * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+        (WTR::LayoutTestController::dumpStatusCallbacks):
+        (WTR::LayoutTestController::setDumpStatusCallbacks):
+        Add setter and getter for m_dumpStatusCallbacks.
+
 2010-07-17  Anders Carlsson  <andersca at apple.com>
 
         Reviewed by Maciej Stachowiak.
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
index b254405..7635238 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
@@ -58,7 +58,8 @@ InjectedBundlePage::InjectedBundlePage(WKBundlePageRef page)
     WKBundlePageUIClient uiClient = {
         0,
         this,
-        _addMessageToConsole
+        _addMessageToConsole,
+        _setStatusbarText
     };
     WKBundlePageSetUIClient(m_page, &uiClient);
 
@@ -198,6 +199,11 @@ void InjectedBundlePage::_addMessageToConsole(WKBundlePageRef page, WKStringRef
     static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->addMessageToConsole(message, lineNumber);
 }
 
+void InjectedBundlePage::_setStatusbarText(WKBundlePageRef page, WKStringRef statusbarText, const void *clientInfo)
+{
+    static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->setStatusbarText(statusbarText);
+}
+
 void InjectedBundlePage::addMessageToConsole(WKStringRef message, uint32_t lineNumber)
 {
     // FIXME: Strip file: urls.
@@ -205,4 +211,13 @@ void InjectedBundlePage::addMessageToConsole(WKStringRef message, uint32_t lineN
     InjectedBundle::shared().os() << "CONSOLE MESSAGE: line " << lineNumber << ": " << utf8Message->data() << "\n";
 }
 
+void InjectedBundlePage::setStatusbarText(WKStringRef statusbarText)
+{
+    if (!InjectedBundle::shared().layoutTestController()->dumpStatusCallbacks())
+        return;
+
+    OwnPtr<Vector<char> > utf8StatusbarText = WKStringToUTF8(statusbarText);
+    InjectedBundle::shared().os() << "UI DELEGATE STATUS CALLBACK: setStatusText:" << utf8StatusbarText << "\n";
+}
+
 } // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
index 79aebb7..062c8ef 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
@@ -61,7 +61,10 @@ private:
 
     // UI Client
     static void _addMessageToConsole(WKBundlePageRef page, WKStringRef message, uint32_t lineNumber, const void *clientInfo);
+    static void _setStatusbarText(WKBundlePageRef page, WKStringRef statusbarText, const void *clientInfo);
+
     void addMessageToConsole(WKStringRef message, uint32_t lineNumber);
+    void setStatusbarText(WKStringRef statusbarText);
 
     WKBundlePageRef m_page;
     bool m_isLoading;
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
index fadd38f..5c5d3d4 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
@@ -42,6 +42,7 @@ PassRefPtr<LayoutTestController> LayoutTestController::create(const std::string&
 
 LayoutTestController::LayoutTestController(const std::string& testPathOrURL)
     : m_dumpAsText(false)
+    , m_dumpStatusCallbacks(false)
     , m_waitToDump(false)
     , m_testRepaint(false)
     , m_testRepaintSweepHorizontally(false)
@@ -133,6 +134,13 @@ static JSValueRef dumpAsTextCallback(JSContextRef context, JSObjectRef function,
     return JSValueMakeUndefined(context);
 }
 
+static JSValueRef dumpStatusCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+    controller->setDumpStatusCallbacks(true);
+    return JSValueMakeUndefined(context);
+}
+
 static JSValueRef waitUntilDoneCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
     LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
@@ -224,6 +232,7 @@ JSStaticFunction* LayoutTestController::staticFunctions()
     static JSStaticFunction staticFunctions[] = {
         { "display", displayCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "dumpAsText", dumpAsTextCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "dumpStatusCallbacks", dumpStatusCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "notifyDone", notifyDoneCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "numberOfActiveAnimations", numberOfActiveAnimationsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "pauseAnimationAtTimeOnElementWithId", pauseAnimationAtTimeOnElementWithIdCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
index f07cc00..a9e9ff7 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
@@ -44,6 +44,9 @@ public:
     bool dumpAsText() const { return m_dumpAsText; }
     void setDumpAsText(bool dumpAsText) { m_dumpAsText = dumpAsText; }
 
+    bool dumpStatusCallbacks() const { return m_dumpStatusCallbacks; }
+    void setDumpStatusCallbacks(bool dumpStatusCallbacks) { m_dumpStatusCallbacks = dumpStatusCallbacks; }
+
     bool waitToDump() const { return m_waitToDump; }
     void setWaitToDump();
     void waitToDumpWatchdogTimerFired();
@@ -61,6 +64,7 @@ private:
     LayoutTestController(const std::string& testPathOrURL);
 
     bool m_dumpAsText;
+    bool m_dumpStatusCallbacks;
     bool m_waitToDump; // True if waitUntilDone() has been called, but notifyDone() has not yet been called.
     bool m_testRepaint;
     bool m_testRepaintSweepHorizontally;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list