Changeset 230473 in webkit


Ignore:
Timestamp:
Apr 9, 2018 11:30:54 PM (6 years ago)
Author:
zandobersek@gmail.com
Message:

WKTR: Enable DOM cache, SW registration directory cleanup on non-Cocoa platforms
https://bugs.webkit.org/show_bug.cgi?id=184414

Reviewed by Michael Catanzaro.

Enable clearServiceWorkerRegistrations(), clearDOMCache() and
clearDOMCaches() implementations in WebKitTestRunner's TestController
class for non-Cocoa platforms. Implementations depend on the generic
WK2 C API that other ports can leverage as well.

The clearDOMCache() and clearDOMCaches() calls are now operational for
tests that invoke them. clearServiceWorkerRegistrations() and
clearDOMCaches() are also called between each test, cleaning up relevant
resources.

The TestController::getAllStorageAccessEntries() stub for non-Cocoa
platforms is moved into the main !PLATFORM(COCOA) block.

  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::getAllStorageAccessEntries):
(WTR::clearServiceWorkerRegistrationsCallback):
(WTR::TestController::clearServiceWorkerRegistrations):
(WTR::clearDOMCacheCallback):
(WTR::TestController::clearDOMCache):
(WTR::TestController::clearDOMCaches):

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r230469 r230473  
     12018-04-09  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        WKTR: Enable DOM cache, SW registration directory cleanup on non-Cocoa platforms
     4        https://bugs.webkit.org/show_bug.cgi?id=184414
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        Enable clearServiceWorkerRegistrations(), clearDOMCache() and
     9        clearDOMCaches() implementations in WebKitTestRunner's TestController
     10        class for non-Cocoa platforms. Implementations depend on the generic
     11        WK2 C API that other ports can leverage as well.
     12
     13        The clearDOMCache() and clearDOMCaches() calls are now operational for
     14        tests that invoke them. clearServiceWorkerRegistrations() and
     15        clearDOMCaches() are also called between each test, cleaning up relevant
     16        resources.
     17
     18        The TestController::getAllStorageAccessEntries() stub for non-Cocoa
     19        platforms is moved into the main !PLATFORM(COCOA) block.
     20
     21        * WebKitTestRunner/TestController.cpp:
     22        (WTR::TestController::getAllStorageAccessEntries):
     23        (WTR::clearServiceWorkerRegistrationsCallback):
     24        (WTR::TestController::clearServiceWorkerRegistrations):
     25        (WTR::clearDOMCacheCallback):
     26        (WTR::TestController::clearDOMCache):
     27        (WTR::TestController::clearDOMCaches):
     28
    1292018-04-09  Zalan Bujtas  <zalan@apple.com>
    230
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r230391 r230473  
    24212421}
    24222422
     2423void TestController::getAllStorageAccessEntries()
     2424{
     2425}
     2426
    24232427#endif
    24242428
    2425 #if PLATFORM(COCOA) && WK_API_ENABLED
    24262429struct ClearServiceWorkerRegistrationsCallbackContext {
    24272430    explicit ClearServiceWorkerRegistrationsCallbackContext(TestController& controller)
     
    24402443    context->testController.notifyDone();
    24412444}
    2442 #endif
    24432445
    24442446void TestController::clearServiceWorkerRegistrations()
    24452447{
    2446 #if PLATFORM(COCOA) && WK_API_ENABLED
    24472448    auto websiteDataStore = WKContextGetWebsiteDataStore(platformContext());
    24482449    ClearServiceWorkerRegistrationsCallbackContext context(*this);
     
    24502451    WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations(websiteDataStore, &context, clearServiceWorkerRegistrationsCallback);
    24512452    runUntil(context.done, noTimeout);
    2452 #endif
    2453 }
    2454 
    2455 #if PLATFORM(COCOA) && WK_API_ENABLED
     2453}
     2454
    24562455struct ClearDOMCacheCallbackContext {
    24572456    explicit ClearDOMCacheCallbackContext(TestController& controller)
     
    24702469    context->testController.notifyDone();
    24712470}
    2472 #endif
    24732471
    24742472void TestController::clearDOMCache(WKStringRef origin)
    24752473{
    2476 #if PLATFORM(COCOA) && WK_API_ENABLED
    24772474    auto websiteDataStore = WKContextGetWebsiteDataStore(platformContext());
    24782475    ClearDOMCacheCallbackContext context(*this);
     
    24812478    WKWebsiteDataStoreRemoveFetchCacheForOrigin(websiteDataStore, cacheOrigin.get(), &context, clearDOMCacheCallback);
    24822479    runUntil(context.done, noTimeout);
    2483 #endif
    24842480}
    24852481
    24862482void TestController::clearDOMCaches()
    24872483{
    2488 #if PLATFORM(COCOA) && WK_API_ENABLED
    24892484    auto websiteDataStore = WKContextGetWebsiteDataStore(platformContext());
    24902485    ClearDOMCacheCallbackContext context(*this);
     
    24922487    WKWebsiteDataStoreRemoveAllFetchCaches(websiteDataStore, &context, clearDOMCacheCallback);
    24932488    runUntil(context.done, noTimeout);
    2494 #endif
    24952489}
    24962490
     
    28302824}
    28312825
    2832 #if !PLATFORM(COCOA)
    2833 void TestController::getAllStorageAccessEntries()
    2834 {
    2835     // FIXME: Implement C API version of this test.
    2836 }
    2837 #endif
    2838 
    28392826} // namespace WTR
Note: See TracChangeset for help on using the changeset viewer.