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

Unified Diff: components/webdata/common/web_database_migration_unittest.cc

Issue 2550293002: [sync] Add autofill sync metadata to the web db (Closed)
Patch Set: Return a metadata batch; use id instead of rowid Created 4 years 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
« no previous file with comments | « components/webdata/common/web_database.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/webdata/common/web_database_migration_unittest.cc
diff --git a/components/webdata/common/web_database_migration_unittest.cc b/components/webdata/common/web_database_migration_unittest.cc
index 280890a2cdc0370398d9417b142166767d2fc8db..82aa0c619fb9bbe1e8c7b2c2b0ce9d1da1a787e5 100644
--- a/components/webdata/common/web_database_migration_unittest.cc
+++ b/components/webdata/common/web_database_migration_unittest.cc
@@ -130,7 +130,7 @@ class WebDatabaseMigrationTest : public testing::Test {
DISALLOW_COPY_AND_ASSIGN(WebDatabaseMigrationTest);
};
-const int WebDatabaseMigrationTest::kCurrentTestedVersionNumber = 69;
+const int WebDatabaseMigrationTest::kCurrentTestedVersionNumber = 70;
void WebDatabaseMigrationTest::LoadDatabase(
const base::FilePath::StringType& file) {
@@ -1134,3 +1134,35 @@ TEST_F(WebDatabaseMigrationTest, MigrateVersion68ToCurrent) {
connection.DoesColumnExist("keywords", "last_visited"));
}
}
+
+// Tests addition of sync metadata and model type state tables.
+TEST_F(WebDatabaseMigrationTest, MigrateVersion69ToCurrent) {
+ ASSERT_NO_FATAL_FAILURE(LoadDatabase(FILE_PATH_LITERAL("version_69.sql")));
+
+ // Verify pre-conditions.
+ {
+ sql::Connection connection;
+ ASSERT_TRUE(connection.Open(GetDatabasePath()));
+ ASSERT_TRUE(sql::MetaTable::DoesTableExist(&connection));
+
+ sql::MetaTable meta_table;
+ ASSERT_TRUE(meta_table.Init(&connection, 69, 69));
+
+ EXPECT_FALSE(connection.DoesTableExist("autofill_sync_metadata"));
+ EXPECT_FALSE(connection.DoesTableExist("autofill_model_type_state"));
+ }
+
+ DoMigration();
+
+ // Verify post-conditions.
+ {
+ sql::Connection connection;
+ ASSERT_TRUE(connection.Open(GetDatabasePath()));
+ ASSERT_TRUE(sql::MetaTable::DoesTableExist(&connection));
+
+ EXPECT_EQ(kCurrentTestedVersionNumber, VersionFromConnection(&connection));
+
+ EXPECT_TRUE(connection.DoesTableExist("autofill_sync_metadata"));
+ EXPECT_TRUE(connection.DoesTableExist("autofill_model_type_state"));
+ }
+}
« no previous file with comments | « components/webdata/common/web_database.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698