| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "chrome/browser/history/url_database.h" | 8 #include "chrome/browser/history/url_database.h" |
| 9 #include "chrome/common/sqlite_compiled_statement.h" | 9 #include "chrome/common/sqlite_compiled_statement.h" |
| 10 #include "chrome/common/sqlite_utils.h" | 10 #include "chrome/common/sqlite_utils.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 class URLDatabaseTest : public testing::Test, | 32 class URLDatabaseTest : public testing::Test, |
| 33 public URLDatabase { | 33 public URLDatabase { |
| 34 public: | 34 public: |
| 35 URLDatabaseTest() : db_(NULL), statement_cache_(NULL) { | 35 URLDatabaseTest() : db_(NULL), statement_cache_(NULL) { |
| 36 } | 36 } |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 // Test setup. | 39 // Test setup. |
| 40 void SetUp() { | 40 void SetUp() { |
| 41 PathService::Get(base::DIR_TEMP, &db_file_); | 41 PathService::Get(base::DIR_TEMP, &db_file_); |
| 42 db_file_.push_back(file_util::kPathSeparator); | 42 db_file_.push_back(FilePath::kSeparators[0]); |
| 43 db_file_.append(L"URLTest.db"); | 43 db_file_.append(L"URLTest.db"); |
| 44 | 44 |
| 45 EXPECT_EQ(SQLITE_OK, sqlite3_open(WideToUTF8(db_file_).c_str(), &db_)); | 45 EXPECT_EQ(SQLITE_OK, sqlite3_open(WideToUTF8(db_file_).c_str(), &db_)); |
| 46 statement_cache_ = new SqliteStatementCache(db_); | 46 statement_cache_ = new SqliteStatementCache(db_); |
| 47 | 47 |
| 48 // Initialize the tables for this test. | 48 // Initialize the tables for this test. |
| 49 CreateURLTable(false); | 49 CreateURLTable(false); |
| 50 CreateMainURLIndex(); | 50 CreateMainURLIndex(); |
| 51 CreateSupplimentaryURLIndices(); | 51 CreateSupplimentaryURLIndices(); |
| 52 InitKeywordSearchTermsTable(); | 52 InitKeywordSearchTermsTable(); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 // Delete the url. | 175 // Delete the url. |
| 176 ASSERT_TRUE(DeleteURLRow(url_id)); | 176 ASSERT_TRUE(DeleteURLRow(url_id)); |
| 177 | 177 |
| 178 // Make sure the keyword visit was deleted. | 178 // Make sure the keyword visit was deleted. |
| 179 std::vector<KeywordSearchTermVisit> matches; | 179 std::vector<KeywordSearchTermVisit> matches; |
| 180 GetMostRecentKeywordSearchTerms(1, L"visit", 10, &matches); | 180 GetMostRecentKeywordSearchTerms(1, L"visit", 10, &matches); |
| 181 ASSERT_EQ(0, matches.size()); | 181 ASSERT_EQ(0, matches.size()); |
| 182 } | 182 } |
| 183 | 183 |
| 184 } // namespace history | 184 } // namespace history |
| OLD | NEW |