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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
11 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
13 #include "base/test/thread_test_helper.h" | 13 #include "base/test/thread_test_helper.h" |
14 #include "chrome/browser/net/sqlite_server_bound_cert_store.h" | 14 #include "chrome/browser/net/sqlite_server_bound_cert_store.h" |
15 #include "chrome/common/chrome_constants.h" | 15 #include "chrome/common/chrome_constants.h" |
16 #include "content/public/test/test_browser_thread.h" | 16 #include "content/public/test/test_browser_thread.h" |
17 #include "net/base/test_data_directory.h" | 17 #include "net/base/test_data_directory.h" |
18 #include "net/test/cert_test_util.h" | 18 #include "net/test/cert_test_util.h" |
19 #include "sql/statement.h" | 19 #include "sql/statement.h" |
20 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
21 #include "webkit/quota/mock_special_storage_policy.h" | 21 #include "webkit/browser/quota/mock_special_storage_policy.h" |
22 | 22 |
23 using content::BrowserThread; | 23 using content::BrowserThread; |
24 | 24 |
25 class SQLiteServerBoundCertStoreTest : public testing::Test { | 25 class SQLiteServerBoundCertStoreTest : public testing::Test { |
26 public: | 26 public: |
27 SQLiteServerBoundCertStoreTest() | 27 SQLiteServerBoundCertStoreTest() |
28 : db_thread_(BrowserThread::DB), | 28 : db_thread_(BrowserThread::DB), |
29 io_thread_(BrowserThread::IO, &message_loop_) {} | 29 io_thread_(BrowserThread::IO, &message_loop_) {} |
30 | 30 |
31 void Load( | 31 void Load( |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 sql::Connection db; | 424 sql::Connection db; |
425 ASSERT_TRUE(db.Open(v3_db_path)); | 425 ASSERT_TRUE(db.Open(v3_db_path)); |
426 sql::Statement smt(db.GetUniqueStatement( | 426 sql::Statement smt(db.GetUniqueStatement( |
427 "SELECT value FROM meta WHERE key = \"version\"")); | 427 "SELECT value FROM meta WHERE key = \"version\"")); |
428 ASSERT_TRUE(smt.Step()); | 428 ASSERT_TRUE(smt.Step()); |
429 EXPECT_EQ(4, smt.ColumnInt(0)); | 429 EXPECT_EQ(4, smt.ColumnInt(0)); |
430 EXPECT_FALSE(smt.Step()); | 430 EXPECT_FALSE(smt.Step()); |
431 } | 431 } |
432 } | 432 } |
433 } | 433 } |
OLD | NEW |