+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.
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;
{"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},
NSGraphicsContext* nsContext = [NSGraphicsContext graphicsContextWithGraphicsPort:cgContext flipped:NO];
[NSGraphicsContext setCurrentContext:nsContext];
- if (readFromWindow) {
+ if (!layoutTestController->testRepaint()) {
NSBitmapImageRep *imageRep;
[view displayIfNeeded];
[view lockFocus];
[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];
printf("#EOF\n");
}
-
+
fflush(stdout);
- if (paint)
- displayWebView();
-
done = YES;
}
topLoadingFrame = nil;
done = NO;
- readFromWindow = NO;
if (disallowedURLs)
CFSetRemoveAllValues(disallowedURLs);
[[[NSColor blackColor] colorWithAlphaComponent:0.66] set];
NSRectFillUsingOperation([webView frame], NSCompositeSourceOver);
[webView unlockFocus];
- readFromWindow = YES;
}
@implementation DumpRenderTreePasteboard