+2006-04-23 Mitz Pettel <opendarwin.org@mitzpettel.com>
+
+ Reviewed by Darin.
+
+ - http://bugzilla.opendarwin.org/show_bug.cgi?id=6905
+ DumpRenderTree needs a way to force painting (to allow invalidation tests)
+
+ * DumpRenderTree/DumpRenderTree.m:
+ (dump): If display() has been called during the test, grab the pixels from
+ the view, after letting it repaint invalidated rects.
+ (+[LayoutTestController isSelectorExcludedFromWebScript:]):
+ (-[LayoutTestController display]): Added. Calls -display on the view
+ and changes the subsequent behavior of dump().
+ (dumpRenderTree):
+
2006-04-22 Alexey Proskuryakov <ap@nypop.com>
Reviewed by Maciej.
static BOOL dumpTitleChanges;
static int dumpPixels = NO;
static int dumpAllPixels = NO;
+static BOOL readFromWindow = NO;
static int testRepaintDefault = NO;
static BOOL testRepaint = NO;
static int repaintSweepHorizontallyDefault = NO;
NSGraphicsContext* nsContext = [NSGraphicsContext graphicsContextWithGraphicsPort:cgContext flipped:NO];
[NSGraphicsContext setCurrentContext:nsContext];
- if (!testRepaint)
+ if (readFromWindow) {
+ NSBitmapImageRep *imageRep;
+ [view displayIfNeeded];
+ [view lockFocus];
+ imageRep = [[NSBitmapImageRep alloc] initWithFocusedViewRect:[view frame]];
+ [view unlockFocus];
+ [imageRep draw];
+ [imageRep release];
+ } else if (!testRepaint)
[view displayRectIgnoringOpacity:NSMakeRect(0, 0, webViewSize.width, webViewSize.height) inContext:nsContext];
else if (!repaintSweepHorizontally) {
NSRect line = NSMakeRect(0, 0, webViewSize.width, 1);
|| aSelector == @selector(setWindowIsKey:)
|| aSelector == @selector(setMainFrameIsFirstResponder:)
|| aSelector == @selector(dumpSelectionRect)
+ || aSelector == @selector(display)
|| aSelector == @selector(testRepaint)
|| aSelector == @selector(repaintSweepHorizontally))
return NO;
[(WebHTMLView *)documentView _updateFocusState];
}
+- (void)display
+{
+ [[frame webView] display];
+ readFromWindow = YES;
+}
+
- (void)testRepaint
{
testRepaint = YES;
dumpAsText = NO;
dumpSelectionRect = NO;
dumpTitleChanges = NO;
+ readFromWindow = NO;
testRepaint = testRepaintDefault;
repaintSweepHorizontally = repaintSweepHorizontallyDefault;
if (currentTest != nil)
22181BD009DC8C4B008342E8 /* ObjCPluginFunction.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ObjCPluginFunction.m; sourceTree = "<group>"; };
32A70AAB03705E1F00C91783 /* DumpRenderTreePrefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DumpRenderTreePrefix.h; sourceTree = "<group>"; };
9335435F03D75502008635CE /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
- 9340995408540CAF007F3BC8 /* DumpRenderTree */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = DumpRenderTree; sourceTree = BUILT_PRODUCTS_DIR; };
+ 9340995408540CAF007F3BC8 /* DumpRenderTree */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = DumpRenderTree; sourceTree = BUILT_PRODUCTS_DIR; };
93442CF408F8BA4900BFE8CA /* TextInputController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextInputController.h; sourceTree = "<group>"; };
93442CF508F8BA4900BFE8CA /* TextInputController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TextInputController.m; sourceTree = "<group>"; };
A803FCB709CAAAB0009B2A37 /* EventSendingController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = EventSendingController.h; sourceTree = "<group>"; };