| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 ExecuteSQLScript(data_path, history_dir_.Append(kHistoryFilename))); | 109 ExecuteSQLScript(data_path, history_dir_.Append(kHistoryFilename))); |
| 110 } | 110 } |
| 111 | 111 |
| 112 void HistoryBackendDBBaseTest::DeleteBackend() { | 112 void HistoryBackendDBBaseTest::DeleteBackend() { |
| 113 if (backend_.get()) { | 113 if (backend_.get()) { |
| 114 backend_->Closing(); | 114 backend_->Closing(); |
| 115 backend_ = nullptr; | 115 backend_ = nullptr; |
| 116 } | 116 } |
| 117 } | 117 } |
| 118 | 118 |
| 119 bool HistoryBackendDBBaseTest::AddDownload(uint32 id, | 119 bool HistoryBackendDBBaseTest::AddDownload(uint32_t id, |
| 120 DownloadState state, | 120 DownloadState state, |
| 121 base::Time time) { | 121 base::Time time) { |
| 122 std::vector<GURL> url_chain; | 122 std::vector<GURL> url_chain; |
| 123 url_chain.push_back(GURL("foo-url")); | 123 url_chain.push_back(GURL("foo-url")); |
| 124 | 124 |
| 125 DownloadRow download(base::FilePath(FILE_PATH_LITERAL("current-path")), | 125 DownloadRow download(base::FilePath(FILE_PATH_LITERAL("current-path")), |
| 126 base::FilePath(FILE_PATH_LITERAL("target-path")), | 126 base::FilePath(FILE_PATH_LITERAL("target-path")), |
| 127 url_chain, | 127 url_chain, |
| 128 GURL("http://referrer.com/"), | 128 GURL("http://referrer.com/"), |
| 129 "application/vnd.oasis.opendocument.text", | 129 "application/vnd.oasis.opendocument.text", |
| 130 "application/octet-stream", | 130 "application/octet-stream", |
| 131 time, | 131 time, |
| 132 time, | 132 time, |
| 133 std::string(), | 133 std::string(), |
| 134 std::string(), | 134 std::string(), |
| 135 0, | 135 0, |
| 136 512, | 136 512, |
| 137 state, | 137 state, |
| 138 DownloadDangerType::NOT_DANGEROUS, | 138 DownloadDangerType::NOT_DANGEROUS, |
| 139 kTestDownloadInterruptReasonNone, | 139 kTestDownloadInterruptReasonNone, |
| 140 id, | 140 id, |
| 141 false, | 141 false, |
| 142 "by_ext_id", | 142 "by_ext_id", |
| 143 "by_ext_name"); | 143 "by_ext_name"); |
| 144 return db_->CreateDownload(download); | 144 return db_->CreateDownload(download); |
| 145 } | 145 } |
| 146 | 146 |
| 147 } // namespace history | 147 } // namespace history |
| OLD | NEW |