Title: [146139] trunk/Tools
Revision
146139
Author
le...@chromium.org
Date
2013-03-18 15:49:41 -0700 (Mon, 18 Mar 2013)

Log Message

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):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (146138 => 146139)


--- trunk/Tools/ChangeLog	2013-03-18 22:48:08 UTC (rev 146138)
+++ trunk/Tools/ChangeLog	2013-03-18 22:49:41 UTC (rev 146139)
@@ -1,3 +1,35 @@
+2013-03-18  David Levin  <le...@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  <jpar...@chromium.org>
 
         Cleanup: Move js for treemap and aggregate_results into own js files.

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h (146138 => 146139)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h	2013-03-18 22:48:08 UTC (rev 146138)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h	2013-03-18 22:49:41 UTC (rev 146139)
@@ -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 @@
     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 @@
         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);

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp (146138 => 146139)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp	2013-03-18 22:48:08 UTC (rev 146138)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp	2013-03-18 22:49:41 UTC (rev 146139)
@@ -232,6 +232,7 @@
     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 @@
     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 @@
     return m_dumpTitleChanges;
 }
 
+bool TestRunner::shouldDumpIconChanges() const
+{
+    return m_dumpIconChanges;
+}
+
 bool TestRunner::shouldDumpCreateView() const
 {
     return m_dumpCreateView;
@@ -1885,6 +1892,12 @@
     result->setNull();
 }
 
+void TestRunner::dumpIconChanges(const CppArgumentList&, CppVariant* result)
+{
+    m_dumpIconChanges = true;
+    result->setNull();
+}
+
 void TestRunner::setAudioData(const CppArgumentList& arguments, CppVariant* result)
 {
     result->setNull();

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h (146138 => 146139)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h	2013-03-18 22:48:08 UTC (rev 146138)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h	2013-03-18 22:49:41 UTC (rev 146139)
@@ -98,6 +98,7 @@
     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 @@
     // 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 @@
     // 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;
 

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp (146138 => 146139)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp	2013-03-18 22:48:08 UTC (rev 146138)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp	2013-03-18 22:49:41 UTC (rev 146139)
@@ -1146,6 +1146,14 @@
     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()) {

Modified: trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp (146138 => 146139)


--- trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp	2013-03-18 22:48:08 UTC (rev 146138)
+++ trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp	2013-03-18 22:49:41 UTC (rev 146139)
@@ -478,6 +478,10 @@
     setPageTitle(title);
 }
 
+void WebViewHost::didChangeIcon(WebFrame* , WebIconURL::Type)
+{
+}
+
 void WebViewHost::didNavigateWithinPage(WebFrame* frame, bool isNewNavigation)
 {
     frame->dataSource()->setExtraData(m_pendingExtraData.leakPtr());

Modified: trunk/Tools/DumpRenderTree/chromium/WebViewHost.h (146138 => 146139)


--- trunk/Tools/DumpRenderTree/chromium/WebViewHost.h	2013-03-18 22:48:08 UTC (rev 146138)
+++ trunk/Tools/DumpRenderTree/chromium/WebViewHost.h	2013-03-18 22:49:41 UTC (rev 146139)
@@ -190,6 +190,7 @@
     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
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to