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

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

Issue 11568033: Small fixes to allow unit tests to compile with gcc 4.7.x (tested with gcc 4.7.2) (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years 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
« no previous file with comments | « net/base/x509_util_nss_unittest.cc ('k') | net/cookies/cookie_monster_unittest.cc » ('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 (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 <algorithm> 5 #include <algorithm>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/perftimer.h" 9 #include "base/perftimer.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 // if GC runs twice in a row without any change to the store, the second 370 // if GC runs twice in a row without any change to the store, the second
371 // GC run will not do anything the first one didn't. That's why this is 371 // GC run will not do anything the first one didn't. That's why this is
372 // a performance test. The test should be considered to pass if all the 372 // a performance test. The test should be considered to pass if all the
373 // times reported are approximately the same--this indicates that no GC 373 // times reported are approximately the same--this indicates that no GC
374 // happened repeatedly for any case. 374 // happened repeatedly for any case.
375 TEST_F(CookieMonsterTest, TestGCTimes) { 375 TEST_F(CookieMonsterTest, TestGCTimes) {
376 SetCookieCallback setCookieCallback; 376 SetCookieCallback setCookieCallback;
377 377
378 const struct TestCase { 378 const struct TestCase {
379 const char* name; 379 const char* name;
380 int num_cookies; 380 size_t num_cookies;
381 int num_old_cookies; 381 size_t num_old_cookies;
382 } test_cases[] = { 382 } test_cases[] = {
383 { 383 {
384 // A whole lot of recent cookies; gc shouldn't happen. 384 // A whole lot of recent cookies; gc shouldn't happen.
385 "all_recent", 385 "all_recent",
386 CookieMonster::kMaxCookies * 2, 386 CookieMonster::kMaxCookies * 2,
387 0, 387 0,
388 }, { 388 }, {
389 // Some old cookies, but still overflowing max. 389 // Some old cookies, but still overflowing max.
390 "mostly_recent", 390 "mostly_recent",
391 CookieMonster::kMaxCookies * 2, 391 CookieMonster::kMaxCookies * 2,
(...skipping 29 matching lines...) Expand all
421 setCookieCallback.SetCookie(cm, gurl, cookie_line); 421 setCookieCallback.SetCookie(cm, gurl, cookie_line);
422 422
423 PerfTimeLogger timer((std::string("GC_") + test_case.name).c_str()); 423 PerfTimeLogger timer((std::string("GC_") + test_case.name).c_str());
424 for (int i = 0; i < kNumCookies; i++) 424 for (int i = 0; i < kNumCookies; i++)
425 setCookieCallback.SetCookie(cm, gurl, cookie_line); 425 setCookieCallback.SetCookie(cm, gurl, cookie_line);
426 timer.Done(); 426 timer.Done();
427 } 427 }
428 } 428 }
429 429
430 } // namespace net 430 } // namespace net
OLDNEW
« no previous file with comments | « net/base/x509_util_nss_unittest.cc ('k') | net/cookies/cookie_monster_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698