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

Side by Side Diff: net/extras/sqlite/sqlite_persistent_cookie_store_perftest.cc

Issue 1417353006: Tests: Simplify SequencedWorkerPoolOwner, call Shutdown on destructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adjust formatting and rebase Created 5 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
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/extras/sqlite/sqlite_persistent_cookie_store.h" 5 #include "net/extras/sqlite/sqlite_persistent_cookie_store.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // ~SequencedWorkerPoolOwner blocks on pool shutdown. 92 // ~SequencedWorkerPoolOwner blocks on pool shutdown.
93 pool_owner_.reset(new base::SequencedWorkerPoolOwner(1, "pool")); 93 pool_owner_.reset(new base::SequencedWorkerPoolOwner(1, "pool"));
94 94
95 store_ = new SQLitePersistentCookieStore( 95 store_ = new SQLitePersistentCookieStore(
96 temp_dir_.path().Append(cookie_filename), client_task_runner(), 96 temp_dir_.path().Append(cookie_filename), client_task_runner(),
97 background_task_runner(), false, NULL); 97 background_task_runner(), false, NULL);
98 } 98 }
99 99
100 void TearDown() override { 100 void TearDown() override {
101 store_ = NULL; 101 store_ = NULL;
102 pool_owner_->pool()->Shutdown();
103 } 102 }
104 103
105 protected: 104 protected:
106 base::MessageLoop main_loop_; 105 base::MessageLoop main_loop_;
107 scoped_ptr<base::SequencedWorkerPoolOwner> pool_owner_; 106 scoped_ptr<base::SequencedWorkerPoolOwner> pool_owner_;
108 base::WaitableEvent loaded_event_; 107 base::WaitableEvent loaded_event_;
109 base::WaitableEvent key_loaded_event_; 108 base::WaitableEvent key_loaded_event_;
110 std::vector<CanonicalCookie*> cookies_; 109 std::vector<CanonicalCookie*> cookies_;
111 base::ScopedTempDir temp_dir_; 110 base::ScopedTempDir temp_dir_;
112 scoped_refptr<SQLitePersistentCookieStore> store_; 111 scoped_refptr<SQLitePersistentCookieStore> store_;
(...skipping 19 matching lines...) Expand all
132 // Test the performance of load 131 // Test the performance of load
133 TEST_F(SQLitePersistentCookieStorePerfTest, TestLoadPerformance) { 132 TEST_F(SQLitePersistentCookieStorePerfTest, TestLoadPerformance) {
134 base::PerfTimeLogger timer("Load all cookies"); 133 base::PerfTimeLogger timer("Load all cookies");
135 Load(); 134 Load();
136 timer.Done(); 135 timer.Done();
137 136
138 ASSERT_EQ(15000U, cookies_.size()); 137 ASSERT_EQ(15000U, cookies_.size());
139 } 138 }
140 139
141 } // namespace net 140 } // namespace net
OLDNEW
« no previous file with comments | « net/base/file_stream_unittest.cc ('k') | net/extras/sqlite/sqlite_persistent_cookie_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698