Title: [115268] trunk/Tools
Revision
115268
Author
dpra...@chromium.org
Date
2012-04-25 18:03:53 -0700 (Wed, 25 Apr 2012)

Log Message

[chromium] change DRT's "DRT" output to match the other ports
https://bugs.webkit.org/show_bug.cgi?id=84904

Reviewed by Kent Tamura.

Since we run Chromium's DRT in --test-shell mode, the
non-test-shell output has never been really beaten on to make
sure it's right. This fixes a few issues and will be tested
with upcoming NRWT changes that'll land in a separate patch.
In particular we should never output framing text like "\n"
or "#EOF" outside of something outside of TestEventPrinter,
and we weren't handling audio output properly at all.

* DumpRenderTree/chromium/TestEventPrinter.cpp:
(DRTPrinter):
(TestShellPrinter):
(DRTPrinter::handleTextFooter):
(DRTPrinter::handleAudioFooter):
(DRTPrinter::handleTestFooter):
(TestShellPrinter::handleAudioFooter):
* DumpRenderTree/chromium/TestEventPrinter.h:
(TestEventPrinter):
* DumpRenderTree/chromium/TestShell.cpp:
(TestShell::TestShell):
(TestShell::dump):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (115267 => 115268)


--- trunk/Tools/ChangeLog	2012-04-26 01:03:08 UTC (rev 115267)
+++ trunk/Tools/ChangeLog	2012-04-26 01:03:53 UTC (rev 115268)
@@ -1,3 +1,31 @@
+2012-04-25  Dirk Pranke  <dpra...@chromium.org>
+
+        [chromium] change DRT's "DRT" output to match the other ports
+        https://bugs.webkit.org/show_bug.cgi?id=84904
+
+        Reviewed by Kent Tamura.
+
+        Since we run Chromium's DRT in --test-shell mode, the
+        non-test-shell output has never been really beaten on to make
+        sure it's right. This fixes a few issues and will be tested
+        with upcoming NRWT changes that'll land in a separate patch.
+        In particular we should never output framing text like "\n"
+        or "#EOF" outside of something outside of TestEventPrinter,
+        and we weren't handling audio output properly at all.
+
+        * DumpRenderTree/chromium/TestEventPrinter.cpp:
+        (DRTPrinter):
+        (TestShellPrinter):
+        (DRTPrinter::handleTextFooter):
+        (DRTPrinter::handleAudioFooter):
+        (DRTPrinter::handleTestFooter):
+        (TestShellPrinter::handleAudioFooter):
+        * DumpRenderTree/chromium/TestEventPrinter.h:
+        (TestEventPrinter):
+        * DumpRenderTree/chromium/TestShell.cpp:
+        (TestShell::TestShell):
+        (TestShell::dump):
+
 2012-04-25  Joshua Bell  <jsb...@chromium.org>
 
         Unreviewed: Adding Alec Flett as a contributor (non-committer).

Modified: trunk/Tools/DumpRenderTree/chromium/TestEventPrinter.cpp (115267 => 115268)


--- trunk/Tools/DumpRenderTree/chromium/TestEventPrinter.cpp	2012-04-26 01:03:08 UTC (rev 115267)
+++ trunk/Tools/DumpRenderTree/chromium/TestEventPrinter.cpp	2012-04-26 01:03:53 UTC (rev 115268)
@@ -43,6 +43,7 @@
     void handleTextHeader() const;
     void handleTextFooter() const;
     void handleAudioHeader() const;
+    void handleAudioFooter() const;
     void handleImage(const char* actualHash, const char* expectedHash, const unsigned char* imageData, size_t imageSize, const char* fileName) const;
     void handleImageFooter() const;
     void handleTestFooter(bool dumpedAnything) const;
@@ -56,6 +57,7 @@
     void handleTextHeader() const;
     void handleTextFooter() const;
     void handleAudioHeader() const;
+    void handleAudioFooter() const;
     void handleImage(const char* actualHash, const char* expectedHash, const unsigned char* imageData, size_t imageSize, const char* fileName) const;
     void handleImageFooter() const;
     void handleTestFooter(bool dumpedAnything) const;
