Implement icon change notification dump for Chromium's test shell.
authorlevin@chromium.org <levin@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Mar 2013 22:49:41 +0000 (22:49 +0000)
committerlevin@chromium.org <levin@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Mar 2013 22:49:41 +0000 (22:49 +0000)
https://bugs.webkit.org/show_bug.cgi?id=112614

This was previously implemented for some other platforms in r58111
and r116547.

In r122806, fast/dom/icon-url-property.html stopped using it, but
it is useful for tests, so I plan to re-add it to that test again.

Reviewed by Jochen Eisinger.

* DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h:
(WebTestRunner::WebTestProxy::didChangeIcon): Add handler so that
 icon change notifications from WebKit may be logged in test output.
* DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
(WebTestRunner::TestRunner::TestRunner): Expose dumpIconChanges.
(WebTestRunner::TestRunner::reset): Clear the new dump variable.
(WebTestRunner::TestRunner::shouldDumpIconChanges): Expose the dump vairable.
(WebTestRunner):
(WebTestRunner::TestRunner::dumpIconChanges): Implement the test method.
* DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
(TestRunner):
* DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp:
(WebTestRunner::WebTestProxyBase::didChangeIcon):
(WebTestRunner):
* DumpRenderTree/chromium/WebViewHost.cpp:
(WebViewHost::didChangeIcon): Add the output about changing the icon.
* DumpRenderTree/chromium/WebViewHost.h:
(WebViewHost):

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

Tools/ChangeLog
Tools/DumpRenderTree/chromium/TestRunner/public/WebTestProxy.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
Tools/DumpRenderTree/chromium/WebViewHost.h

index 4fb2b6a..3a90bf1 100644 (file)
@@ -1,3 +1,35 @@
+2013-03-18  David Levin  <levin@chromium.org>
+
+        Implement icon change notification dump for Chromium's test shell.
+        https://bugs.webkit.org/show_bug.cgi?id=112614
+
+        This was previously implemented for some other platforms in r58111
+        and r116547.
+
+        In r122806, fast/dom/icon-url-property.html stopped using it, but
+        it is useful for tests, so I plan to re-add it to that test again.
+
+        Reviewed by Jochen Eisinger.
+
+        * DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h:
+        (WebTestRunner::WebTestProxy::didChangeIcon): Add handler so that
+         icon change notifications from WebKit may be logged in test output.
+        * DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
+        (WebTestRunner::TestRunner::TestRunner): Expose dumpIconChanges.
+        (WebTestRunner::TestRunner::reset): Clear the new dump variable.
+        (WebTestRunner::TestRunner::shouldDumpIconChanges): Expose the dump vairable.
+        (WebTestRunner):
+        (WebTestRunner::TestRunner::dumpIconChanges): Implement the test method.
+        * DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
+        (TestRunner):
+        * DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp:
+        (WebTestRunner::WebTestProxyBase::didChangeIcon):
+        (WebTestRunner):
+        * DumpRenderTree/chromium/WebViewHost.cpp:
+        (WebViewHost::didChangeIcon): Add the output about changing the icon.
+        * DumpRenderTree/chromium/WebViewHost.h:
+        (WebViewHost):
+
 2013-03-18  Julie Parent  <jparent@chromium.org>
 
         Cleanup: Move js for treemap and aggregate_results into own js files.
index d4a600b..e5e1d60 100644 (file)
@@ -38,6 +38,7 @@
 #include "WebKit/chromium/public/WebDOMMessageEvent.h"
 #include "WebKit/chromium/public/WebDragOperation.h"
 #include "WebKit/chromium/public/WebEditingAction.h"
+#include "WebKit/chromium/public/WebIconURL.h"
 #include "WebKit/chromium/public/WebNavigationPolicy.h"
 #include "WebKit/chromium/public/WebNavigationType.h"
 #include "WebKit/chromium/public/WebSecurityOrigin.h"
@@ -170,6 +171,7 @@ protected:
     void didFailProvisionalLoad(WebKit::WebFrame*, const WebKit::WebURLError&);
     void didCommitProvisionalLoad(WebKit::WebFrame*, bool isNewNavigation);
     void didReceiveTitle(WebKit::WebFrame*, const WebKit::WebString& title, WebKit::WebTextDirection);
+    void didChangeIcon(WebKit::WebFrame*, WebKit::WebIconURL::Type);
     void didFinishDocumentLoad(WebKit::WebFrame*);
     void didHandleOnloadEvents(WebKit::WebFrame*);
     void didFailLoad(WebKit::WebFrame*, const WebKit::WebURLError&);
@@ -458,6 +460,11 @@ public:
         WebTestProxyBase::didReceiveTitle(frame, title, direction);
         Base::didReceiveTitle(frame, title, direction);
     }
