Changeset 242727 in webkit
- Timestamp:
- Mar 11, 2019, 12:38:04 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/http/wpt/cache-storage/cache-quota.any.js (modified) (3 diffs)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl (modified) (1 diff)
-
Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (modified) (1 diff)
-
Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (modified) (1 diff)
-
Tools/WebKitTestRunner/TestController.cpp (modified) (1 diff)
-
Tools/WebKitTestRunner/TestController.h (modified) (1 diff)
-
Tools/WebKitTestRunner/TestInvocation.cpp (modified) (1 diff)
-
Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm (modified) (2 diffs)
-
Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r242714 r242727 1 2019-03-11 Youenn Fablet <youenn@apple.com> 2 3 Allow storage quota increase by default in WTR 4 https://bugs.webkit.org/show_bug.cgi?id=195541 5 6 Reviewed by Geoffrey Garen. 7 8 * http/wpt/cache-storage/cache-quota.any.js: 9 (promise_test): 10 1 11 2019-03-11 Ryan Haddad <ryanhaddad@apple.com> 2 12 -
trunk/LayoutTests/http/wpt/cache-storage/cache-quota.any.js
r240156 r242727 4 4 var test_url = 'https://example.com/foo'; 5 5 var test_body = 'Hello world!'; 6 7 if (window.testRunner) 8 testRunner.setAllowStorageQuotaIncrease(false); 6 9 7 10 function getResponseBodySizeWithPadding(response) … … 129 132 130 133 promise_test((test) => { 131 if (!window.internals )134 if (!window.internals || !window.testRunner) 132 135 return Promise.reject("Test requires internals"); 133 136 … … 153 156 }); 154 157 }).then(() => { 155 testRunner. allowCacheStorageQuotaIncrease();158 testRunner.setAllowStorageQuotaIncrease(true); 156 159 return cache.put("1ko", response1ko.clone()); 157 160 }).then(() => { -
trunk/Tools/ChangeLog
r242724 r242727 1 2019-03-11 Youenn Fablet <youenn@apple.com> 2 3 Allow storage quota increase by default in WTR 4 https://bugs.webkit.org/show_bug.cgi?id=195541 5 6 Reviewed by Geoffrey Garen. 7 8 Allow storage quota increase by default in WTR. 9 Move from testRunner.allowStorageQuotaIncrease to testRunner.setAllowStorageQuotaIncrease. 10 Use this for tests that explicitly need cache increase. 11 12 Instead of increasing quota by 2, make sure the next request is 13 granted by adding all given parameters. 14 15 * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: 16 * WebKitTestRunner/InjectedBundle/TestRunner.cpp: 17 (WTR::TestRunner::setAllowStorageQuotaIncrease): 18 (WTR::TestRunner::allowCacheStorageQuotaIncrease): Deleted. 19 * WebKitTestRunner/InjectedBundle/TestRunner.h: 20 * WebKitTestRunner/TestController.cpp: 21 (WTR::TestController::setAllowStorageQuotaIncrease): 22 (WTR::TestController::allowCacheStorageQuotaIncrease): Deleted. 23 * WebKitTestRunner/TestController.h: 24 * WebKitTestRunner/TestInvocation.cpp: 25 (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle): 26 * WebKitTestRunner/cocoa/TestControllerCocoa.mm: 27 (WTR::TestController::cocoaResetStateToConsistentValues): 28 (WTR::TestController::setAllowStorageQuotaIncrease): 29 (WTR::TestController::allowCacheStorageQuotaIncrease): Deleted. 30 * WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.mm: 31 (-[TestWebsiteDataStoreDelegate requestStorageSpace:frameOrigin:quota:currentSize:spaceRequired:decisionHandler:]): 32 1 33 2019-03-11 Xan Lopez <xan@igalia.com> 2 34 -
trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
r242712 r242727 64 64 boolean hasDOMCache(DOMString origin); 65 65 unsigned long domCacheSize(DOMString origin); 66 void allowCacheStorageQuotaIncrease();66 void setAllowStorageQuotaIncrease(boolean value); 67 67 68 68 // Special options. -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
r242712 r242727 2420 2420 } 2421 2421 2422 void TestRunner::allowCacheStorageQuotaIncrease() 2423 { 2424 WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("AllowCacheStorageQuotaIncrease")); 2425 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr); 2422 void TestRunner::setAllowStorageQuotaIncrease(bool willIncrease) 2423 { 2424 WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetAllowStorageQuotaIncrease")); 2425 WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(willIncrease)); 2426 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); 2426 2427 } 2427 2428 -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
r242712 r242727 176 176 bool hasDOMCache(JSStringRef origin); 177 177 uint64_t domCacheSize(JSStringRef origin); 178 void allowCacheStorageQuotaIncrease();178 void setAllowStorageQuotaIncrease(bool); 179 179 180 180 // IndexedDB -
trunk/Tools/WebKitTestRunner/TestController.cpp
r242712 r242727 3041 3041 3042 3042 #if !PLATFORM(COCOA) 3043 void TestController:: allowCacheStorageQuotaIncrease()3043 void TestController::setAllowStorageQuotaIncrease(bool) 3044 3044 { 3045 3045 // FIXME: To implement. -
trunk/Tools/WebKitTestRunner/TestController.h
r242712 r242727 263 263 bool hasDOMCache(WKStringRef origin); 264 264 uint64_t domCacheSize(WKStringRef origin); 265 void allowCacheStorageQuotaIncrease(); 265 266 void setAllowStorageQuotaIncrease(bool); 266 267 267 268 void setIDBPerOriginQuota(uint64_t); -
trunk/Tools/WebKitTestRunner/TestInvocation.cpp
r242712 r242727 1464 1464 } 1465 1465 1466 if (WKStringIsEqualToUTF8CString(messageName, "AllowCacheStorageQuotaIncrease")) { 1467 TestController::singleton().allowCacheStorageQuotaIncrease(); 1466 if (WKStringIsEqualToUTF8CString(messageName, "SetAllowStorageQuotaIncrease")) { 1467 ASSERT(WKGetTypeID(messageBody) == WKBooleanGetTypeID()); 1468 auto canIncrease = WKBooleanGetValue(static_cast<WKBooleanRef>(messageBody)); 1469 TestController::singleton().setAllowStorageQuotaIncrease(canIncrease); 1468 1470 return nullptr; 1469 1471 } -
trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm
r242339 r242727 243 243 } 244 244 245 [globalWebsiteDataStoreDelegateClient setAllowRaisingQuota: false];245 [globalWebsiteDataStoreDelegateClient setAllowRaisingQuota: true]; 246 246 } 247 247 … … 370 370 } 371 371 372 void TestController:: allowCacheStorageQuotaIncrease()373 { 374 [globalWebsiteDataStoreDelegateClient setAllowRaisingQuota: true];372 void TestController::setAllowStorageQuotaIncrease(bool value) 373 { 374 [globalWebsiteDataStoreDelegateClient setAllowRaisingQuota: value]; 375 375 } 376 376 -
trunk/Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.mm
r242497 r242727 34 34 } 35 35 36 - (void)requestStorageSpace:(NSURL *)mainFrameURL frameOrigin:(NSURL *)frameURL quota:(NSUInteger)quota currentSize:(NSUInteger)currentSize spaceRequired:(NSUInteger)spaceRequired decisionHandler:(void (^)(unsigned long long quota))decisionHandler36 - (void)requestStorageSpace:(NSURL *)mainFrameURL frameOrigin:(NSURL *)frameURL quota:(NSUInteger)quota currentSize:(NSUInteger)currentSize spaceRequired:(NSUInteger)spaceRequired decisionHandler:(void (^)(unsigned long long))decisionHandler 37 37 { 38 decisionHandler(_shouldAllowRaisingQuota ? 2 * quota: quota);38 decisionHandler(_shouldAllowRaisingQuota ? quota + currentSize + spaceRequired : quota); 39 39 } 40 40
Note:
See TracChangeset
for help on using the changeset viewer.