diff options
author | Ben Murdoch <benm@google.com> | 2010-08-13 05:20:16 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-08-13 05:20:16 -0700 |
commit | f4958a7d95cd5fbc1c74905e229b02c95cd5ee78 (patch) | |
tree | 14a0f1b07a19948c2ed93d0d8547caa7fe10aa0e /WebKitTools/DumpRenderTree/mac | |
parent | d074a7997da8ce379434eb6e208b97cde8a0841c (diff) | |
parent | f964bc1fd59a545a80a0cc2529ad8830be514871 (diff) | |
download | external_webkit-f4958a7d95cd5fbc1c74905e229b02c95cd5ee78.zip external_webkit-f4958a7d95cd5fbc1c74905e229b02c95cd5ee78.tar.gz external_webkit-f4958a7d95cd5fbc1c74905e229b02c95cd5ee78.tar.bz2 |
Merge changes I60a96064,I6929172f,Idefd9bec,I8cf448f2,I8791737a,I992c56b0,Ibb4b089d,I779a8ec0,Ife412e30,I2da1ae98,Ibcf41849
* changes:
Merge WebKit at r65072 : Update WebKit revision number.
Merge WebKit at r65072 : Update test_expectations.
Merge WebKit at r65072 : Complete cherry-pick of WebKit change 43848 to add EmptyDeviceMotionClient
Merge WebKit at r65072 : Implement DeviceMotionClientAndroid
Merge WebKit at r65072: JSC build fix in InspectorController.h
Merge WebKit at r65072: Fix V8 code generator.
Merge WebKit at r65072 : Build fix for JSC, update ambiguous usage of JSLock.
Merge WebKit at r65072: String class has moved to the WTF namespace.
Merge Webkit at r65072 : Fix conflicts.
Merge Webkit at r65072 : Fix Makefiles.
Merge WebKit at r65072 : Initial merge by git.
Diffstat (limited to 'WebKitTools/DumpRenderTree/mac')
5 files changed, 86 insertions, 7 deletions
diff --git a/WebKitTools/DumpRenderTree/mac/EventSendingController.mm b/WebKitTools/DumpRenderTree/mac/EventSendingController.mm index 77999bd..9031c63 100644 --- a/WebKitTools/DumpRenderTree/mac/EventSendingController.mm +++ b/WebKitTools/DumpRenderTree/mac/EventSendingController.mm @@ -449,13 +449,13 @@ static int buildModifierFlags(const WebScriptObject* modifiers) NSView *subView = [[mainFrame webView] hitTest:[event locationInWindow]]; if (subView) { if (leftMouseButtonDown) { - [subView mouseDragged:event]; if (draggingInfo) { // Per NSDragging.h: draggingSources may not implement draggedImage:movedTo: if ([[draggingInfo draggingSource] respondsToSelector:@selector(draggedImage:movedTo:)]) [[draggingInfo draggingSource] draggedImage:[draggingInfo draggedImage] movedTo:lastMousePosition]; [[mainFrame webView] draggingUpdated:draggingInfo]; - } + } else + [subView mouseDragged:event]; } else [subView mouseMoved:event]; } diff --git a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm index 7db7fff..c0eb722 100644 --- a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm +++ b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm @@ -33,6 +33,7 @@ #import "EditingDelegate.h" #import "MockGeolocationProvider.h" #import "PolicyDelegate.h" +#import "UIDelegate.h" #import "WorkQueue.h" #import "WorkQueueItem.h" #import <Foundation/Foundation.h> @@ -60,6 +61,7 @@ #import <WebKit/WebKitErrors.h> #import <WebKit/WebPreferences.h> #import <WebKit/WebPreferencesPrivate.h> +#import <WebKit/WebQuotaManager.h> #import <WebKit/WebScriptWorld.h> #import <WebKit/WebSecurityOriginPrivate.h> #import <WebKit/WebTypesInternal.h> @@ -123,6 +125,11 @@ bool LayoutTestController::callShouldCloseOnWebView() return [[mainFrame webView] shouldClose]; } +void LayoutTestController::clearAllApplicationCaches() +{ + [WebApplicationCache deleteAllApplicationCaches]; +} + void LayoutTestController::clearAllDatabases() { [[WebDatabaseManager sharedWebDatabaseManager] deleteAllDatabases]; @@ -293,6 +300,13 @@ void LayoutTestController::setAppCacheMaximumSize(unsigned long long size) [WebApplicationCache setMaximumSize:size]; } +void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota) +{ + WebSecurityOrigin *origin = [[WebSecurityOrigin alloc] initWithURL:[NSURL URLWithString:@"http://127.0.0.1:8000"]]; + [[origin applicationCacheQuotaManager] setQuota:quota]; + [origin release]; +} + void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag) { [[[mainFrame webView] preferences] setAuthorAndUserStylesEnabled:flag]; @@ -310,7 +324,7 @@ void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permis void LayoutTestController::setDatabaseQuota(unsigned long long quota) { WebSecurityOrigin *origin = [[WebSecurityOrigin alloc] initWithURL:[NSURL URLWithString:@"file:///"]]; - [origin setQuota:quota]; + [[origin databaseQuotaManager] setQuota:quota]; [origin release]; } @@ -342,6 +356,18 @@ void LayoutTestController::setMockGeolocationError(int code, JSStringRef message [[MockGeolocationProvider shared] setError:error]; } +void LayoutTestController::setGeolocationPermission(bool allow) +{ + setGeolocationPermissionCommon(allow); + [[[mainFrame webView] UIDelegate] didSetMockGeolocationPermission]; +} + +void LayoutTestController::setMockSpeechInputResult(JSStringRef result) +{ + // FIXME: Implement for speech input layout tests. + // See https://bugs.webkit.org/show_bug.cgi?id=39485. +} + void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled) { // FIXME: Workaround <rdar://problem/6480108> diff --git a/WebKitTools/DumpRenderTree/mac/MockGeolocationProvider.mm b/WebKitTools/DumpRenderTree/mac/MockGeolocationProvider.mm index 55d7257..e03cae2 100644 --- a/WebKitTools/DumpRenderTree/mac/MockGeolocationProvider.mm +++ b/WebKitTools/DumpRenderTree/mac/MockGeolocationProvider.mm @@ -74,6 +74,9 @@ - (void)registerWebView:(WebView *)webView { _registeredViews.add(webView); + + if (!_timer) + _timer = [NSTimer scheduledTimerWithTimeInterval:0 target:self selector:@selector(timerFired) userInfo:0 repeats:NO]; } - (void)unregisterWebView:(WebView *)webView diff --git a/WebKitTools/DumpRenderTree/mac/UIDelegate.h b/WebKitTools/DumpRenderTree/mac/UIDelegate.h index da472d6..a8017ad 100644 --- a/WebKitTools/DumpRenderTree/mac/UIDelegate.h +++ b/WebKitTools/DumpRenderTree/mac/UIDelegate.h @@ -32,6 +32,10 @@ @private NSRect m_frame; + NSMutableSet *m_pendingGeolocationPermissionListeners; + NSTimer *m_timer; } +- (void)didSetMockGeolocationPermission; + @end diff --git a/WebKitTools/DumpRenderTree/mac/UIDelegate.mm b/WebKitTools/DumpRenderTree/mac/UIDelegate.mm index 3dc378a..f9afdb1 100644 --- a/WebKitTools/DumpRenderTree/mac/UIDelegate.mm +++ b/WebKitTools/DumpRenderTree/mac/UIDelegate.mm @@ -33,8 +33,10 @@ #import "DumpRenderTreeDraggingInfo.h" #import "EventSendingController.h" #import "LayoutTestController.h" +#import <WebKit/WebApplicationCache.h> #import <WebKit/WebFramePrivate.h> #import <WebKit/WebHTMLViewPrivate.h> +#import <WebKit/WebQuotaManager.h> #import <WebKit/WebSecurityOriginPrivate.h> #import <WebKit/WebUIDelegatePrivate.h> #import <WebKit/WebView.h> @@ -155,12 +157,24 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; - (void)webView:(WebView *)sender frame:(WebFrame *)frame exceededDatabaseQuotaForSecurityOrigin:(WebSecurityOrigin *)origin database:(NSString *)databaseIdentifier { - if (!done && gLayoutTestController->dumpDatabaseCallbacks()) + 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]; + [[origin databaseQuotaManager] setQuota:defaultQuota]; +} + +- (void)webView:(WebView *)sender exceededApplicationCacheOriginQuotaForSecurityOrigin:(WebSecurityOrigin *)origin +{ + if (!done && gLayoutTestController->dumpApplicationCacheDelegateCallbacks()) { + printf("UI DELEGATE APPLICATION CACHE CALLBACK: exceededApplicationCacheOriginQuotaForSecurityOrigin:{%s, %s, %i}\n", + [[origin protocol] UTF8String], [[origin host] UTF8String], [origin port]); + } + + static const unsigned long long defaultOriginQuota = [WebApplicationCache defaultOriginQuota]; + [[origin applicationCacheQuotaManager] setQuota:defaultOriginQuota]; } - (void)webView:(WebView *)sender setStatusText:(NSString *)text @@ -171,13 +185,43 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; - (void)webView:(WebView *)webView decidePolicyForGeolocationRequestFromOrigin:(WebSecurityOrigin *)origin frame:(WebFrame *)frame listener:(id<WebGeolocationPolicyListener>)listener { - // FIXME: If mock permission isn't set yet, we should send the response asynchronously. - if (gLayoutTestController->isGeolocationPermissionSet() && gLayoutTestController->geolocationPermission()) + if (!gLayoutTestController->isGeolocationPermissionSet()) { + if (!m_pendingGeolocationPermissionListeners) + m_pendingGeolocationPermissionListeners = [[NSMutableSet set] retain]; + [m_pendingGeolocationPermissionListeners addObject:listener]; + return; + } + + if (gLayoutTestController->geolocationPermission()) [listener allow]; else [listener deny]; } +- (void)didSetMockGeolocationPermission +{ + ASSERT(gLayoutTestController->isGeolocationPermissionSet()); + if (m_pendingGeolocationPermissionListeners && !m_timer) + m_timer = [NSTimer scheduledTimerWithTimeInterval:0 target:self selector:@selector(timerFired) userInfo:0 repeats:NO]; +} + +- (void)timerFired +{ + ASSERT(gLayoutTestController->isGeolocationPermissionSet()); + m_timer = 0; + NSEnumerator* enumerator = [m_pendingGeolocationPermissionListeners objectEnumerator]; + id<WebGeolocationPolicyListener> listener; + while ((listener = [enumerator nextObject])) { + if (gLayoutTestController->geolocationPermission()) + [listener allow]; + else + [listener deny]; + } + [m_pendingGeolocationPermissionListeners removeAllObjects]; + [m_pendingGeolocationPermissionListeners release]; + m_pendingGeolocationPermissionListeners = nil; +} + - (BOOL)webView:(WebView *)sender shouldHaltPlugin:(DOMNode *)pluginNode { return NO; @@ -193,6 +237,8 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; { [draggingInfo release]; draggingInfo = nil; + [m_pendingGeolocationPermissionListeners release]; + m_pendingGeolocationPermissionListeners = nil; [super dealloc]; } |