WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-195541-20190310210949.patch (text/plain), 10.44 KB, created by
youenn fablet
on 2019-03-10 21:09:51 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
youenn fablet
Created:
2019-03-10 21:09:51 PDT
Size:
10.44 KB
patch
obsolete
>Subversion Revision: 242596 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 8a948d1deca2d6a8e0ed43e2b39d66beb5092400..bb690b17f35234f8d514ea76eb88cce807cd021a 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,32 @@ >+2019-03-10 Youenn Fablet <youenn@apple.com> >+ >+ Allow storage quota increase by default in WTR >+ https://bugs.webkit.org/show_bug.cgi?id=195541 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Allow storage quota increase by default in WTR. >+ Move from testRunner.allowStorageQuotaIncrease to testRunner.setAllowStorageQuotaIncrease. >+ Use this for tests that explicitly need cache increase. >+ >+ * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: >+ * WebKitTestRunner/InjectedBundle/TestRunner.cpp: >+ (WTR::TestRunner::setAllowStorageQuotaIncrease): >+ (WTR::TestRunner::allowCacheStorageQuotaIncrease): Deleted. >+ * WebKitTestRunner/InjectedBundle/TestRunner.h: >+ * WebKitTestRunner/TestController.cpp: >+ (WTR::TestController::setAllowStorageQuotaIncrease): >+ (WTR::TestController::allowCacheStorageQuotaIncrease): Deleted. >+ * WebKitTestRunner/TestController.h: >+ * WebKitTestRunner/TestInvocation.cpp: >+ (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle): >+ * WebKitTestRunner/cocoa/TestControllerCocoa.mm: >+ (WTR::TestController::cocoaResetStateToConsistentValues): >+ (WTR::TestController::setAllowStorageQuotaIncrease): >+ (WTR::TestController::allowCacheStorageQuotaIncrease): Deleted. >+ * WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.mm: >+ (-[TestWebsiteDataStoreDelegate requestStorageSpace:frameOrigin:quota:currentSize:spaceRequired:decisionHandler:]): >+ > 2019-03-07 Commit Queue <commit-queue@webkit.org> > > Unreviewed, rolling out r242354. >diff --git a/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl b/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl >index 0e79d80b601f3295e8b815ba1008b997d1b80c6f..08897ce61bb8345ce276a759932dea66e37b5897 100644 >--- a/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl >+++ b/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl >@@ -63,7 +63,7 @@ interface TestRunner { > void clearDOMCache(DOMString origin); > boolean hasDOMCache(DOMString origin); > unsigned long domCacheSize(DOMString origin); >- void allowCacheStorageQuotaIncrease(); >+ void setAllowStorageQuotaIncrease(boolean value); > > // Special options. > void keepWebHistory(); >diff --git a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp >index d462246cdb9c18f77ce45d731372804a651dd302..0d35379654f120b521e905f4b5945e8870338e73 100644 >--- a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp >+++ b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp >@@ -2379,10 +2379,11 @@ uint64_t TestRunner::domCacheSize(JSStringRef origin) > return WKUInt64GetValue(static_cast<WKUInt64Ref>(returnData)); > } > >-void TestRunner::allowCacheStorageQuotaIncrease() >+void TestRunner::setAllowStorageQuotaIncrease(bool willIncrease) > { >- WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("AllowCacheStorageQuotaIncrease")); >- WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr); >+ WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetAllowStorageQuotaIncrease")); >+ WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(willIncrease)); >+ WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); > } > > void TestRunner::getApplicationManifestThen(JSValueRef callback) >diff --git a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h >index 713a943363905f0c9b760d574ac8f324d8d516fc..b9f059abffbd8e5561b2ab92ff8b87a6e32c37db 100644 >--- a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h >+++ b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h >@@ -175,7 +175,7 @@ public: > void clearDOMCaches(); > bool hasDOMCache(JSStringRef origin); > uint64_t domCacheSize(JSStringRef origin); >- void allowCacheStorageQuotaIncrease(); >+ void setAllowStorageQuotaIncrease(bool); > > // IndexedDB > void setIDBPerOriginQuota(uint64_t); >diff --git a/Tools/WebKitTestRunner/TestController.cpp b/Tools/WebKitTestRunner/TestController.cpp >index 4558ba2cf95f35ec8b602c9d7ad4629cd1f4e123..4bea05bd453a472be0f21c902d16bb7132c1598d 100644 >--- a/Tools/WebKitTestRunner/TestController.cpp >+++ b/Tools/WebKitTestRunner/TestController.cpp >@@ -3021,7 +3021,7 @@ uint64_t TestController::domCacheSize(WKStringRef origin) > } > > #if !PLATFORM(COCOA) >-void TestController::allowCacheStorageQuotaIncrease() >+void TestController::setAllowStorageQuotaIncrease(bool) > { > // FIXME: To implement. > } >diff --git a/Tools/WebKitTestRunner/TestController.h b/Tools/WebKitTestRunner/TestController.h >index 1d13b55237390b76fb92e10af935d79f0b6310b4..154fb9687ac4c6f03f821c5d3d54b07389fce325 100644 >--- a/Tools/WebKitTestRunner/TestController.h >+++ b/Tools/WebKitTestRunner/TestController.h >@@ -256,7 +256,8 @@ public: > void clearDOMCaches(); > bool hasDOMCache(WKStringRef origin); > uint64_t domCacheSize(WKStringRef origin); >- void allowCacheStorageQuotaIncrease(); >+ >+ void setAllowStorageQuotaIncrease(bool); > > void setIDBPerOriginQuota(uint64_t); > >diff --git a/Tools/WebKitTestRunner/TestInvocation.cpp b/Tools/WebKitTestRunner/TestInvocation.cpp >index 6660cdc921f897cce2f771d8d53a5c26f21248f9..7e37e74339787c718e75732cba4af3b8c5768a3d 100644 >--- a/Tools/WebKitTestRunner/TestInvocation.cpp >+++ b/Tools/WebKitTestRunner/TestInvocation.cpp >@@ -1435,8 +1435,10 @@ WKRetainPtr<WKTypeRef> TestInvocation::didReceiveSynchronousMessageFromInjectedB > return result; > } > >- if (WKStringIsEqualToUTF8CString(messageName, "AllowCacheStorageQuotaIncrease")) { >- TestController::singleton().allowCacheStorageQuotaIncrease(); >+ if (WKStringIsEqualToUTF8CString(messageName, "SetAllowStorageQuotaIncrease")) { >+ ASSERT(WKGetTypeID(messageBody) == WKBooleanGetTypeID()); >+ auto canIncrease = WKBooleanGetValue(static_cast<WKBooleanRef>(messageBody)); >+ TestController::singleton().setAllowStorageQuotaIncrease(canIncrease); > return nullptr; > } > >diff --git a/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm b/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm >index c4fe3214d2cee2a90a34ad46769b694369494161..559433813cb03076d11d6dbdad1539c1c724b969 100644 >--- a/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm >+++ b/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm >@@ -242,7 +242,7 @@ void TestController::cocoaResetStateToConsistentValues(const TestOptions& option > [platformView toggleContinuousSpellChecking:nil]; > } > >- [globalWebsiteDataStoreDelegateClient setAllowRaisingQuota: false]; >+ [globalWebsiteDataStoreDelegateClient setAllowRaisingQuota: true]; > } > > void TestController::platformWillRunTest(const TestInvocation& testInvocation) >@@ -369,9 +369,9 @@ bool TestController::keyExistsInKeychain(const String& attrLabel, const String& > return false; > } > >-void TestController::allowCacheStorageQuotaIncrease() >+void TestController::setAllowStorageQuotaIncrease(bool value) > { >- [globalWebsiteDataStoreDelegateClient setAllowRaisingQuota: true]; >+ [globalWebsiteDataStoreDelegateClient setAllowRaisingQuota: value]; > } > > bool TestController::canDoServerTrustEvaluationInNetworkProcess() const >diff --git a/Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.mm b/Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.mm >index ac8bb31a769dc617f902b91dd40d306bc9e2dfc0..8ef467ae5bb302dbe6758f4c9f79cd9fff3c270c 100644 >--- a/Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.mm >+++ b/Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.mm >@@ -33,9 +33,9 @@ - (instancetype)init > return self; > } > >-- (void)requestStorageSpace:(NSURL *)mainFrameURL frameOrigin:(NSURL *)frameURL quota:(NSUInteger)quota currentSize:(NSUInteger)currentSize spaceRequired:(NSUInteger)spaceRequired decisionHandler:(void (^)(unsigned long long quota))decisionHandler >+- (void)requestStorageSpace:(NSURL *)mainFrameURL frameOrigin:(NSURL *)frameURL quota:(NSUInteger)quota currentSize:(NSUInteger)currentSize spaceRequired:(NSUInteger)spaceRequired decisionHandler:(void (^)(unsigned long long))decisionHandler > { >- decisionHandler(_shouldAllowRaisingQuota ? 2 * quota : quota); >+ decisionHandler(_shouldAllowRaisingQuota ? quota + currentSize + spaceRequired : quota); > } > > - (void)setAllowRaisingQuota:(BOOL)shouldAllowRaisingQuota >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index e43904be3ea9316caf08d7096bd7e88f1f0a9809..a384ee14d645b3a5873342720f7367312c5c99e0 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,13 @@ >+2019-03-10 Youenn Fablet <youenn@apple.com> >+ >+ Allow storage quota increase by default in WTR >+ https://bugs.webkit.org/show_bug.cgi?id=195541 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * http/wpt/cache-storage/cache-quota.any.js: >+ (promise_test): >+ > 2019-03-07 Frederic Wang <fwang@igalia.com> > > Update WPT tests for embedded content >diff --git a/LayoutTests/http/wpt/cache-storage/cache-quota.any.js b/LayoutTests/http/wpt/cache-storage/cache-quota.any.js >index f79d32850cc5337da3e7769ffe5a0a2b22c6401a..afc74cc4a44bf72c3945680831bb803f0a984fd9 100644 >--- a/LayoutTests/http/wpt/cache-storage/cache-quota.any.js >+++ b/LayoutTests/http/wpt/cache-storage/cache-quota.any.js >@@ -4,6 +4,9 @@ > var test_url = 'https://example.com/foo'; > var test_body = 'Hello world!'; > >+if (window.testRunner) >+ testRunner.setAllowStorageQuotaIncrease(false); >+ > function getResponseBodySizeWithPadding(response) > { > var cache; >@@ -128,7 +131,7 @@ promise_test((test) => { > }, 'Hitting cache quota for non opaque responses'); > > promise_test((test) => { >- if (!window.internals) >+ if (!window.internals || !window.testRunner) > return Promise.reject("Test requires internals"); > > var cache; >@@ -152,7 +155,7 @@ promise_test((test) => { > assert_equals(e.name, "QuotaExceededError"); > }); > }).then(() => { >- testRunner.allowCacheStorageQuotaIncrease(); >+ testRunner.setAllowStorageQuotaIncrease(true); > return cache.put("1ko", response1ko.clone()); > }).then(() => { > return cache.delete("1ko-padded-to-200ko");
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 195541
:
364228
|
364230