⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 259745 in webkit


Ignore:
Timestamp:
Apr 8, 2020, 12:25:31 PM (6 years ago)
Author:
sihui_liu@apple.com
Message:

[macOS] TestWebKitAPI.WKHTTPCookieStore.WithoutProcessPoolDuplicates is failing
https://bugs.webkit.org/show_bug.cgi?id=209992

Reviewed by Geoffrey Garen.

Make sure existing cookies are cleared before test. Otherwise, they will affect test result.

  • TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm:

(clearCookies):
(TEST):

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r259731 r259745  
     12020-04-08  Sihui Liu  <sihui_liu@apple.com>
     2
     3        [macOS] TestWebKitAPI.WKHTTPCookieStore.WithoutProcessPoolDuplicates is failing
     4        https://bugs.webkit.org/show_bug.cgi?id=209992
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Make sure existing cookies are cleared before test. Otherwise, they will affect test result.
     9
     10        * TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm:
     11        (clearCookies):
     12        (TEST):
     13
    1142020-04-08  Kate Cheney  <katherine_cheney@apple.com>
    215
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm

    r257614 r259745  
    635635}
    636636
     637static void clearCookies(WKHTTPCookieStore* cookieStore)
     638{
     639    finished = false;
     640    [cookieStore getAllCookies:^(NSArray<NSHTTPCookie *> *cookies) {
     641        if (!cookies || !cookies.count) {
     642            finished = true;
     643            return;
     644        }
     645
     646        unsigned cookiesCount = cookies.count;
     647        __block unsigned deletedCount = 0;
     648        for (NSHTTPCookie* cookie in cookies) {
     649            [cookieStore deleteCookie:cookie completionHandler:^{
     650                if (++deletedCount == cookiesCount)
     651                    finished = true;
     652            }];
     653        }
     654    }];
     655    TestWebKitAPI::Util::run(&finished);
     656}
     657
    637658TEST(WKHTTPCookieStore, WithoutProcessPoolDuplicates)
    638659{
     
    651672    RetainPtr<NSHTTPCookie> sessionCookieDifferentValue = [NSHTTPCookie cookieWithProperties:properties.get()];
    652673    finished = false;
    653    
     674
     675    clearCookies(httpCookieStore.get());
     676
    654677    [httpCookieStore.get() setCookie:sessionCookie.get() completionHandler:^{
    655678        finished = true;
Note: See TracChangeset for help on using the changeset viewer.