OLD | NEW |
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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 temp_dir_.path().Append(cookie_filename), client_task_runner(), | 97 temp_dir_.path().Append(cookie_filename), client_task_runner(), |
98 background_task_runner(), false, NULL); | 98 background_task_runner(), false, NULL); |
99 } | 99 } |
100 | 100 |
101 void TearDown() override { | 101 void TearDown() override { |
102 store_ = NULL; | 102 store_ = NULL; |
103 } | 103 } |
104 | 104 |
105 protected: | 105 protected: |
106 base::MessageLoop main_loop_; | 106 base::MessageLoop main_loop_; |
107 scoped_ptr<base::SequencedWorkerPoolOwner> pool_owner_; | 107 std::unique_ptr<base::SequencedWorkerPoolOwner> pool_owner_; |
108 base::WaitableEvent loaded_event_; | 108 base::WaitableEvent loaded_event_; |
109 base::WaitableEvent key_loaded_event_; | 109 base::WaitableEvent key_loaded_event_; |
110 std::vector<CanonicalCookie*> cookies_; | 110 std::vector<CanonicalCookie*> cookies_; |
111 base::ScopedTempDir temp_dir_; | 111 base::ScopedTempDir temp_dir_; |
112 scoped_refptr<SQLitePersistentCookieStore> store_; | 112 scoped_refptr<SQLitePersistentCookieStore> store_; |
113 }; | 113 }; |
114 | 114 |
115 // Test the performance of priority load of cookies for a specfic domain key | 115 // Test the performance of priority load of cookies for a specfic domain key |
116 TEST_F(SQLitePersistentCookieStorePerfTest, TestLoadForKeyPerformance) { | 116 TEST_F(SQLitePersistentCookieStorePerfTest, TestLoadForKeyPerformance) { |
117 for (int domain_num = 0; domain_num < 3; ++domain_num) { | 117 for (int domain_num = 0; domain_num < 3; ++domain_num) { |
(...skipping 14 matching lines...) Expand all Loading... |
132 // Test the performance of load | 132 // Test the performance of load |
133 TEST_F(SQLitePersistentCookieStorePerfTest, TestLoadPerformance) { | 133 TEST_F(SQLitePersistentCookieStorePerfTest, TestLoadPerformance) { |
134 base::PerfTimeLogger timer("Load all cookies"); | 134 base::PerfTimeLogger timer("Load all cookies"); |
135 Load(); | 135 Load(); |
136 timer.Done(); | 136 timer.Done(); |
137 | 137 |
138 ASSERT_EQ(15000U, cookies_.size()); | 138 ASSERT_EQ(15000U, cookies_.size()); |
139 } | 139 } |
140 | 140 |
141 } // namespace net | 141 } // namespace net |
OLD | NEW |