OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/history/core/test/history_backend_db_base_test.h" | 5 #include "components/history/core/test/history_backend_db_base_test.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 102 |
103 void HistoryBackendDBBaseTest::CreateDBVersion(int version) { | 103 void HistoryBackendDBBaseTest::CreateDBVersion(int version) { |
104 base::FilePath data_path; | 104 base::FilePath data_path; |
105 ASSERT_TRUE(GetTestDataHistoryDir(&data_path)); | 105 ASSERT_TRUE(GetTestDataHistoryDir(&data_path)); |
106 data_path = | 106 data_path = |
107 data_path.AppendASCII(base::StringPrintf("history.%d.sql", version)); | 107 data_path.AppendASCII(base::StringPrintf("history.%d.sql", version)); |
108 ASSERT_NO_FATAL_FAILURE( | 108 ASSERT_NO_FATAL_FAILURE( |
109 ExecuteSQLScript(data_path, history_dir_.Append(kHistoryFilename))); | 109 ExecuteSQLScript(data_path, history_dir_.Append(kHistoryFilename))); |
110 } | 110 } |
111 | 111 |
112 void HistoryBackendDBBaseTest::CreateArchivedDB() { | |
113 base::FilePath data_path; | |
114 ASSERT_TRUE(GetTestDataHistoryDir(&data_path)); | |
115 data_path = data_path.AppendASCII("archived_history.4.sql"); | |
116 ASSERT_NO_FATAL_FAILURE(ExecuteSQLScript( | |
117 data_path, history_dir_.Append(kArchivedHistoryFilename))); | |
118 } | |
119 | |
120 void HistoryBackendDBBaseTest::DeleteBackend() { | 112 void HistoryBackendDBBaseTest::DeleteBackend() { |
121 if (backend_.get()) { | 113 if (backend_.get()) { |
122 backend_->Closing(); | 114 backend_->Closing(); |
123 backend_ = nullptr; | 115 backend_ = nullptr; |
124 } | 116 } |
125 } | 117 } |
126 | 118 |
127 bool HistoryBackendDBBaseTest::AddDownload(uint32 id, | 119 bool HistoryBackendDBBaseTest::AddDownload(uint32 id, |
128 DownloadState state, | 120 DownloadState state, |
129 base::Time time) { | 121 base::Time time) { |
(...skipping 16 matching lines...) Expand all Loading... |
146 DownloadDangerType::NOT_DANGEROUS, | 138 DownloadDangerType::NOT_DANGEROUS, |
147 kTestDownloadInterruptReasonNone, | 139 kTestDownloadInterruptReasonNone, |
148 id, | 140 id, |
149 false, | 141 false, |
150 "by_ext_id", | 142 "by_ext_id", |
151 "by_ext_name"); | 143 "by_ext_name"); |
152 return db_->CreateDownload(download); | 144 return db_->CreateDownload(download); |
153 } | 145 } |
154 | 146 |
155 } // namespace history | 147 } // namespace history |
OLD | NEW |