Changeset 230286 in webkit


Ignore:
Timestamp:
Apr 4, 2018 5:22:09 PM (6 years ago)
Author:
BJ Burg
Message:

[Cocoa] WebDriver: test imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_non_session_cookie fails
https://bugs.webkit.org/show_bug.cgi?id=184314
<rdar://problem/39186578>

Reviewed by Timothy Hatcher.

Covered by several tests in add_cookie.py per the bug title.

  • platform/network/cocoa/CookieCocoa.mm:

(WebCore::Cookie::operator NSHTTPCookie * const):
By converting an integral UNIX timestamp to |maxAge| fractional seconds into the future, we introduce unwanted
precision that is truncated when switching back to a UNIX timestamp later. Always round up maxAge so that
the truncated value and actual value are the same.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r230279 r230286  
     12018-04-04  Brian Burg  <bburg@apple.com>
     2
     3        [Cocoa] WebDriver: test imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_non_session_cookie fails
     4        https://bugs.webkit.org/show_bug.cgi?id=184314
     5        <rdar://problem/39186578>
     6
     7        Reviewed by Timothy Hatcher.
     8
     9        Covered by several tests in add_cookie.py per the bug title.
     10
     11        * platform/network/cocoa/CookieCocoa.mm:
     12        (WebCore::Cookie::operator NSHTTPCookie * const):
     13        By converting an integral UNIX timestamp to |maxAge| fractional seconds into the future, we introduce unwanted
     14        precision that is truncated when switching back to a UNIX timestamp later. Always round up maxAge so that
     15        the truncated value and actual value are the same.
     16
    1172018-04-04  Alex Christensen  <achristensen@webkit.org>
    218
  • trunk/Source/WebCore/platform/network/cocoa/CookieCocoa.mm

    r226226 r230286  
    106106
    107107    NSDate *expirationDate = [NSDate dateWithTimeIntervalSince1970:expires / 1000.0];
    108     auto maxAge = [expirationDate timeIntervalSinceNow];
     108    auto maxAge = ceil([expirationDate timeIntervalSinceNow]);
    109109    if (maxAge > 0)
    110110        [properties setObject:[NSString stringWithFormat:@"%f", maxAge] forKey:NSHTTPCookieMaximumAge];
Note: See TracChangeset for help on using the changeset viewer.