| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/scoped_temp_dir.h" | 9 #include "base/scoped_temp_dir.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| 11 #include "base/synchronization/waitable_event.h" | 11 #include "base/synchronization/waitable_event.h" |
| 12 #include "base/test/thread_test_helper.h" | 12 #include "base/test/thread_test_helper.h" |
| 13 #include "base/time.h" | 13 #include "base/time.h" |
| 14 #include "chrome/browser/net/sqlite_persistent_cookie_store.h" | 14 #include "chrome/browser/net/sqlite_persistent_cookie_store.h" |
| 15 #include "chrome/common/chrome_constants.h" | 15 #include "chrome/common/chrome_constants.h" |
| 16 #include "content/test/test_browser_thread.h" | 16 #include "content/test/test_browser_thread.h" |
| 17 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 19 | 19 |
| 20 using content::BrowserThread; |
| 21 |
| 20 class SQLitePersistentCookieStoreTest : public testing::Test { | 22 class SQLitePersistentCookieStoreTest : public testing::Test { |
| 21 public: | 23 public: |
| 22 SQLitePersistentCookieStoreTest() | 24 SQLitePersistentCookieStoreTest() |
| 23 : ui_thread_(BrowserThread::UI), | 25 : ui_thread_(BrowserThread::UI), |
| 24 db_thread_(BrowserThread::DB), | 26 db_thread_(BrowserThread::DB), |
| 25 io_thread_(BrowserThread::IO), | 27 io_thread_(BrowserThread::IO), |
| 26 loaded_event_(false, false), | 28 loaded_event_(false, false), |
| 27 key_loaded_event_(false, false), | 29 key_loaded_event_(false, false), |
| 28 db_thread_event_(false, false) { | 30 db_thread_event_(false, false) { |
| 29 } | 31 } |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 | 293 |
| 292 store_->Flush(NewRunnableMethod(counter.get(), &CallbackCounter::Callback)); | 294 store_->Flush(NewRunnableMethod(counter.get(), &CallbackCounter::Callback)); |
| 293 | 295 |
| 294 scoped_refptr<base::ThreadTestHelper> helper( | 296 scoped_refptr<base::ThreadTestHelper> helper( |
| 295 new base::ThreadTestHelper( | 297 new base::ThreadTestHelper( |
| 296 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB))); | 298 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB))); |
| 297 ASSERT_TRUE(helper->Run()); | 299 ASSERT_TRUE(helper->Run()); |
| 298 | 300 |
| 299 ASSERT_EQ(1, counter->callback_count()); | 301 ASSERT_EQ(1, counter->callback_count()); |
| 300 } | 302 } |
| OLD | NEW |