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 <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 if (!base::ReadFileToString(temp_dir_.path().Append(kCookieFilename), | 189 if (!base::ReadFileToString(temp_dir_.path().Append(kCookieFilename), |
190 &contents)) | 190 &contents)) |
191 return std::string(); | 191 return std::string(); |
192 return contents; | 192 return contents; |
193 } | 193 } |
194 | 194 |
195 void SetUp() override { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); } | 195 void SetUp() override { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); } |
196 | 196 |
197 void TearDown() override { | 197 void TearDown() override { |
198 DestroyStore(); | 198 DestroyStore(); |
199 pool_owner_->pool()->Shutdown(); | |
200 } | 199 } |
201 | 200 |
202 protected: | 201 protected: |
203 scoped_ptr<base::SequencedWorkerPoolOwner> pool_owner_; | 202 scoped_ptr<base::SequencedWorkerPoolOwner> pool_owner_; |
204 base::WaitableEvent loaded_event_; | 203 base::WaitableEvent loaded_event_; |
205 base::WaitableEvent key_loaded_event_; | 204 base::WaitableEvent key_loaded_event_; |
206 base::WaitableEvent db_thread_event_; | 205 base::WaitableEvent db_thread_event_; |
207 CanonicalCookieVector cookies_; | 206 CanonicalCookieVector cookies_; |
208 base::ScopedTempDir temp_dir_; | 207 base::ScopedTempDir temp_dir_; |
209 scoped_refptr<SQLitePersistentCookieStore> store_; | 208 scoped_refptr<SQLitePersistentCookieStore> store_; |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
747 EXPECT_TRUE(was_called_with_no_cookies); | 746 EXPECT_TRUE(was_called_with_no_cookies); |
748 | 747 |
749 // Same with trying to load a specific cookie. | 748 // Same with trying to load a specific cookie. |
750 was_called_with_no_cookies = false; | 749 was_called_with_no_cookies = false; |
751 store_->LoadCookiesForKey("foo.bar", base::Bind(WasCalledWithNoCookies, | 750 store_->LoadCookiesForKey("foo.bar", base::Bind(WasCalledWithNoCookies, |
752 &was_called_with_no_cookies)); | 751 &was_called_with_no_cookies)); |
753 EXPECT_TRUE(was_called_with_no_cookies); | 752 EXPECT_TRUE(was_called_with_no_cookies); |
754 } | 753 } |
755 | 754 |
756 } // namespace net | 755 } // namespace net |
OLD | NEW |