Reviewed by Darin Adler.
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Nov 2007 00:49:21 +0000 (00:49 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Nov 2007 00:49:21 +0000 (00:49 +0000)
        - fix <http://bugs.webkit.org/show_bug.cgi?id=13371>
          DumpRenderTree --pixel-tests renders each test twice

        * DumpRenderTree/mac/DumpRenderTree.mm:
        (dumpRenderTree): Removed the --paint option because the painting code
        is always exercised as a result of
        -[FrameLoadDelegate webView:didFinishLoadFromFrame:]
        calling -displayIfNeeded.
        (dump): Changed to always grab the image from the window since the view
        is always displayed.
        (runTest):
        (displayWebView):
        * Scripts/run-webkit-tests: No need to pass --paint to DumpRenderTree
        because it always paints.

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

WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
WebKitTools/Scripts/run-webkit-tests

index 1aabeac3201b9b35ef29981defcd055186ecd9a7..723ceba8bbe573e97fb4de946eeb33104f39e989 100644 (file)
@@ -1,3 +1,22 @@
+2007-11-13  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Darin Adler.
+
+        - fix <http://bugs.webkit.org/show_bug.cgi?id=13371>
+          DumpRenderTree --pixel-tests renders each test twice
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (dumpRenderTree): Removed the --paint option because the painting code
+        is always exercised as a result of
+        -[FrameLoadDelegate webView:didFinishLoadFromFrame:]
+        calling -displayIfNeeded.
+        (dump): Changed to always grab the image from the window since the view
+        is always displayed.
+        (runTest):
+        (displayWebView):
+        * Scripts/run-webkit-tests: No need to pass --paint to DumpRenderTree
+        because it always paints.
+
 2007-11-12  Antti Koivisto  <antti@apple.com>
 
         Reviewed by Adele.
index 77b7582f465a2297ae227f8c44d969ecb952a3cc..e338a565677c4b5032ef3cb53602ab00e869b827 100644 (file)
@@ -125,10 +125,8 @@ static ResourceLoadDelegate *resourceLoadDelegate;
 PolicyDelegate *policyDelegate;
 
 static int dumpPixels;
-static int paint;
 static int dumpAllPixels;
 static int threaded;
-static BOOL readFromWindow;
 static int testRepaintDefault;
 static int repaintSweepHorizontallyDefault;
 static int dumpTree = YES;
@@ -441,7 +439,6 @@ void dumpRenderTree(int argc, const char *argv[])
         {"horizontal-sweep", no_argument, &repaintSweepHorizontallyDefault, YES},
         {"notree", no_argument, &dumpTree, NO},
         {"pixel-tests", no_argument, &dumpPixels, YES},
-        {"paint", no_argument, &paint, YES},
         {"repaint", no_argument, &testRepaintDefault, YES},
         {"tree", no_argument, &dumpTree, YES},
         {"threaded", no_argument, &threaded, YES},
@@ -902,7 +899,7 @@ void dump()
             NSGraphicsContext* nsContext = [NSGraphicsContext graphicsContextWithGraphicsPort:cgContext flipped:NO];
             [NSGraphicsContext setCurrentContext:nsContext];
 
-            if (readFromWindow) {
+            if (!layoutTestController->testRepaint()) {
                 NSBitmapImageRep *imageRep;
                 [view displayIfNeeded];
                 [view lockFocus];
@@ -910,9 +907,7 @@ void dump()
                 [view unlockFocus];
                 [imageRep draw];
                 [imageRep release];
-            } else if (!layoutTestController->testRepaint())
-                [view displayRectIgnoringOpacity:NSMakeRect(0, 0, webViewSize.width, webViewSize.height) inContext:nsContext];
-            else if (!layoutTestController->testRepaintSweepHorizontally()) {
+            } else if (!layoutTestController->testRepaintSweepHorizontally()) {
                 NSRect line = NSMakeRect(0, 0, webViewSize.width, 1);
                 while (line.origin.y < webViewSize.height) {
                     [view displayRectIgnoringOpacity:line inContext:nsContext];
@@ -976,12 +971,9 @@ void dump()
 
         printf("#EOF\n");
     }
-    
+
     fflush(stdout);
 
-    if (paint)
-        displayWebView();
-    
     done = YES;
 }
 
@@ -1023,7 +1015,6 @@ static void runTest(const char *pathOrURL)
     topLoadingFrame = nil;
 
     done = NO;
-    readFromWindow = NO;
 
     if (disallowedURLs)
         CFSetRemoveAllValues(disallowedURLs);
@@ -1132,7 +1123,6 @@ void displayWebView()
     [[[NSColor blackColor] colorWithAlphaComponent:0.66] set];
     NSRectFillUsingOperation([webView frame], NSCompositeSourceOver);
     [webView unlockFocus];
-    readFromWindow = YES;
 }
 
 @implementation DumpRenderTreePasteboard
index 0a326eb6aa6a83a4aa510a1bf278d0e8ec4cfad5..cee5085cb2f4aed6f4d8a28de33dcca0d904bddb 100755 (executable)
@@ -417,7 +417,6 @@ push @toolArgs, "--pixel-tests" if $pixelTests;
 push @toolArgs, "--repaint" if $repaintTests;
 push @toolArgs, "--horizontal-sweep" if $repaintSweepHorizontally;
 push @toolArgs, "--threaded" if $threaded;
-push @toolArgs, "--paint" if $shouldCheckLeaks; # Otherwise, DRT won't exercise painting leaks.
 push @toolArgs, "-";
 
 my @diffToolArgs = ();