diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-02 05:01:42 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-02 05:01:42 +0000 |
commit | 765b445022c7f2a24bc862b45d48ece4ca9a77e1 (patch) | |
tree | 9f351b1203bbfd02fae7018a1f11e2f15b6eeacb /chrome/browser/history/visit_database_unittest.cc | |
parent | eb6f2c542d7405788d668a762282b66655836e1d (diff) | |
download | chromium_src-765b445022c7f2a24bc862b45d48ece4ca9a77e1.zip chromium_src-765b445022c7f2a24bc862b45d48ece4ca9a77e1.tar.gz chromium_src-765b445022c7f2a24bc862b45d48ece4ca9a77e1.tar.bz2 |
Convert history to use new sql wrappers. Enhance wrappers in several ways to
support the needs of history.
BUG=none
TEST=covered by unit tests
Review URL: http://codereview.chromium.org/246053
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27832 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/history/visit_database_unittest.cc')
-rw-r--r-- | chrome/browser/history/visit_database_unittest.cc | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/chrome/browser/history/visit_database_unittest.cc b/chrome/browser/history/visit_database_unittest.cc index 65197d1..aedb9e9 100644 --- a/chrome/browser/history/visit_database_unittest.cc +++ b/chrome/browser/history/visit_database_unittest.cc @@ -1,15 +1,14 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "app/sql/connection.h" #include "base/file_path.h" #include "base/file_util.h" #include "base/path_service.h" #include "base/string_util.h" #include "chrome/browser/history/url_database.h" #include "chrome/browser/history/visit_database.h" -#include "chrome/common/sqlite_compiled_statement.h" -#include "chrome/common/sqlite_utils.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" @@ -36,7 +35,7 @@ class VisitDatabaseTest : public PlatformTest, public URLDatabase, public VisitDatabase { public: - VisitDatabaseTest() : db_(NULL), statement_cache_(NULL) { + VisitDatabaseTest() { } private: @@ -48,8 +47,7 @@ class VisitDatabaseTest : public PlatformTest, db_file_ = temp_dir.AppendASCII("VisitTest.db"); file_util::Delete(db_file_, false); - EXPECT_EQ(SQLITE_OK, OpenSqliteDb(db_file_, &db_)); - statement_cache_ = new SqliteStatementCache(db_); + EXPECT_TRUE(db_.Open(db_file_)); // Initialize the tables for this test. CreateURLTable(false); @@ -58,23 +56,18 @@ class VisitDatabaseTest : public PlatformTest, InitVisitTable(); } void TearDown() { - delete statement_cache_; - sqlite3_close(db_); + db_.Close(); file_util::Delete(db_file_, false); PlatformTest::TearDown(); } // Provided for URL/VisitDatabase. - virtual sqlite3* GetDB() { + virtual sql::Connection& GetDB() { return db_; } - virtual SqliteStatementCache& GetStatementCache() { - return *statement_cache_; - } FilePath db_file_; - sqlite3* db_; - SqliteStatementCache* statement_cache_; + sql::Connection db_; }; TEST_F(VisitDatabaseTest, Add) { |