* DumpRenderTree/DumpRenderTree.m: (dump): Dump the image if it's not
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 29 Jan 2006 04:17:20 +0000 (04:17 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 29 Jan 2006 04:17:20 +0000 (04:17 +0000)
        already there, even if the checksum is correct.

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

WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/DumpRenderTree.m

index c9588ed4809b67c97b8b0eb0e183039bcd5e6d2b..18cde47124eadddc23942cbe1f5ce0575ab75eb3 100644 (file)
@@ -1,3 +1,8 @@
+2006-01-28  Darin Adler  <darin@apple.com>
+
+        * DumpRenderTree/DumpRenderTree.m: (dump): Dump the image if it's not
+        already there, even if the checksum is correct.
+
 2006-01-27  Eric Seidel  <eseidel@apple.com>
 
         Reviewed by adele.
index 465e060ac77ec2f784e1754616e23320759bc86b..de3b3bae975838ea140a0ccfdf4728f061706242 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2005, 2006 Apple Computer, Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -274,9 +274,14 @@ static void dump(void)
     
     if (dumpPixels) {
         if (!dumpAsText) {
+            // FIXME: It's unfortunate that we hardcode the file naming scheme here.
+            // At one time, the perl script had all the knowledge about file layout.
+            // Some day we should restore that setup by passing in more parameters to this tool.
+
             NSString *baseTestPath = [currentTest stringByDeletingPathExtension];
             NSString *baselineHashPath = [baseTestPath stringByAppendingString:@"-expected.checksum"];
             NSString *baselineHash = [NSString stringWithContentsOfFile:baselineHashPath encoding:NSUTF8StringEncoding error:nil];
+            NSString *baselineImagePath = [baseTestPath stringByAppendingString:@"-expected.png"];
             
             // grab a bitmap from the view
             WebView *view = [frame webView];
@@ -289,7 +294,7 @@ static void dump(void)
             printf("BaselineHash: %s\n", [baselineHash UTF8String]);
             
             // if the hashes don't match, send image back to stdout for diff comparision
-            if ([baselineHash isEqualToString:actualHash] == NO) {            
+            if (![baselineHash isEqualToString:actualHash] || access([baselineImagePath fileSystemRepresentation], F_OK) != 0) {            
                 NSData *imageData = [imageRep representationUsingType:NSPNGFileType properties:nil];
                 printf("Content-length: %d\n", [imageData length]);
                 fwrite([imageData bytes], 1, [imageData length], stdout);