| Index: components/cronet/ios/test/cronet_http_test.mm
|
| diff --git a/components/cronet/ios/test/cronet_http_test.mm b/components/cronet/ios/test/cronet_http_test.mm
|
| index e1b1e723037b8b80b1fdf72b94b055ba14bc1c03..0916f4c5f832e10afc2c613d29f2b709ffd5d201 100644
|
| --- a/components/cronet/ios/test/cronet_http_test.mm
|
| +++ b/components/cronet/ios/test/cronet_http_test.mm
|
| @@ -322,6 +322,39 @@ TEST_F(HttpTest, SetSystemCookie) {
|
| EXPECT_TRUE([[delegate_ responseBody] containsString:cookieValue]);
|
| }
|
|
|
| +TEST_F(HttpTest, SystemCookieWithNullCreationTime) {
|
| + const char kCookieHeader[] = "Cookie";
|
| + NSString* cookieName = [NSString
|
| + stringWithFormat:@"SetSystemCookie-%@", [[NSUUID UUID] UUIDString]];
|
| + NSString* cookieValue = [[NSUUID UUID] UUIDString];
|
| + NSHTTPCookieStorage* systemCookieStorage =
|
| + [NSHTTPCookieStorage sharedHTTPCookieStorage];
|
| + NSURL* echoCookieUrl =
|
| + net::NSURLWithGURL(GURL(TestServer::GetEchoHeaderURL(kCookieHeader)));
|
| + NSHTTPCookie* nullCreationTimeCookie = [NSHTTPCookie cookieWithProperties:@{
|
| + NSHTTPCookiePath : [echoCookieUrl path],
|
| + NSHTTPCookieName : cookieName,
|
| + NSHTTPCookieValue : cookieValue,
|
| + NSHTTPCookieDomain : [echoCookieUrl host],
|
| + @"Created" : [NSNumber numberWithDouble:0.0],
|
| + }];
|
| + [systemCookieStorage setCookie:nullCreationTimeCookie];
|
| + NSHTTPCookie* normalCookie = [NSHTTPCookie cookieWithProperties:@{
|
| + NSHTTPCookiePath : [echoCookieUrl path],
|
| + NSHTTPCookieName : [cookieName stringByAppendingString:@"-normal"],
|
| + NSHTTPCookieValue : cookieValue,
|
| + NSHTTPCookieDomain : [echoCookieUrl host],
|
| + }];
|
| + [systemCookieStorage setCookie:normalCookie];
|
| + StartDataTaskAndWaitForCompletion([session_ dataTaskWithURL:echoCookieUrl]);
|
| + [systemCookieStorage deleteCookie:nullCreationTimeCookie];
|
| + [systemCookieStorage deleteCookie:normalCookie];
|
| + EXPECT_EQ(nil, [delegate_ error]);
|
| + // Verify that cookie set in system store was sent to the serever.
|
| + EXPECT_TRUE([[delegate_ responseBody] containsString:cookieName]);
|
| + EXPECT_TRUE([[delegate_ responseBody] containsString:cookieValue]);
|
| +}
|
| +
|
| TEST_F(HttpTest, FilterOutRequest) {
|
| NSURL* url =
|
| net::NSURLWithGURL(GURL(TestServer::GetEchoHeaderURL("User-Agent")));
|
|
|