+    virtual void didChangeIcon(WebKit::WebFrame* frame, WebKit::WebIconURL::Type iconType)
+    {
+        WebTestProxyBase::didChangeIcon(frame, iconType);
+        Base::didChangeIcon(frame, iconType);
+    }
     virtual void didFinishDocumentLoad(WebKit::WebFrame* frame)
     {
         WebTestProxyBase::didFinishDocumentLoad(frame);
index 56fffd7..230a719 100644 (file)
@@ -232,6 +232,7 @@ TestRunner::TestRunner(TestInterfaces* interfaces)
     bindMethod("dumpAsText", &TestRunner::dumpAsText);
     bindMethod("dumpChildFramesAsText", &TestRunner::dumpChildFramesAsText);
     bindMethod("dumpChildFrameScrollPositions", &TestRunner::dumpChildFrameScrollPositions);
+    bindMethod("dumpIconChanges", &TestRunner::dumpIconChanges);
     bindMethod("setAudioData", &TestRunner::setAudioData);
     bindMethod("dumpFrameLoadCallbacks", &TestRunner::dumpFrameLoadCallbacks);
     bindMethod("dumpUserGestureInFrameLoadCallbacks", &TestRunner::dumpUserGestureInFrameLoadCallbacks);
@@ -385,6 +386,7 @@ void TestRunner::reset()
     m_generatePixelResults = true;
     m_dumpChildFrameScrollPositions = false;
     m_dumpChildFramesAsText = false;
+    m_dumpIconChanges = false;
     m_dumpAsAudio = false;
     m_dumpFrameLoadCallbacks = false;
     m_dumpUserGestureInFrameLoadCallbacks = false;
@@ -526,6 +528,11 @@ bool TestRunner::shouldDumpTitleChanges() const
     return m_dumpTitleChanges;
 }
 
+bool TestRunner::shouldDumpIconChanges() const
+{
+    return m_dumpIconChanges;
+}
+
 bool TestRunner::shouldDumpCreateView() const
 {
     return m_dumpCreateView;
@@ -1885,6 +1892,12 @@ void TestRunner::dumpChildFramesAsText(const CppArgumentList&, CppVariant* resul
     result->setNull();
 }
 
+void TestRunner::dumpIconChanges(const CppArgumentList&, CppVariant* result)
+{
+    m_dumpIconChanges = true;
+    result->setNull();
+}
+
 void TestRunner::setAudioData(const CppArgumentList& arguments, CppVariant* result)
 {
     result->setNull();
index 02291f9..9a21d09 100644 (file)
@@ -98,6 +98,7 @@ public:
     bool shouldDumpUserGestureInFrameLoadCallbacks() const;
     bool stopProvisionalFrameLoads() const;
     bool shouldDumpTitleChanges() const;
+    bool shouldDumpIconChanges() const;
     bool shouldDumpCreateView() const;
     bool canOpenWindows() const;
     bool shouldDumpResourceLoadCallbacks() const;
@@ -326,6 +327,10 @@ private:
     // It takes no arguments, and ignores any that may be present.
     void dumpChildFramesAsText(const CppArgumentList&, CppVariant*);
 
+    // This function sets a flag that tells the test_shell to print out the
+    // information about icon changes notifications from WebKit.
+    void dumpIconChanges(const CppArgumentList&, CppVariant*);
+
     // Deals with Web Audio WAV file data.
     void setAudioData(const CppArgumentList&, CppVariant*);
 
@@ -584,6 +589,9 @@ private:
     // well.
     bool m_dumpChildFrameScrollPositions;
 
+    // If true, the test_shell will print out the icon change notifications.
+    bool m_dumpIconChanges;
+
     // If true, the test_shell will output a base64 encoded WAVE file.
     bool m_dumpAsAudio;
 
index a756006..ac3ebb7 100644 (file)
@@ -1146,6 +1146,14 @@ void WebTestProxyBase::didReceiveTitle(WebFrame* frame, const WebString& title,
     m_testInterfaces->testRunner()->setTitleTextDirection(direction);
 }
 
+void WebTestProxyBase::didChangeIcon(WebFrame* frame, WebIconURL::Type)
+{
+    if (m_testInterfaces->testRunner()->shouldDumpIconChanges()) {
+        printFrameDescription(m_delegate, frame);
+        m_delegate->printMessage(string(" - didChangeIcons\n"));
+    }
+}
+
 void WebTestProxyBase::didFinishDocumentLoad(WebFrame* frame)
 {
     if (m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) {
index 4bc4590..e6ee303 100644 (file)
@@ -478,6 +478,10 @@ void WebViewHost::didReceiveTitle(WebFrame* frame, const WebString& title, WebTe
     setPageTitle(title);
 }
 
+void WebViewHost::didChangeIcon(WebFrame* , WebIconURL::Type)
+{
+}
+
 void WebViewHost::didNavigateWithinPage(WebFrame* frame, bool isNewNavigation)
 {
     frame->dataSource()->setExtraData(m_pendingExtraData.leakPtr());
index 8ae3e2b..efd44dd 100644 (file)
@@ -190,6 +190,7 @@ class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient,
     virtual void didCommitProvisionalLoad(WebKit::WebFrame*, bool isNewNavigation);
     virtual void didClearWindowObject(WebKit::WebFrame*);
     virtual void didReceiveTitle(WebKit::WebFrame*, const WebKit::WebString&, WebKit::WebTextDirection);
+    virtual void didChangeIcon(WebKit::WebFrame* , WebKit::WebIconURL::Type);
     virtual void didNavigateWithinPage(WebKit::WebFrame*, bool isNewNavigation);
     virtual void willSendRequest(WebKit::WebFrame*, unsigned identifier, WebKit::WebURLRequest&, const WebKit::WebURLResponse&);
 #ifdef WEBKIT_USE_NEW_WEBFILESYSTEMTYPE