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

Side by Side Diff: net/cookies/cookie_monster_unittest.cc

Issue 12767006: [Cleanup] Remove StringPrintf from global namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase, once more Created 7 years, 9 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "net/cookies/cookie_store_unittest.h" 5 #include "net/cookies/cookie_store_unittest.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 domain_max_cookies - domain_purge_cookies); 350 domain_max_cookies - domain_purge_cookies);
351 EXPECT_LE(total_cookies, domain_max_cookies); 351 EXPECT_LE(total_cookies, domain_max_cookies);
352 } 352 }
353 } 353 }
354 354
355 // Function for creating a CM with a number of cookies in it, 355 // Function for creating a CM with a number of cookies in it,
356 // no store (and hence no ability to affect access time). 356 // no store (and hence no ability to affect access time).
357 CookieMonster* CreateMonsterForGC(int num_cookies) { 357 CookieMonster* CreateMonsterForGC(int num_cookies) {
358 CookieMonster* cm(new CookieMonster(NULL, NULL)); 358 CookieMonster* cm(new CookieMonster(NULL, NULL));
359 for (int i = 0; i < num_cookies; i++) { 359 for (int i = 0; i < num_cookies; i++) {
360 SetCookie(cm, GURL(StringPrintf("http://h%05d.izzle", i)), "a=1"); 360 SetCookie(cm, GURL(base::StringPrintf("http://h%05d.izzle", i)), "a=1");
361 } 361 }
362 return cm; 362 return cm;
363 } 363 }
364 }; 364 };
365 365
366 // TODO(erikwright): Replace the other callbacks and synchronous helper methods 366 // TODO(erikwright): Replace the other callbacks and synchronous helper methods
367 // in this test suite with these Mocks. 367 // in this test suite with these Mocks.
368 template<typename T, typename C> class MockCookieCallback { 368 template<typename T, typename C> class MockCookieCallback {
369 public: 369 public:
370 C AsCallback() { 370 C AsCallback() {
(...skipping 1853 matching lines...) Expand 10 before | Expand all | Expand 10 after
2224 EXPECT_EQ(CookieStoreCommand::ADD, store->commands()[4].type); 2224 EXPECT_EQ(CookieStoreCommand::ADD, store->commands()[4].type);
2225 2225
2226 // Create some non-persistent cookies and check that they don't go to the 2226 // Create some non-persistent cookies and check that they don't go to the
2227 // persistent storage. 2227 // persistent storage.
2228 EXPECT_TRUE(SetCookie(cm, url_google_, "B=Bar")); 2228 EXPECT_TRUE(SetCookie(cm, url_google_, "B=Bar"));
2229 this->MatchCookieLines("A=Foo; B=Bar", GetCookies(cm, url_google_)); 2229 this->MatchCookieLines("A=Foo; B=Bar", GetCookies(cm, url_google_));
2230 EXPECT_EQ(5u, store->commands().size()); 2230 EXPECT_EQ(5u, store->commands().size());
2231 } 2231 }
2232 2232
2233 } // namespace net 2233 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698