| 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/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/memory/ref_counted.h" | 6 #include "base/memory/ref_counted.h" |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/scoped_temp_dir.h" | 8 #include "base/scoped_temp_dir.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/test/thread_test_helper.h" | 10 #include "base/test/thread_test_helper.h" |
| 11 #include "chrome/browser/net/sqlite_origin_bound_cert_store.h" | 11 #include "chrome/browser/net/sqlite_origin_bound_cert_store.h" |
| 12 #include "chrome/common/chrome_constants.h" | 12 #include "chrome/common/chrome_constants.h" |
| 13 #include "content/test/test_browser_thread.h" | 13 #include "content/test/test_browser_thread.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 | 15 |
| 16 using content::BrowserThread; |
| 17 |
| 16 class SQLiteOriginBoundCertStoreTest : public testing::Test { | 18 class SQLiteOriginBoundCertStoreTest : public testing::Test { |
| 17 public: | 19 public: |
| 18 SQLiteOriginBoundCertStoreTest() | 20 SQLiteOriginBoundCertStoreTest() |
| 19 : db_thread_(BrowserThread::DB) { | 21 : db_thread_(BrowserThread::DB) { |
| 20 } | 22 } |
| 21 | 23 |
| 22 protected: | 24 protected: |
| 23 virtual void SetUp() { | 25 virtual void SetUp() { |
| 24 db_thread_.Start(); | 26 db_thread_.Start(); |
| 25 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 27 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 | 168 |
| 167 store_->Flush(NewRunnableMethod(counter.get(), &CallbackCounter::Callback)); | 169 store_->Flush(NewRunnableMethod(counter.get(), &CallbackCounter::Callback)); |
| 168 | 170 |
| 169 scoped_refptr<base::ThreadTestHelper> helper( | 171 scoped_refptr<base::ThreadTestHelper> helper( |
| 170 new base::ThreadTestHelper( | 172 new base::ThreadTestHelper( |
| 171 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB))); | 173 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB))); |
| 172 ASSERT_TRUE(helper->Run()); | 174 ASSERT_TRUE(helper->Run()); |
| 173 | 175 |
| 174 ASSERT_EQ(1, counter->callback_count()); | 176 ASSERT_EQ(1, counter->callback_count()); |
| 175 } | 177 } |
| OLD | NEW |