@@ -95,6 +97,7 @@
 void DRTPrinter::handleTextFooter() const
 {
     printf("#EOF\n");
+    fprintf(stderr, "#EOF\n");
 }
 
 void DRTPrinter::handleAudioHeader() const
@@ -102,6 +105,12 @@
     printf("Content-Type: audio/wav\n");
 }
 
+void DRTPrinter::handleAudioFooter() const
+{
+    printf("#EOF\n");
+    fprintf(stderr, "#EOF\n");
+}
+
 void DRTPrinter::handleImage(const char* actualHash, const char* expectedHash, const unsigned char* imageData, size_t imageSize, const char*) const
 {
     ASSERT(actualHash);
@@ -119,15 +128,11 @@
     }
 }
 
-void DRTPrinter::handleImageFooter() const
+void DRTPrinter::handleTestFooter(bool) const
 {
     printf("#EOF\n");
 }
 
-void DRTPrinter::handleTestFooter(bool) const
-{
-}
-
 // ----------------------------------------------------------------
 
 void TestShellPrinter::handleTestHeader(const char* url) const
@@ -153,6 +158,11 @@
     printf("Content-Type: audio/wav\n");
 }
 
+void TestShellPrinter::handleAudioFooter() const
+{
+    printf("\n");
+}
+
 void TestShellPrinter::handleImage(const char* actualHash, const char*, const unsigned char* imageData, size_t imageSize, const char* fileName) const
 {
     ASSERT(actualHash);
@@ -173,10 +183,6 @@
     printf("#MD5:%s\n", actualHash);
 }
 
-void TestShellPrinter::handleImageFooter() const
-{
-}
-
 void TestShellPrinter::handleTestFooter(bool dumpedAnything) const
 {
     if (dumpedAnything)

Modified: trunk/Tools/DumpRenderTree/chromium/TestEventPrinter.h (115267 => 115268)


--- trunk/Tools/DumpRenderTree/chromium/TestEventPrinter.h	2012-04-26 01:03:08 UTC (rev 115267)
+++ trunk/Tools/DumpRenderTree/chromium/TestEventPrinter.h	2012-04-26 01:03:53 UTC (rev 115268)
@@ -44,8 +44,8 @@
     virtual void handleTextHeader() const = 0;
     virtual void handleTextFooter() const = 0;
     virtual void handleAudioHeader() const = 0;
+    virtual void handleAudioFooter() const = 0;
     virtual void handleImage(const char* actualHash, const char* expectedHash, const unsigned char* imageData, size_t imageSize, const char* fileName) const = 0;
-    virtual void handleImageFooter() const = 0;
     virtual void handleTestFooter(bool dumpedAnything) const = 0;
 };
 

Modified: trunk/Tools/DumpRenderTree/chromium/TestShell.cpp (115267 => 115268)


--- trunk/Tools/DumpRenderTree/chromium/TestShell.cpp	2012-04-26 01:03:08 UTC (rev 115267)
+++ trunk/Tools/DumpRenderTree/chromium/TestShell.cpp	2012-04-26 01:03:53 UTC (rev 115268)
@@ -127,7 +127,7 @@
     WebRuntimeFeatures::enableEncryptedMedia(true);
     WebRuntimeFeatures::enableMediaStream(true);
     WebRuntimeFeatures::enablePeerConnection(true);
-    WebRuntimeFeatures::enableWebAudio(true); 
+    WebRuntimeFeatures::enableWebAudio(true);
     WebRuntimeFeatures::enableVideoTrack(true);
     WebRuntimeFeatures::enableGamepad(true);
     WebRuntimeFeatures::enableShadowDOM(true);
@@ -556,8 +556,7 @@
 
         if (fwrite(webArrayBufferView.baseAddress(), 1, webArrayBufferView.byteLength(), stdout) != webArrayBufferView.byteLength())
             FATAL("Short write to stdout, disk full?\n");
-        printf("\n");
-
+        m_printer->handleAudioFooter();
         m_printer->handleTestFooter(true);
 
         fflush(stdout);
@@ -642,7 +641,6 @@
 
         dumpImage(m_webViewHost->canvas());
     }
-    m_printer->handleImageFooter();
     m_printer->handleTestFooter(dumpedAnything);
     fflush(stdout);
     fflush(stderr);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to