diff options
Diffstat (limited to 'WebKitTools/DumpRenderTree/mac/UIDelegate.mm')
-rw-r--r-- | WebKitTools/DumpRenderTree/mac/UIDelegate.mm | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/WebKitTools/DumpRenderTree/mac/UIDelegate.mm b/WebKitTools/DumpRenderTree/mac/UIDelegate.mm index 29f3ddd..0c5a93c 100644 --- a/WebKitTools/DumpRenderTree/mac/UIDelegate.mm +++ b/WebKitTools/DumpRenderTree/mac/UIDelegate.mm @@ -84,10 +84,18 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; return defaultText; } +- (BOOL)webView:(WebView *)c runBeforeUnloadConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame +{ + if (!done) + printf("CONFIRM NAVIGATION: %s\n", [message UTF8String]); + return YES; +} + + - (void)webView:(WebView *)sender dragImage:(NSImage *)anImage at:(NSPoint)viewLocation offset:(NSSize)initialOffset event:(NSEvent *)event pasteboard:(NSPasteboard *)pboard source:(id)sourceObj slideBack:(BOOL)slideFlag forView:(NSView *)view { assert(!draggingInfo); - if (layoutTestController->addFileToPasteboardOnDrag()) { + if (gLayoutTestController->addFileToPasteboardOnDrag()) { [pboard declareTypes:[NSArray arrayWithObject:NSFilenamesPboardType] owner:nil]; [pboard setPropertyList:[NSArray arrayWithObject:@"DRTFakeFile"] forType:NSFilenamesPboardType]; } @@ -97,19 +105,21 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; - (void)webViewFocus:(WebView *)webView { - layoutTestController->setWindowIsKey(true); - NSView *documentView = [[mainFrame frameView] documentView]; - if ([documentView isKindOfClass:[WebHTMLView class]]) - [(WebHTMLView *)documentView _updateFocusedAndActiveState]; + gLayoutTestController->setWindowIsKey(true); +} + +- (void)webViewUnfocus:(WebView *)webView +{ + gLayoutTestController->setWindowIsKey(false); } - (WebView *)webView:(WebView *)sender createWebViewWithRequest:(NSURLRequest *)request { - if (!layoutTestController->canOpenWindows()) + if (!gLayoutTestController->canOpenWindows()) return nil; // Make sure that waitUntilDone has been called. - ASSERT(layoutTestController->waitToDump()); + ASSERT(gLayoutTestController->waitToDump()); WebView *webView = createWebViewAndOffscreenWindow(); @@ -120,7 +130,7 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; { NSWindow* window = [sender window]; - if (layoutTestController->callCloseOnWebViews()) + if (gLayoutTestController->callCloseOnWebViews()) [sender close]; [window close]; @@ -128,10 +138,19 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; - (void)webView:(WebView *)sender frame:(WebFrame *)frame exceededDatabaseQuotaForSecurityOrigin:(WebSecurityOrigin *)origin database:(NSString *)databaseIdentifier { - static const unsigned long long defaultQuota = 5 * 1024 * 1024; + if (!done && gLayoutTestController->dumpDatabaseCallbacks()) + printf("UI DELEGATE DATABASE CALLBACK: exceededDatabaseQuotaForSecurityOrigin:{%s, %s, %i} database:%s\n", [[origin protocol] UTF8String], [[origin host] UTF8String], + [origin port], [databaseIdentifier UTF8String]); + + static const unsigned long long defaultQuota = 5 * 1024 * 1024; [origin setQuota:defaultQuota]; } +- (void)webView:(WebView *)sender setStatusText:(NSString *)text +{ + if (gLayoutTestController->dumpStatusCallbacks()) + printf("UI DELEGATE STATUS CALLBACK: setStatusText:%s\n", [text UTF8String]); +} - (void)dealloc { |