Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(457)

Side by Side Diff: ios/net/cookies/cookie_store_ios_unittest.mm

Issue 2481923002: [WIP] make GURL::path() return a StringPiece (Closed)
Patch Set: thanks asan Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ios/net/cookies/cookie_cache_unittest.cc ('k') | ios/web/public/test/http_server.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ios/net/cookies/cookie_store_ios.h" 5 #include "ios/net/cookies/cookie_store_ios.h"
6 6
7 #import <Foundation/Foundation.h> 7 #import <Foundation/Foundation.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 // Wait until the flush is posted. 398 // Wait until the flush is posted.
399 base::RunLoop().RunUntilIdle(); 399 base::RunLoop().RunUntilIdle();
400 } 400 }
401 401
402 void SetSystemCookie(const GURL& url, 402 void SetSystemCookie(const GURL& url,
403 const std::string& name, 403 const std::string& name,
404 const std::string& value) { 404 const std::string& value) {
405 NSHTTPCookieStorage* storage = 405 NSHTTPCookieStorage* storage =
406 [NSHTTPCookieStorage sharedHTTPCookieStorage]; 406 [NSHTTPCookieStorage sharedHTTPCookieStorage];
407 [storage setCookie:[NSHTTPCookie cookieWithProperties:@{ 407 [storage setCookie:[NSHTTPCookie cookieWithProperties:@{
408 NSHTTPCookiePath : base::SysUTF8ToNSString(url.path()), 408 NSHTTPCookiePath : base::SysUTF8ToNSString(url.path().as_string()),
409 NSHTTPCookieName : base::SysUTF8ToNSString(name), 409 NSHTTPCookieName : base::SysUTF8ToNSString(name),
410 NSHTTPCookieValue : base::SysUTF8ToNSString(value), 410 NSHTTPCookieValue : base::SysUTF8ToNSString(value),
411 NSHTTPCookieDomain : base::SysUTF8ToNSString(url.host()), 411 NSHTTPCookieDomain : base::SysUTF8ToNSString(url.host()),
412 }]]; 412 }]];
413 net::CookieStoreIOS::NotifySystemCookiesChanged(); 413 net::CookieStoreIOS::NotifySystemCookiesChanged();
414 base::RunLoop().RunUntilIdle(); 414 base::RunLoop().RunUntilIdle();
415 } 415 }
416 416
417 void DeleteSystemCookie(const GURL& gurl, const std::string& name) { 417 void DeleteSystemCookie(const GURL& gurl, const std::string& name) {
418 NSHTTPCookieStorage* storage = 418 NSHTTPCookieStorage* storage =
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 EXPECT_EQ(2U, cookies.size()); 993 EXPECT_EQ(2U, cookies.size());
994 // this deletes the callback 994 // this deletes the callback
995 handle.reset(); 995 handle.reset();
996 SetSystemCookie(kTestCookieURL, "abc", "jkl"); 996 SetSystemCookie(kTestCookieURL, "abc", "jkl");
997 EXPECT_EQ(2U, cookies.size()); 997 EXPECT_EQ(2U, cookies.size());
998 DeleteSystemCookie(kTestCookieURL, "abc"); 998 DeleteSystemCookie(kTestCookieURL, "abc");
999 store_->UnSynchronize(); 999 store_->UnSynchronize();
1000 } 1000 }
1001 1001
1002 } // namespace net 1002 } // namespace net
OLDNEW
« no previous file with comments | « ios/net/cookies/cookie_cache_unittest.cc ('k') | ios/web/public/test/http_server.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698