<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>21124</bug_id>
          
          <creation_ts>2008-09-25 16:59:21 -0700</creation_ts>
          <short_desc>--pixel should be ignored for tests that use dumpAsText()</short_desc>
          <delta_ts>2008-09-30 17:43:44 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac (Intel)</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Pierre-Olivier Latour">pol</reporter>
          <assigned_to name="Simon Fraser (smfr)">simon.fraser</assigned_to>
          <cc>simon.fraser</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>92827</commentid>
    <comment_count>0</comment_count>
    <who name="Pierre-Olivier Latour">pol</who>
    <bug_when>2008-09-25 16:59:21 -0700</bug_when>
    <thetext>If I understand things right, tests that use the dumpAsText() instead of dumping the render tree are supposed to be platform agnostic, so their results are in the same directory as the tests instead of in &quot;platform&quot;.

Pixel test are by definition not platform agnostic (destination screen color profile, font rendering differences, etc...), so their result should always be in &quot;platform&quot;.

If you combine these two assumptions, then having a test that uses dumpAsText() also have its rendering be pixel-tested does not make sense.
But today, if you run &quot;WebKitTools/Scripts/run-webkit-tests --pixel LayoutTests/&quot;, it will generate images for such tests.

For instance, 3 out of the 6 tests in LayoutTests/transforms/2d are dumpAsText() tests and do not print the render tree:
- compound-2d-transforms.html
- transform-2d.html
- transform-accuracy.html
But since there are no &quot;base&quot; images in LayoutTests/platform/mac/transforms/2d for these tests, DRT always creates news ones in LayoutTests/transforms/2d and this pollutes the directory.

I think the DRT tool when running in --pixel-test mode should not compare pixel rendering of tests that use dumpAsText().</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92828</commentid>
    <comment_count>1</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2008-09-25 17:05:59 -0700</bug_when>
    <thetext>I thought that this was already the case.  Perhaps we broke this behaviour somewhere along the way.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92829</commentid>
    <comment_count>2</comment_count>
    <who name="Pierre-Olivier Latour">pol</who>
    <bug_when>2008-09-25 17:12:19 -0700</bug_when>
    <thetext>We want to add a bunch of tests for transforms, transitions and animations, and some of them require pixel testing. Having this fixed sooner than later would help, thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92960</commentid>
    <comment_count>3</comment_count>
    <who name="Pierre-Olivier Latour">pol</who>
    <bug_when>2008-09-26 13:06:09 -0700</bug_when>
    <thetext>For some reason, you can&apos;t just bypass dumpWebViewAsPixelsAndCompareWithExpected() completely in DRT or the tests hangs.

Here&apos;s a diff that seems to fix the issue (it&apos;s a one-line change, but because of (re)tabbing a bunch of lines, it makes it look quite bigger):

Index: WebKitTools/DumpRenderTree/cg/PixelDumpSupportCG.cpp
===================================================================
--- WebKitTools/DumpRenderTree/cg/PixelDumpSupportCG.cpp	(revision 36958)
+++ WebKitTools/DumpRenderTree/cg/PixelDumpSupportCG.cpp	(working copy)
@@ -106,21 +106,25 @@
     if (gLayoutTestController-&gt;dumpSelectionRect())
         drawSelectionRect(context.get(), getSelectionRect());
 #endif
