WebKit Bugzilla
Attachment 339212 Details for
Bug 185041
: [WKHTTPCookieStore getAllCookies] returns inconsistent creation time
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185041-20180501120253.patch (text/plain), 3.61 KB, created by
Sihui Liu
on 2018-05-01 12:02:53 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Sihui Liu
Created:
2018-05-01 12:02:53 PDT
Size:
3.61 KB
patch
obsolete
>Subversion Revision: 231178 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index cba905e6179e4a78f79a07354fd7a9e518740329..594eb27f4274b3640be60440d49ecf93dbde7726 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,14 @@ >+2018-04-30 Sihui Liu <sihui_liu@apple.com> >+ >+ [WKHTTPCookieStore getAllCookies] returns inconsistent creation time >+ https://bugs.webkit.org/show_bug.cgi?id=185041 >+ <rdar://problem/34684214> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm: >+ (TEST): >+ > 2018-04-30 Mark Lam <mark.lam@apple.com> > > Apply PtrTags to the MetaAllocator and friends. >diff --git a/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm b/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm >index 9d5d7ecd6dc2a4719cd7d49fcc0a254ecd619798..65b55f1dfd9f531ad235d65bc47d043a3d9397ba 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm >+++ b/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm >@@ -33,6 +33,7 @@ > #import <WebKit/WKWebsiteDataStorePrivate.h> > #import <WebKit/_WKWebsiteDataStoreConfiguration.h> > #import <wtf/RetainPtr.h> >+#import <wtf/Seconds.h> > > #if WK_API_ENABLED > >@@ -310,6 +311,62 @@ TEST(WebKit, WKHTTPCookieStoreHttpOnly) > [cookies release]; > } > >+TEST(WebKit, WKHTTPCookieStoreCreationTime) >+{ >+ WKWebsiteDataStore* dataStore = [WKWebsiteDataStore defaultDataStore]; >+ >+ auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]); >+ configuration.get().websiteDataStore = dataStore; >+ auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]); >+ >+ [webView loadHTMLString:@"WebKit Test" baseURL:[NSURL URLWithString:@"http://webkit.org"]]; >+ [webView _test_waitForDidFinishNavigation]; >+ >+ [dataStore removeDataOfTypes:[WKWebsiteDataStore allWebsiteDataTypes] modifiedSince:[NSDate distantPast] completionHandler:[] { >+ gotFlag = true; >+ }]; >+ TestWebKitAPI::Util::run(&gotFlag); >+ gotFlag = false; >+ >+ globalCookieStore = dataStore.httpCookieStore; >+ >+ RetainPtr<NSArray<NSHTTPCookie *>> cookies; >+ RetainPtr<NSHTTPCookie> cookie = [NSHTTPCookie cookieWithProperties:@{ >+ NSHTTPCookiePath: @"/path", >+ NSHTTPCookieName: @"CookieName", >+ NSHTTPCookieValue: @"CookieValue", >+ NSHTTPCookieDomain: @".www.webkit.org", >+ }]; >+ >+ [globalCookieStore setCookie:cookie.get() completionHandler:[]() { >+ gotFlag = true; >+ }]; >+ TestWebKitAPI::Util::run(&gotFlag); >+ gotFlag = false; >+ >+ [globalCookieStore getAllCookies:[cookiesPtr = &cookies](NSArray<NSHTTPCookie *> *nsCookies) { >+ *cookiesPtr = [nsCookies retain]; >+ gotFlag = true; >+ }]; >+ TestWebKitAPI::Util::run(&gotFlag); >+ gotFlag = false; >+ ASSERT_EQ(1u, cookies.get().count); >+ NSNumber *creationTime = [cookies objectAtIndex:0].properties[@"Created"]; >+ >+ sleep(1_s); >+ >+ [globalCookieStore getAllCookies:[cookiesPtr = &cookies](NSArray<NSHTTPCookie *> *nsCookies) { >+ *cookiesPtr = [nsCookies retain]; >+ gotFlag = true; >+ }]; >+ TestWebKitAPI::Util::run(&gotFlag); >+ gotFlag = false; >+ ASSERT_EQ(1u, cookies.get().count); >+ NSNumber *creationTime2 = [cookies objectAtIndex:0].properties[@"Created"]; >+ >+ EXPECT_TRUE([creationTime isEqual:creationTime2]); >+} >+ > // FIXME: This should be removed once <rdar://problem/35344202> is resolved and bots are updated. > #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED <= 101301) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MAX_ALLOWED <= 110102) > TEST(WebKit, WKHTTPCookieStoreNonPersistent)
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 185041
:
339171
|
339212
|
339240
|
339803
|
341302