diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:05:15 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:05:15 -0800 |
commit | 1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353 (patch) | |
tree | 4457a7306ea5acb43fe05bfe0973b1f7faf97ba2 /WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm | |
parent | 9364f22aed35e1a1e9d07c121510f80be3ab0502 (diff) | |
download | external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.zip external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.gz external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.bz2 |
Code drop from //branches/cupcake/...@124589
Diffstat (limited to 'WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm')
-rw-r--r-- | WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm | 47 |
1 files changed, 45 insertions, 2 deletions
diff --git a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm index b321319..2200c27 100644 --- a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm +++ b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm @@ -36,13 +36,19 @@ #import <JavaScriptCore/JSRetainPtr.h> #import <JavaScriptCore/JSStringRef.h> #import <JavaScriptCore/JSStringRefCF.h> +#import <WebKit/DOMDocument.h> #import <WebKit/WebBackForwardList.h> +#import <WebKit/WebDatabaseManagerPrivate.h> +#import <WebKit/WebDataSource.h> #import <WebKit/WebFrame.h> +#import <WebKit/WebHTMLRepresentation.h> #import <WebKit/WebHTMLViewPrivate.h> #import <WebKit/WebHistory.h> +#import <WebKit/WebInspector.h> #import <WebKit/WebNSURLExtras.h> #import <WebKit/WebPreferences.h> #import <WebKit/WebPreferencesPrivate.h> +#import <WebKit/WebSecurityOriginPrivate.h> #import <WebKit/WebView.h> #import <WebKit/WebViewPrivate.h> #import <wtf/RetainPtr.h> @@ -65,6 +71,11 @@ void LayoutTestController::addDisallowedURL(JSStringRef url) CFSetAddValue(disallowedURLs, [request URL]); } +void LayoutTestController::clearAllDatabases() +{ + [[WebDatabaseManager sharedWebDatabaseManager] deleteAllDatabases]; +} + void LayoutTestController::clearBackForwardList() { WebBackForwardList *backForwardList = [[mainFrame webView] backForwardList]; @@ -170,6 +181,13 @@ void LayoutTestController::setCustomPolicyDelegate(bool setDelegate) [[mainFrame webView] setPolicyDelegate:nil]; } +void LayoutTestController::setDatabaseQuota(unsigned long long quota) +{ + WebSecurityOrigin *origin = [[WebSecurityOrigin alloc] initWithURL:[NSURL URLWithString:@"file:///"]]; + [origin setQuota:quota]; + [origin release]; +} + void LayoutTestController::setMainFrameIsFirstResponder(bool flag) { NSView *documentView = [[mainFrame frameView] documentView]; @@ -232,13 +250,24 @@ void LayoutTestController::setWindowIsKey(bool windowIsKey) [(WebHTMLView *)documentView _updateFocusedAndActiveState]; } +void LayoutTestController::setSmartInsertDeleteEnabled(bool flag) +{ + [[mainFrame webView] setSmartInsertDeleteEnabled:flag]; +} + +void LayoutTestController::setJavaScriptProfilingEnabled(bool profilingEnabled) +{ + [[[mainFrame webView] preferences] setDeveloperExtrasEnabled:profilingEnabled]; + [[[mainFrame webView] inspector] setJavaScriptProfilingEnabled:profilingEnabled]; +} + static const CFTimeInterval waitToDumpWatchdogInterval = 10.0; static void waitUntilDoneWatchdogFired(CFRunLoopTimerRef timer, void* info) { const char* message = "FAIL: Timed out waiting for notifyDone to be called\n"; - fprintf(stderr, message); - fprintf(stdout, message); + fprintf(stderr, "%s", message); + fprintf(stdout, "%s", message); dump(); } @@ -256,6 +285,20 @@ int LayoutTestController::windowCount() return CFArrayGetCount(openWindowsRef); } +bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef id) +{ + RetainPtr<CFStringRef> idCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, id)); + NSString *idNS = (NSString *)idCF.get(); + + DOMElement *element = [[mainFrame DOMDocument] getElementById:idNS]; + id rep = [[mainFrame dataSource] representation]; + + if ([rep class] == [WebHTMLRepresentation class]) + return [(WebHTMLRepresentation *)rep elementDoesAutoComplete:element]; + + return false; +} + void LayoutTestController::execCommand(JSStringRef name, JSStringRef value) { RetainPtr<CFStringRef> nameCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, name)); |