+    
+    // Only process the rendered image if have a test that is not platform-agnositc i.e. doesn&apos;t use &quot;dumpAsText()&quot;
+    if(!gLayoutTestController-&gt;dumpAsText()) {
 
-    // Compute the actual hash to compare to the expected image&apos;s hash.
-    char actualHash[33];
-    getMD5HashStringForBitmap(context.get(), actualHash);
-    printf(&quot;\nActualHash: %s\n&quot;, actualHash);
+        // Compute the actual hash to compare to the expected image&apos;s hash.
+        char actualHash[33];
+        getMD5HashStringForBitmap(context.get(), actualHash);
+        printf(&quot;\nActualHash: %s\n&quot;, actualHash);
 
-    // FIXME: We should compare the actualHash to the expected hash here and
-    // only set dumpImage to true if they don&apos;t match, but DRT doesn&apos;t have
-    // enough information currently to find the expected checksum file.
-    bool dumpImage = true;
+        // FIXME: We should compare the actualHash to the expected hash here and
+        // only set dumpImage to true if they don&apos;t match, but DRT doesn&apos;t have
+        // enough information currently to find the expected checksum file.
+        bool dumpImage = true;
 
-    if (dumpImage) {
-        RetainPtr&lt;CGImageRef&gt; image(AdoptCF, CGBitmapContextCreateImage(context.get()));
-        printPNG(image.get());
+        if (dumpImage) {
+            RetainPtr&lt;CGImageRef&gt; image(AdoptCF, CGBitmapContextCreateImage(context.get()));
+            printPNG(image.get());
+        }
     }
-
+    
     printf(&quot;#EOF\n&quot;);
 }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93477</commentid>
    <comment_count>4</comment_count>
      <attachid>23965</attachid>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2008-09-30 17:40:25 -0700</bug_when>
    <thetext>Created attachment 23965
Patch, changelog</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93478</commentid>
    <comment_count>5</comment_count>
      <attachid>23965</attachid>
    <who name="">mitz</who>
    <bug_when>2008-09-30 17:42:16 -0700</bug_when>
    <thetext>Comment on attachment 23965
Patch, changelog

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93479</commentid>
    <comment_count>6</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2008-09-30 17:43:44 -0700</bug_when>
    <thetext>	M	WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
	M	WebKitTools/ChangeLog
	M	WebKitTools/Scripts/run-webkit-tests
r37129 = 783a6ba5d73a582590947cb76f7859d8d42b4f9c (trunk)
</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>23965</attachid>
            <date>2008-09-30 17:40:25 -0700</date>
            <delta_ts>2008-09-30 17:42:16 -0700</delta_ts>
            <desc>Patch, changelog</desc>
            <filename>21124_patch.txt</filename>
            <type>text/plain</type>
            <size>2142</size>
            <attacher name="Simon Fraser (smfr)">simon.fraser</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYktpdFRvb2xzL0NoYW5nZUxvZyBiL1dlYktpdFRvb2xzL0NoYW5nZUxv
Zw1pbmRleCBmZWRiNjc4Li5hNGE3MmRiIDEwMDY0NA0tLS0gYS9XZWJLaXRUb29scy9DaGFuZ2VM
b2cNKysrIGIvV2ViS2l0VG9vbHMvQ2hhbmdlTG9nDUBAIC0xLDMgKzEsMTQgQEANKzIwMDgtMDkt
MzAgIFNpbW9uIEZyYXNlciAgPHNpbW9uLmZyYXNlckBhcHBsZS5jb20+DSsNKyAgICAgICAgUmV2
aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuDSsNKyAgICAgICAgRG9uJ3QgcnVuIHBpeGVsIGNvbXBh
cmlzb24gZm9yIHRleHQtb25seSB0ZXN0cy4NKyAgICAgICAgaHR0cHM6Ly9idWdzLndlYmtpdC5v
cmcvc2hvd19idWcuY2dpP2lkPTIxMTI0DSsgICAgICAgIA0rICAgICAgICAqIER1bXBSZW5kZXJU
cmVlL21hYy9EdW1wUmVuZGVyVHJlZS5tbToNKyAgICAgICAgKGR1bXApOg0rICAgICAgICAqIFNj
cmlwdHMvcnVuLXdlYmtpdC10ZXN0czoNKw0gMjAwOC0wOS0yOSAgVGhpYWdvIE1hY2llaXJhICA8
dGhpYWdvLm1hY2llaXJhQG5va2lhLmNvbT4NIA0gICAgICAgICBSZXZp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sN
</data>
<flag name="review"
          id="10825"
          type_id="1"
          status="+"
          setter="mitz"
    />
          </attachment>
      

    </bug>

</bugzilla>