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

Unified Diff: trunk/src/chrome/browser/history/shortcuts_database_unittest.cc

Issue 163613012: Revert 251442 "Migrate old Shortcuts DB data to conform to new t..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 10 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: trunk/src/chrome/browser/history/shortcuts_database_unittest.cc
===================================================================
--- trunk/src/chrome/browser/history/shortcuts_database_unittest.cc (revision 251472)
+++ trunk/src/chrome/browser/history/shortcuts_database_unittest.cc (working copy)
@@ -257,11 +257,11 @@
EXPECT_EQ(0U, shortcuts.size());
}
-TEST(ShortcutsDatabaseMigrationTest, MigrateTableAddFillIntoEdit) {
- // Open the v0 test file and use it to create a test database in a temp dir.
+TEST(ShortcutsDatabaseMigrationTest, MigrateV1ToV2) {
+ // Open the v1 test file and use it to create a test database in a temp dir.
base::FilePath sql_path;
ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &sql_path));
- sql_path = sql_path.AppendASCII("History").AppendASCII("Shortcuts.v0.sql");
+ sql_path = sql_path.AppendASCII("History").AppendASCII("Shortcuts.v1.sql");
base::ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
base::FilePath db_path(temp_dir.path().AppendASCII("TestShortcuts.db"));
@@ -299,32 +299,4 @@
EXPECT_TRUE(statement.Succeeded());
}
-TEST(ShortcutsDatabaseMigrationTest, MigrateV0ToV1) {
- // Open the v1 test file and use it to create a test database in a temp dir.
- base::FilePath sql_path;
- ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &sql_path));
- sql_path = sql_path.AppendASCII("History").AppendASCII("Shortcuts.v1.sql");
- base::ScopedTempDir temp_dir;
- ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
- base::FilePath db_path(temp_dir.path().AppendASCII("TestShortcuts.db"));
- ASSERT_TRUE(sql::test::CreateDatabaseFromSQL(db_path, sql_path));
-
- // Create a ShortcutsDatabase from the test database, which will migrate the
- // test database to the current version.
- {
- scoped_refptr<ShortcutsDatabase> db(new ShortcutsDatabase(db_path));
- db->Init();
- }
-
- // Check that all the old type values got converted to new values.
- sql::Connection connection;
- ASSERT_TRUE(connection.Open(db_path));
- sql::Statement statement(connection.GetUniqueStatement(
- "SELECT count(1) FROM omni_box_shortcuts WHERE type in (9, 10, 11, 12)"));
- ASSERT_TRUE(statement.is_valid());
- while (statement.Step())
- EXPECT_EQ(0, statement.ColumnInt(0));
- EXPECT_TRUE(statement.Succeeded());
-}
-
} // namespace history
« no previous file with comments | « trunk/src/chrome/browser/history/shortcuts_database.cc ('k') | trunk/src/chrome/test/data/History/Shortcuts.v0.sql » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698