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

Side by Side Diff: chrome/browser/net/sqlite_persistent_cookie_store_unittest.cc

Issue 10071032: RefCounted types should not have public destructors, chrome/browser/ part 1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Implementation fixes Created 8 years, 8 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/callback.h" 6 #include "base/callback.h"
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/scoped_temp_dir.h" 10 #include "base/scoped_temp_dir.h"
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 void Callback() { 309 void Callback() {
310 ++callback_count_; 310 ++callback_count_;
311 } 311 }
312 312
313 int callback_count() { 313 int callback_count() {
314 return callback_count_; 314 return callback_count_;
315 } 315 }
316 316
317 private: 317 private:
318 friend class base::RefCountedThreadSafe<CallbackCounter>; 318 friend class base::RefCountedThreadSafe<CallbackCounter>;
319 ~CallbackCounter() {}
320
319 volatile int callback_count_; 321 volatile int callback_count_;
320 }; 322 };
321 323
322 // Test that we can get a completion callback after a Flush(). 324 // Test that we can get a completion callback after a Flush().
323 TEST_F(SQLitePersistentCookieStoreTest, TestFlushCompletionCallback) { 325 TEST_F(SQLitePersistentCookieStoreTest, TestFlushCompletionCallback) {
324 InitializeStore(false); 326 InitializeStore(false);
325 // Put some data - any data - on disk, so that Flush is not a no-op. 327 // Put some data - any data - on disk, so that Flush is not a no-op.
326 AddCookie("A", "B", "http://foo.bar", "/", base::Time::Now()); 328 AddCookie("A", "B", "http://foo.bar", "/", base::Time::Now());
327 329
328 scoped_refptr<CallbackCounter> counter(new CallbackCounter()); 330 scoped_refptr<CallbackCounter> counter(new CallbackCounter());
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 447
446 EXPECT_FALSE(cookie_map["session-noexpires"]->DoesExpire()); 448 EXPECT_FALSE(cookie_map["session-noexpires"]->DoesExpire());
447 EXPECT_FALSE(cookie_map["session-noexpires"]->IsPersistent()); 449 EXPECT_FALSE(cookie_map["session-noexpires"]->IsPersistent());
448 450
449 EXPECT_TRUE(cookie_map["persistent"]->DoesExpire()); 451 EXPECT_TRUE(cookie_map["persistent"]->DoesExpire());
450 EXPECT_TRUE(cookie_map["persistent"]->IsPersistent()); 452 EXPECT_TRUE(cookie_map["persistent"]->IsPersistent());
451 453
452 STLDeleteContainerPointers(cookies.begin(), cookies.end()); 454 STLDeleteContainerPointers(cookies.begin(), cookies.end());
453 cookies.clear(); 455 cookies.clear();
454 } 456 }
OLDNEW
« no previous file with comments | « chrome/browser/net/sqlite_persistent_cookie_store.cc ('k') | chrome/browser/net/sqlite_server_bound_cert_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698