Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(715)

Unified Diff: chrome/browser/history/history_unittest.cc

Issue 235863023: Eliminate the archived history database and clean up related code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename a few outstanding instances of "archived" to "expired". Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/history/history_unittest.cc
diff --git a/chrome/browser/history/history_unittest.cc b/chrome/browser/history/history_unittest.cc
index d90e5354195a4986800f48d01551d96156e029f4..411c712dae9d5ca72f9b1580996f2ff44058ad03 100644
--- a/chrome/browser/history/history_unittest.cc
+++ b/chrome/browser/history/history_unittest.cc
@@ -140,6 +140,16 @@ class HistoryBackendDBTest : public HistoryUnitTestBase {
chrome::kHistoryFilename)));
}
+ void CreateArchivedDB() {
+ base::FilePath data_path;
+ ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &data_path));
+ data_path = data_path.AppendASCII("History");
+ data_path = data_path.AppendASCII("archived_history.4.sql");
+ ASSERT_NO_FATAL_FAILURE(
+ ExecuteSQLScript(data_path, history_dir_.Append(
+ chrome::kArchivedHistoryFilename)));
+ }
+
// testing::Test
virtual void SetUp() {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
@@ -619,6 +629,22 @@ TEST_F(HistoryBackendDBTest, MigrateDownloadValidators) {
}
}
+TEST_F(HistoryBackendDBTest, PurgeArchivedDatabase) {
+ ASSERT_NO_FATAL_FAILURE(CreateDBVersion(27));
+ ASSERT_NO_FATAL_FAILURE(CreateArchivedDB());
+
+ ASSERT_TRUE(base::PathExists(
+ history_dir_.Append(chrome::kArchivedHistoryFilename)));
+
+ CreateBackendAndDatabase();
+ DeleteBackend();
+
+ // We do not retain expired history entries in an archived database as of M37.
+ // Verify that any legacy archived database is deleted on start-up.
+ ASSERT_FALSE(base::PathExists(
+ history_dir_.Append(chrome::kArchivedHistoryFilename)));
+}
+
TEST_F(HistoryBackendDBTest, ConfirmDownloadRowCreateAndDelete) {
// Create the DB.
CreateBackendAndDatabase();

Powered by Google App Engine
This is Rietveld 408576698