diff options
Diffstat (limited to 'Tools/DumpRenderTree/mac')
-rw-r--r-- | Tools/DumpRenderTree/mac/Configurations/Base.xcconfig | 6 | ||||
-rw-r--r-- | Tools/DumpRenderTree/mac/DumpRenderTree.mm | 9 | ||||
-rw-r--r-- | Tools/DumpRenderTree/mac/DumpRenderTreeMac.h | 3 | ||||
-rw-r--r-- | Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm | 89 | ||||
-rw-r--r-- | Tools/DumpRenderTree/mac/PerlSupport/Makefile | 2 | ||||
-rw-r--r-- | Tools/DumpRenderTree/mac/UIDelegate.h | 1 | ||||
-rw-r--r-- | Tools/DumpRenderTree/mac/UIDelegate.mm | 10 | ||||
-rw-r--r-- | Tools/DumpRenderTree/mac/WebArchiveDumpSupportMac.mm | 1 |
8 files changed, 113 insertions, 8 deletions
diff --git a/Tools/DumpRenderTree/mac/Configurations/Base.xcconfig b/Tools/DumpRenderTree/mac/Configurations/Base.xcconfig index 28a0518..8463985 100644 --- a/Tools/DumpRenderTree/mac/Configurations/Base.xcconfig +++ b/Tools/DumpRenderTree/mac/Configurations/Base.xcconfig @@ -52,12 +52,16 @@ TARGET_GCC_VERSION_1050_ = $(TARGET_GCC_VERSION_1050_$(XCODE_VERSION_ACTUAL)); TARGET_GCC_VERSION_1050_0310 = GCC_42; TARGET_GCC_VERSION_1050_0320 = GCC_42; TARGET_GCC_VERSION_1060 = GCC_42; -TARGET_GCC_VERSION_1070 = LLVM_GCC_42; +TARGET_GCC_VERSION_1070 = $(TARGET_GCC_VERSION_1070_$(CONFIGURATION)); +TARGET_GCC_VERSION_1070_Debug = LLVM_COMPILER; +TARGET_GCC_VERSION_1070_Release = LLVM_GCC_42; +TARGET_GCC_VERSION_1070_Production = LLVM_GCC_42; GCC_VERSION = $(GCC_VERSION_$(TARGET_GCC_VERSION)); GCC_VERSION_GCC_40 = 4.0; GCC_VERSION_GCC_42 = 4.2; GCC_VERSION_LLVM_GCC_42 = com.apple.compilers.llvmgcc42; +GCC_VERSION_LLVM_COMPILER = com.apple.compilers.llvm.clang.1_0; // If the target Mac OS X version does not match the current Mac OS X version then we'll want to build using the target version's SDK. SDKROOT = $(SDKROOT_$(MAC_OS_X_VERSION_MAJOR)_$(TARGET_MAC_OS_X_VERSION_MAJOR)); diff --git a/Tools/DumpRenderTree/mac/DumpRenderTree.mm b/Tools/DumpRenderTree/mac/DumpRenderTree.mm index dca0d38..207e8fb 100644 --- a/Tools/DumpRenderTree/mac/DumpRenderTree.mm +++ b/Tools/DumpRenderTree/mac/DumpRenderTree.mm @@ -48,6 +48,7 @@ #import "PixelDumpSupport.h" #import "PolicyDelegate.h" #import "ResourceLoadDelegate.h" +#import "StorageTrackerDelegate.h" #import "UIDelegate.h" #import "WebArchiveDumpSupport.h" #import "WorkQueue.h" @@ -77,6 +78,7 @@ #import <WebKit/WebPreferencesPrivate.h> #import <WebKit/WebPreferenceKeysPrivate.h> #import <WebKit/WebResourceLoadDelegate.h> +#import <WebKit/WebStorageManagerPrivate.h> #import <WebKit/WebTypesInternal.h> #import <WebKit/WebViewPrivate.h> #import <getopt.h> @@ -134,6 +136,7 @@ static EditingDelegate *editingDelegate; static ResourceLoadDelegate *resourceLoadDelegate; static HistoryDelegate *historyDelegate; PolicyDelegate *policyDelegate; +StorageTrackerDelegate *storageDelegate; static int dumpPixels; static int threaded; @@ -303,6 +306,9 @@ WebView *createWebViewAndOffscreenWindow() [WebView registerURLSchemeAsLocal:@"feedsearch"]; [webView setContinuousSpellCheckingEnabled:YES]; + [webView setGrammarCheckingEnabled:YES]; + [webView setInteractiveFormValidationEnabled:YES]; + [webView setValidationMessageTimerMagnification:-1]; // To make things like certain NSViews, dragging, and plug-ins work, put the WebView a window, but put it off-screen so you don't see it. // Put it at -10000, -10000 in "flipped coordinates", since WebCore and the DOM use flipped coordinates. @@ -414,6 +420,7 @@ static void resetDefaultsToConsistentValues() NSString *path = libraryPathForDumpRenderTree(); [defaults setObject:[path stringByAppendingPathComponent:@"Databases"] forKey:WebDatabaseDirectoryDefaultsKey]; + [defaults setObject:[path stringByAppendingPathComponent:@"LocalStorage"] forKey:WebStorageDirectoryDefaultsKey]; [defaults setObject:[path stringByAppendingPathComponent:@"LocalCache"] forKey:WebKitLocalCacheDefaultsKey]; WebPreferences *preferences = [WebPreferences standardPreferences]; @@ -545,6 +552,7 @@ static void allocateGlobalControllers() resourceLoadDelegate = [[ResourceLoadDelegate alloc] init]; policyDelegate = [[PolicyDelegate alloc] init]; historyDelegate = [[HistoryDelegate alloc] init]; + storageDelegate = [[StorageTrackerDelegate alloc] init]; } // ObjC++ doens't seem to let me pass NSObject*& sadly. @@ -562,6 +570,7 @@ static void releaseGlobalControllers() releaseAndZero(&resourceLoadDelegate); releaseAndZero(&uiDelegate); releaseAndZero(&policyDelegate); + releaseAndZero(&storageDelegate); } static void initializeGlobalsFromCommandLineOptions(int argc, const char *argv[]) diff --git a/Tools/DumpRenderTree/mac/DumpRenderTreeMac.h b/Tools/DumpRenderTree/mac/DumpRenderTreeMac.h index 36c5eac..901008c 100644 --- a/Tools/DumpRenderTree/mac/DumpRenderTreeMac.h +++ b/Tools/DumpRenderTree/mac/DumpRenderTreeMac.h @@ -35,6 +35,7 @@ @class DumpRenderTreeDraggingInfo; @class NavigationController; @class PolicyDelegate; +@class StorageTrackerDelegate; @class WebFrame; @class WebScriptWorld; @class WebView; @@ -42,6 +43,7 @@ class DumpRenderTreeDraggingInfo; class NavigationController; class PolicyDelegate; +class StorageTrackerDelegate; class WebFrame; class WebScriptWorld; class WebView; @@ -54,6 +56,7 @@ extern WebFrame* topLoadingFrame; extern DumpRenderTreeDraggingInfo *draggingInfo; extern NavigationController* gNavigationController; extern PolicyDelegate* policyDelegate; +extern StorageTrackerDelegate* storageDelegate; extern const unsigned maxViewHeight; extern const unsigned maxViewWidth; diff --git a/Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm b/Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm index 72ec759..66c0cce 100644 --- a/Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm +++ b/Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm @@ -33,6 +33,7 @@ #import "EditingDelegate.h" #import "MockGeolocationProvider.h" #import "PolicyDelegate.h" +#import "StorageTrackerDelegate.h" #import "UIDelegate.h" #import "WorkQueue.h" #import "WorkQueueItem.h" @@ -66,6 +67,7 @@ #import <WebKit/WebQuotaManager.h> #import <WebKit/WebScriptWorld.h> #import <WebKit/WebSecurityOriginPrivate.h> +#import <WebKit/WebStorageManagerPrivate.h> #import <WebKit/WebTypesInternal.h> #import <WebKit/WebView.h> #import <WebKit/WebViewPrivate.h> @@ -133,11 +135,68 @@ void LayoutTestController::clearAllApplicationCaches() [WebApplicationCache deleteAllApplicationCaches]; } +void LayoutTestController::syncLocalStorage() +{ + [[WebStorageManager sharedWebStorageManager] syncLocalStorage]; +} + +void LayoutTestController::observeStorageTrackerNotifications(unsigned number) +{ + [storageDelegate logNotifications:number controller:this]; +} + +void LayoutTestController::clearApplicationCacheForOrigin(JSStringRef url) +{ + RetainPtr<CFStringRef> urlCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, url)); + + WebSecurityOrigin *origin = [[WebSecurityOrigin alloc] initWithURL:[NSURL URLWithString:(NSString *)urlCF.get()]]; + [WebApplicationCache deleteCacheForOrigin:origin]; + [origin release]; +} + +JSValueRef originsArrayToJS(JSContextRef context, NSArray* origins) +{ + NSUInteger count = [origins count]; + + JSValueRef jsOriginsArray[count]; + for (NSUInteger i = 0; i < count; i++) { + NSString *origin = [[origins objectAtIndex:i] databaseIdentifier]; + JSRetainPtr<JSStringRef> originJS(Adopt, JSStringCreateWithCFString((CFStringRef)origin)); + jsOriginsArray[i] = JSValueMakeString(context, originJS.get()); + } + + return JSObjectMakeArray(context, count, jsOriginsArray, NULL); +} + +JSValueRef LayoutTestController::originsWithApplicationCache(JSContextRef context) +{ + return originsArrayToJS(context, [WebApplicationCache originsWithCache]); +} + void LayoutTestController::clearAllDatabases() { [[WebDatabaseManager sharedWebDatabaseManager] deleteAllDatabases]; } +void LayoutTestController::deleteAllLocalStorage() +{ + [[WebStorageManager sharedWebStorageManager] deleteAllOrigins]; +} + +JSValueRef LayoutTestController::originsWithLocalStorage(JSContextRef context) +{ + return originsArrayToJS(context, [[WebStorageManager sharedWebStorageManager] origins]); +} + +void LayoutTestController::deleteLocalStorageForOrigin(JSStringRef URL) +{ + RetainPtr<CFStringRef> urlCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, URL)); + + WebSecurityOrigin *origin = [[WebSecurityOrigin alloc] initWithURL:[NSURL URLWithString:(NSString *)urlCF.get()]]; + [[WebStorageManager sharedWebStorageManager] deleteOrigin:origin]; + [origin release]; +} + void LayoutTestController::clearBackForwardList() { WebBackForwardList *backForwardList = [[mainFrame webView] backForwardList]; @@ -254,6 +313,11 @@ int LayoutTestController::numberOfPages(float pageWidthInPixels, float pageHeigh return [mainFrame numberOfPages:pageWidthInPixels:pageHeightInPixels]; } +int LayoutTestController::numberOfPendingGeolocationPermissionRequests() +{ + return [[[mainFrame webView] UIDelegate] numberOfPendingGeolocationPermissionRequests]; +} + size_t LayoutTestController::webHistoryItemCount() { return [[[WebHistory optionalSharedHistory] allItems] count]; @@ -320,6 +384,15 @@ void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag) [[[mainFrame webView] preferences] setAuthorAndUserStylesEnabled:flag]; } +void LayoutTestController::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled) +{ + DOMElement *element = [DOMElement _DOMElementFromJSContext:context value:nodeObject]; + if (!element || ![element isKindOfClass:[DOMHTMLInputElement class]]) + return; + + [(DOMHTMLInputElement *)element _setAutofilled:autofilled]; +} + void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permissive) { if (setDelegate) { @@ -484,7 +557,7 @@ void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef node DOMElement *element = [DOMElement _DOMElementFromJSContext:context value:nodeObject]; if (!element || ![element isKindOfClass:[DOMHTMLInputElement class]]) return; - + RetainPtr<CFStringRef> valueCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, value)); [(DOMHTMLInputElement *)element _setValueForUser:(NSString *)valueCF.get()]; } @@ -926,8 +999,8 @@ static NSString *SynchronousLoaderRunLoopMode = @"DumpRenderTreeSynchronousLoade - (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge { if ([challenge previousFailureCount] == 0) { - NSURLCredential *credential = [[NSURLCredential alloc] initWithUser:m_username password:m_password persistence:NSURLCredentialPersistenceForSession]; - [[challenge sender] useCredential:credential forAuthenticationChallenge:challenge]; + RetainPtr<NSURLCredential> credential(AdoptNS, [[NSURLCredential alloc] initWithUser:m_username password:m_password persistence:NSURLCredentialPersistenceForSession]); + [[challenge sender] useCredential:credential.get() forAuthenticationChallenge:challenge]; return; } [[challenge sender] cancelAuthenticationChallenge:challenge]; @@ -977,9 +1050,9 @@ void LayoutTestController::authenticateSession(JSStringRef url, JSStringRef user RetainPtr<CFStringRef> usernameCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, username)); RetainPtr<CFStringRef> passwordCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, password)); - NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:(NSString *)urlStringCF.get()]]; + RetainPtr<NSURLRequest> request(AdoptNS, [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:(NSString *)urlStringCF.get()]]); - [SynchronousLoader makeRequest:request withUsername:(NSString *)usernameCF.get() password:(NSString *)passwordCF.get()]; + [SynchronousLoader makeRequest:request.get() withUsername:(NSString *)usernameCF.get() password:(NSString *)passwordCF.get()]; #endif } @@ -1004,6 +1077,12 @@ bool LayoutTestController::hasSpellingMarker(int from, int length) { return [mainFrame hasSpellingMarker:from length:length]; } + +bool LayoutTestController::hasGrammarMarker(int from, int length) +{ + return [mainFrame hasGrammarMarker:from length:length]; +} + void LayoutTestController::dumpConfigurationForViewport(int /*deviceDPI*/, int /*deviceWidth*/, int /*deviceHeight*/, int /*availableWidth*/, int /*availableHeight*/) { diff --git a/Tools/DumpRenderTree/mac/PerlSupport/Makefile b/Tools/DumpRenderTree/mac/PerlSupport/Makefile index 16a9e51..96ddc93 100644 --- a/Tools/DumpRenderTree/mac/PerlSupport/Makefile +++ b/Tools/DumpRenderTree/mac/PerlSupport/Makefile @@ -66,7 +66,7 @@ $(PERL_MODULE): DumpRenderTreeSupportPregenerated.pm $(DUMPRENDERTREE) endif $(DYLIB): DumpRenderTreeSupport.c $(WRAPPER) - gcc -g -dynamiclib -o $(DYLIB) `$(PERL) -MExtUtils::Embed -eperl_inc` `$(PERL) -MExtUtils::Embed -eldopts` $^ + gcc -g -dynamiclib -o $(DYLIB) `$(PERL) -MExtUtils::Embed -eperl_inc` `$(PERL) -MExtUtils::Embed -e'my $$opts = ldopts(0); $$opts =~ s/-arch [^ ]*( |$$)//g; print $$opts, " -arch ", join(" -arch ", split(" ",$$ENV{ARCHS}))'` $^ clean: rm -f $(WRAPPER) $(PERL_MODULE) $(DYLIB) diff --git a/Tools/DumpRenderTree/mac/UIDelegate.h b/Tools/DumpRenderTree/mac/UIDelegate.h index a8017ad..982b480 100644 --- a/Tools/DumpRenderTree/mac/UIDelegate.h +++ b/Tools/DumpRenderTree/mac/UIDelegate.h @@ -37,5 +37,6 @@ } - (void)didSetMockGeolocationPermission; +- (int)numberOfPendingGeolocationPermissionRequests; @end diff --git a/Tools/DumpRenderTree/mac/UIDelegate.mm b/Tools/DumpRenderTree/mac/UIDelegate.mm index 06a71f8..6b84738 100644 --- a/Tools/DumpRenderTree/mac/UIDelegate.mm +++ b/Tools/DumpRenderTree/mac/UIDelegate.mm @@ -205,6 +205,14 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; m_timer = [NSTimer scheduledTimerWithTimeInterval:0 target:self selector:@selector(timerFired) userInfo:0 repeats:NO]; } +- (int)numberOfPendingGeolocationPermissionRequests +{ + if (!m_pendingGeolocationPermissionListeners) + return 0; + return [m_pendingGeolocationPermissionListeners count]; +} + + - (void)timerFired { ASSERT(gLayoutTestController->isGeolocationPermissionSet()); @@ -227,7 +235,7 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; return NO; } -- (BOOL)webView:(WebView *)webView supportsFullScreenForElement:(DOMElement*)element +- (BOOL)webView:(WebView *)webView supportsFullScreenForElement:(DOMElement*)element withKeyboard:(BOOL)withKeyboard { return YES; } diff --git a/Tools/DumpRenderTree/mac/WebArchiveDumpSupportMac.mm b/Tools/DumpRenderTree/mac/WebArchiveDumpSupportMac.mm index c273087..9f94ecb 100644 --- a/Tools/DumpRenderTree/mac/WebArchiveDumpSupportMac.mm +++ b/Tools/DumpRenderTree/mac/WebArchiveDumpSupportMac.mm @@ -23,6 +23,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#import "config.h" #import "WebArchiveDumpSupport.h" #import <CFNetwork/CFHTTPMessage.h> |