WebKit Bugzilla
Attachment 343718 Details for
Bug 187101
: Cookie API: cookie creation time is wrong
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-187101-20180627101232.patch (text/plain), 4.88 KB, created by
Sihui Liu
on 2018-06-27 10:12:32 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Sihui Liu
Created:
2018-06-27 10:12:32 PDT
Size:
4.88 KB
patch
obsolete
>Subversion Revision: 233227 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 0470a5e19d8c777a21b69daa0364a365e3c0facb..8b6afe5fad158c0e932d5fe95747ca48ae9575d5 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,15 @@ >+2018-06-27 Sihui Liu <sihui_liu@apple.com> >+ >+ Cookie API: cookie creation time is wrong >+ https://bugs.webkit.org/show_bug.cgi?id=187101 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Covered by API test: WebKit.WKHTTPCookieStoreCreationTime. >+ >+ * platform/network/cocoa/CookieCocoa.mm: >+ (WebCore::Cookie::operator NSHTTPCookie * _Nullable const): >+ > 2018-06-26 Chris Dumez <cdumez@apple.com> > > Simplify NetworkStorageSession::getAllStorageAccessEntries() >diff --git a/Source/WebCore/platform/network/cocoa/CookieCocoa.mm b/Source/WebCore/platform/network/cocoa/CookieCocoa.mm >index 174c7842537835835c4559183ecbaa0d9610a839..688d99567541987ad1fc8f5f1424da4dcf00411d 100644 >--- a/Source/WebCore/platform/network/cocoa/CookieCocoa.mm >+++ b/Source/WebCore/platform/network/cocoa/CookieCocoa.mm >@@ -161,7 +161,7 @@ Cookie::operator NSHTTPCookie * _Nullable () const > [properties setObject:[NSString stringWithFormat:@"%f", maxAge] forKey:NSHTTPCookieMaximumAge]; > > #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000) >- [properties setObject:[NSNumber numberWithDouble:created / 1000.0] forKey:@"Created"]; >+ [properties setObject:[NSNumber numberWithDouble:created / 1000.0 - NSTimeIntervalSince1970] forKey:@"Created"]; > #endif > > auto* portString = portStringFromVector(ports); >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 90a02bda3267c94dd4bad60736a227e1543cd0be..577677d7b436228c6d345712261134a36f4272fa 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,15 @@ >+2018-06-27 Sihui Liu <sihui_liu@apple.com> >+ >+ Cookie API: cookie creation time is wrong >+ https://bugs.webkit.org/show_bug.cgi?id=187101 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add test coverage: make sure the cookie creation time returned is the same as set. >+ >+ * TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm: >+ (TEST): >+ > 2018-06-26 Daniel Bates <dabates@apple.com> > > EWS should pass --status-host-uses-http when invoking webkit-patch, if needed >diff --git a/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm b/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm >index 82fdedf2e27ea559fc558add9efc1c14949fc64b..8e19ed323b711dd2ca3482c42019ff2eccc32513 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm >+++ b/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm >@@ -367,12 +367,14 @@ TEST(WebKit, WKHTTPCookieStoreCreationTime) > > globalCookieStore = dataStore.httpCookieStore; > >- RetainPtr<NSHTTPCookie> cookie = [NSHTTPCookie cookieWithProperties:@{ >- NSHTTPCookiePath: @"/path", >- NSHTTPCookieName: @"CookieName", >- NSHTTPCookieValue: @"CookieValue", >- NSHTTPCookieDomain: @".www.webkit.org", >- }]; >+ NSMutableDictionary *cookieProperties = [[NSMutableDictionary alloc] init]; >+ [cookieProperties setObject:@"cookieName" forKey:NSHTTPCookieName]; >+ [cookieProperties setObject:@"cookieValue" forKey:NSHTTPCookieValue]; >+ [cookieProperties setObject:@".www.webkit.org" forKey:NSHTTPCookieDomain]; >+ [cookieProperties setObject:@"/path" forKey:NSHTTPCookiePath]; >+ RetainPtr<NSNumber> creationTime = [NSNumber numberWithDouble:100000]; >+ [cookieProperties setObject:creationTime.get() forKey:@"Created"]; >+ RetainPtr<NSHTTPCookie> cookie = [NSHTTPCookie cookieWithProperties:cookieProperties]; > > [globalCookieStore setCookie:cookie.get() completionHandler:[]() { > gotFlag = true; >@@ -380,10 +382,10 @@ TEST(WebKit, WKHTTPCookieStoreCreationTime) > TestWebKitAPI::Util::run(&gotFlag); > gotFlag = false; > >- RetainPtr<NSNumber> creationTime = nil; > [globalCookieStore getAllCookies:[&](NSArray<NSHTTPCookie *> *cookies) { > ASSERT_EQ(1u, cookies.count); >- creationTime = [cookies objectAtIndex:0].properties[@"Created"]; >+ NSNumber* createdTime = [cookies objectAtIndex:0].properties[@"Created"]; >+ EXPECT_TRUE([creationTime.get() isEqual:createdTime]); > gotFlag = true; > }]; > TestWebKitAPI::Util::run(&gotFlag); >@@ -393,8 +395,8 @@ TEST(WebKit, WKHTTPCookieStoreCreationTime) > > [globalCookieStore getAllCookies:^(NSArray<NSHTTPCookie *> *cookies) { > ASSERT_EQ(1u, cookies.count); >- NSNumber* creationTime2 = [cookies objectAtIndex:0].properties[@"Created"]; >- EXPECT_TRUE([creationTime.get() isEqual:creationTime2]); >+ NSNumber* createdTime = [cookies objectAtIndex:0].properties[@"Created"]; >+ EXPECT_TRUE([creationTime.get() isEqual:createdTime]); > gotFlag = true; > }]; > TestWebKitAPI::Util::run(&gotFlag);
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 187101
: 343718 |
343735