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

Unified Diff: sync/syncable/directory_backing_store_unittest.cc

Issue 10989063: Changed DB to store node positions as Ordinals. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 3 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
« no previous file with comments | « sync/syncable/directory_backing_store.cc ('k') | sync/syncable/syncable_columns.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/syncable/directory_backing_store_unittest.cc
diff --git a/sync/syncable/directory_backing_store_unittest.cc b/sync/syncable/directory_backing_store_unittest.cc
index 1864ba9d9c6ab33734096ca027a61805c22d213c..571cf4ef4112d4463e29987819a5cdd6d419ffba 100644
--- a/sync/syncable/directory_backing_store_unittest.cc
+++ b/sync/syncable/directory_backing_store_unittest.cc
@@ -2079,6 +2079,32 @@ TEST_F(DirectoryBackingStoreTest, MigrateVersion79To80) {
EXPECT_EQ(serialized_chip_bag, load_info.kernel_info.bag_of_chips);
}
+TEST_F(DirectoryBackingStoreTest, MigrateVersion80To81) {
+ sql::Connection connection;
+ ASSERT_TRUE(connection.OpenInMemory());
+
+ // Unfortunately there isn't a SetUpVersion80Database to use
rlarocque 2012/09/27 23:10:12 You should fix this. I believe it was Nicolas who
+ // and I (vishwath) don't know enough about the bag_of_chips
+ // to write it myself (yet). So assuming the previous test
+ // passed, create at ver 79 and migrate up to 81 instead.
+ SetupVersion79Database(&connection);
+
+ sql::Statement s(connection.GetUniqueStatement(
+ "SELECT id FROM metas WHERE unique_server_tag = 'google_chrome'"));
+ ASSERT_TRUE(s.Step());
+ ASSERT_EQ(s.ColumnType(3), COLUMN_TYPE_INTEGER);
+
+ scoped_ptr<TestDirectoryBackingStore> dbs(
+ new TestDirectoryBackingStore(GetUsername(), &connection));
+ ASSERT_TRUE(dbs->MigrateVersion79To80());
+ ASSERT_TRUE(dbs->MigrateVersion80To81());
+
+ sql::Statement s(connection.GetUniqueStatement(
+ "SELECT id FROM metas WHERE unique_server_tag = 'google_chrome'"));
+ ASSERT_TRUE(s.Step());
+ ASSERT_EQ(s.ColumnType(3), COLUMN_TYPE_TEXT);
rlarocque 2012/09/27 23:10:12 Shouldn't you check the values stored in the colum
+}
+
TEST_P(MigrationTest, ToCurrentVersion) {
sql::Connection connection;
ASSERT_TRUE(connection.OpenInMemory());
« no previous file with comments | « sync/syncable/directory_backing_store.cc ('k') | sync/syncable/syncable_columns.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698