OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 void SetUpVersion78Database(sql::Connection* connection); | 68 void SetUpVersion78Database(sql::Connection* connection); |
69 void SetUpVersion79Database(sql::Connection* connection); | 69 void SetUpVersion79Database(sql::Connection* connection); |
70 void SetUpVersion80Database(sql::Connection* connection); | 70 void SetUpVersion80Database(sql::Connection* connection); |
71 void SetUpVersion81Database(sql::Connection* connection); | 71 void SetUpVersion81Database(sql::Connection* connection); |
72 void SetUpVersion82Database(sql::Connection* connection); | 72 void SetUpVersion82Database(sql::Connection* connection); |
73 void SetUpVersion83Database(sql::Connection* connection); | 73 void SetUpVersion83Database(sql::Connection* connection); |
74 void SetUpVersion84Database(sql::Connection* connection); | 74 void SetUpVersion84Database(sql::Connection* connection); |
75 void SetUpVersion85Database(sql::Connection* connection); | 75 void SetUpVersion85Database(sql::Connection* connection); |
76 void SetUpVersion86Database(sql::Connection* connection); | 76 void SetUpVersion86Database(sql::Connection* connection); |
77 void SetUpVersion87Database(sql::Connection* connection); | 77 void SetUpVersion87Database(sql::Connection* connection); |
| 78 void SetUpVersion88Database(sql::Connection* connection); |
78 | 79 |
79 void SetUpCurrentDatabaseAndCheckVersion(sql::Connection* connection) { | 80 void SetUpCurrentDatabaseAndCheckVersion(sql::Connection* connection) { |
80 SetUpVersion87Database(connection); // Prepopulates data. | 81 SetUpVersion88Database(connection); // Prepopulates data. |
81 scoped_ptr<TestDirectoryBackingStore> dbs( | 82 scoped_ptr<TestDirectoryBackingStore> dbs( |
82 new TestDirectoryBackingStore(GetUsername(), connection)); | 83 new TestDirectoryBackingStore(GetUsername(), connection)); |
83 ASSERT_EQ(kCurrentDBVersion, dbs->GetVersion()); | 84 ASSERT_EQ(kCurrentDBVersion, dbs->GetVersion()); |
84 | 85 |
85 ASSERT_TRUE(LoadAndIgnoreReturnedData(dbs.get())); | 86 ASSERT_TRUE(LoadAndIgnoreReturnedData(dbs.get())); |
86 ASSERT_FALSE(dbs->needs_column_refresh_); | 87 ASSERT_FALSE(dbs->needs_column_refresh_); |
87 } | 88 } |
88 | 89 |
89 private: | 90 private: |
90 base::ScopedTempDir temp_dir_; | 91 base::ScopedTempDir temp_dir_; |
(...skipping 2552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2643 ",attachment_metadata blob);" | 2644 ",attachment_metadata blob);" |
2644 "CREATE TABLE 'share_info' (id TEXT primary key, name TEXT, store_birthda" | 2645 "CREATE TABLE 'share_info' (id TEXT primary key, name TEXT, store_birthda" |
2645 "y TEXT, db_create_version TEXT, db_create_time INT, next_id INT defau" | 2646 "y TEXT, db_create_version TEXT, db_create_time INT, next_id INT defau" |
2646 "lt -2, cache_guid TEXT, notification_state BLOB, bag_of_chips BLOB);" | 2647 "lt -2, cache_guid TEXT, notification_state BLOB, bag_of_chips BLOB);" |
2647 "INSERT INTO 'share_info' VALUES('nick@chromium.org','nick@chromium.org'," | 2648 "INSERT INTO 'share_info' VALUES('nick@chromium.org','nick@chromium.org'," |
2648 "'c27e9f59-08ca-46f8-b0cc-f16a2ed778bb','Unknown',1263522064,-131078,'" | 2649 "'c27e9f59-08ca-46f8-b0cc-f16a2ed778bb','Unknown',1263522064,-131078,'" |
2649 "9010788312004066376x-6609234393368420856x',NULL,NULL);")); | 2650 "9010788312004066376x-6609234393368420856x',NULL,NULL);")); |
2650 ASSERT_TRUE(connection->CommitTransaction()); | 2651 ASSERT_TRUE(connection->CommitTransaction()); |
2651 } | 2652 } |
2652 | 2653 |
| 2654 void MigrationTest::SetUpVersion88Database(sql::Connection* connection) { |
| 2655 ASSERT_TRUE(connection->is_open()); |
| 2656 ASSERT_TRUE(connection->BeginTransaction()); |
| 2657 ASSERT_TRUE(connection->Execute( |
| 2658 "CREATE TABLE share_version (id VARCHAR(128) primary key, data INT);" |
| 2659 "INSERT INTO 'share_version' VALUES('nick@chromium.org',88);" |
| 2660 "CREATE TABLE models (model_id BLOB primary key, progress_marker BLOB," |
| 2661 " transaction_version BIGINT default 0, context BLOB);" |
| 2662 "INSERT INTO 'models' VALUES(X'C2881000',X'0888810218B605',1,NULL);" |
| 2663 "CREATE TABLE 'metas'(metahandle bigint primary key ON CONFLICT FAIL,base" |
| 2664 "_version bigint default -1,server_version bigint default 0,local_exte" |
| 2665 "rnal_id bigint default 0,transaction_version bigint default 0,mtime b" |
| 2666 "igint default 0,server_mtime bigint default 0,ctime bigint default 0," |
| 2667 "server_ctime bigint default 0,id varchar(255) default 'r',parent_id v" |
| 2668 "archar(255) default 'r',server_parent_id varchar(255) default 'r',is_" |
| 2669 "unsynced bit default 0,is_unapplied_update bit default 0,is_del bit d" |
| 2670 "efault 0,is_dir bit default 0,server_is_dir bit default 0,server_is_d" |
| 2671 "el bit default 0,non_unique_name varchar,server_non_unique_name varch" |
| 2672 "ar(255),unique_server_tag varchar,unique_client_tag varchar,unique_bo" |
| 2673 "okmark_tag varchar,specifics blob,server_specifics blob,base_server_s" |
| 2674 "pecifics blob,server_unique_position blob,unique_position blob,attach" |
| 2675 "ment_metadata blob);" |
| 2676 "INSERT INTO 'metas' VALUES(1,-1,0,0,0," |
| 2677 META_PROTO_TIMES_VALS(1) |
| 2678 ",'r','r','r',0,0,0,1,0,0,NULL,NULL,NULL,NULL,X''" |
| 2679 ",X'',X'',NULL,X'2200',X'2200',NULL);" |
| 2680 "INSERT INTO 'metas' VALUES(6,694,694,6,0," |
| 2681 META_PROTO_TIMES_VALS(6) |
| 2682 ",'s_ID_6','s_ID_9','s_ID_9',0,0,0,1,1,0,'The " |
| 2683 "Internet','The Internet',NULL,NULL,X'6754307476346749735A5734654D6532" |
| 2684 "73625336557753582F77673D',X'C2881000',X'C2881000',NULL,X'22247FFFFFFF" |
| 2685 "FFC000006754307476346749735A5734654D653273625336557753582F77673D',X'2" |
| 2686 "2247FFFFFFFFFC000006754307476346749735A5734654D653273625336557753582F" |
| 2687 "77673D',NULL);" |
| 2688 "INSERT INTO 'metas' VALUES(7,663,663,0,0," |
| 2689 META_PROTO_TIMES_VALS(7) |
| 2690 ",'s_ID_7','r','r',0,0,0,1,1,0,'Google Chrome'" |
| 2691 ",'Google Chrome','google_chrome',NULL,X'',NULL,NULL,NULL,X'2200',X'22" |
| 2692 "00',NULL);" |
| 2693 "INSERT INTO 'metas' VALUES(8,664,664,0,0," |
| 2694 META_PROTO_TIMES_VALS(8) |
| 2695 ",'s_ID_8','s_ID_7','s_ID_7',0,0,0,1,1,0,'Book" |
| 2696 "marks','Bookmarks','google_chrome_bookmarks',NULL,X'',X'C2881000',X'C" |
| 2697 "2881000',NULL,X'2200',X'2200',NULL);" |
| 2698 "INSERT INTO 'metas' VALUES(9,665,665,1,0," |
| 2699 META_PROTO_TIMES_VALS(9) |
| 2700 ",'s_ID_9','s_ID_8','s_ID_8',0,0,0,1,1,0,'Book" |
| 2701 "mark Bar','Bookmark Bar','bookmark_bar',NULL,X'',X'C2881000',X'C28810" |
| 2702 "00',NULL,X'2200',X'2200',NULL);" |
| 2703 "INSERT INTO 'metas' VALUES(10,666,666,2,0," |
| 2704 META_PROTO_TIMES_VALS(10) |
| 2705 ",'s_ID_10','s_ID_8','s_ID_8',0,0,0,1,1,0,'Ot" |
| 2706 "her Bookmarks','Other Bookmarks','other_bookmarks',NULL,X'',X'C288100" |
| 2707 "0',X'C2881000',NULL,X'2200',X'2200',NULL);" |
| 2708 "INSERT INTO 'metas' VALUES(11,683,683,8,0," |
| 2709 META_PROTO_TIMES_VALS(11) |
| 2710 ",'s_ID_11','s_ID_6','s_ID_6',0,0,0,0,0,0,'Ho" |
| 2711 "me (The Chromium Projects)','Home (The Chromium Projects)',NULL,NULL," |
| 2712 "X'50514C784A456D623579366267644237646A7A2B62314130346E493D',X'C288102" |
| 2713 "20A18687474703A2F2F6465762E6368726F6D69756D2E6F72672F1206414741545741" |
| 2714 "',X'C28810290A1D687474703A2F2F6465762E6368726F6D69756D2E6F72672F6F746" |
| 2715 "8657212084146414756415346',NULL,X'22247FFFFFFFFFF0000050514C784A456D6" |
| 2716 "23579366267644237646A7A2B62314130346E493D',X'22247FFFFFFFFFF000005051" |
| 2717 "4C784A456D623579366267644237646A7A2B62314130346E493D',NULL);" |
| 2718 "INSERT INTO 'metas' VALUES(12,685,685,9,0," |
| 2719 META_PROTO_TIMES_VALS(12) |
| 2720 ",'s_ID_12','s_ID_6','s_ID_6',0,0,0,1,1,0,'Ex" |
| 2721 "tra Bookmarks','Extra Bookmarks',NULL,NULL,X'7867626A704A646134635A6F" |
| 2722 "616C376A49513338734B46324837773D',X'C2881000',X'C2881000',NULL,X'2224" |
| 2723 "80000000000000007867626A704A646134635A6F616C376A49513338734B463248377" |
| 2724 "73D',X'222480000000000000007867626A704A646134635A6F616C376A4951333873" |
| 2725 "4B46324837773D',NULL);" |
| 2726 "INSERT INTO 'metas' VALUES(13,687,687,10,0," |
| 2727 META_PROTO_TIMES_VALS(13) |
| 2728 ",'s_ID_13','s_ID_6','s_ID_6',0,0,0,0,0,0,'I" |
| 2729 "CANN | Internet Corporation for Assigned Names and Numbers','ICANN | " |
| 2730 "Internet Corporation for Assigned Names and Numbers',NULL,NULL,X'3142" |
| 2731 "756B572F7741766956504179672B304A614A514B3452384A413D',X'C28810240A156" |
| 2732 "87474703A2F2F7777772E6963616E6E2E636F6D2F120B504E474158463041414646'," |
| 2733 "X'C28810200A15687474703A2F2F7777772E6963616E6E2E636F6D2F1207444141464" |
| 2734 "15346',NULL,X'22247FFFFFFFFFF200003142756B572F7741766956504179672B304" |
| 2735 "A614A514B3452384A413D',X'22247FFFFFFFFFF200003142756B572F774176695650" |
| 2736 "4179672B304A614A514B3452384A413D',NULL);" |
| 2737 "INSERT INTO 'metas' VALUES(14,692,692,11,0," |
| 2738 META_PROTO_TIMES_VALS(14) |
| 2739 ",'s_ID_14','s_ID_6','s_ID_6',0,0,0,0,0,0,'T" |
| 2740 "he WebKit Open Source Project','The WebKit Open Source Project',NULL," |
| 2741 "NULL,X'5A5678314E7976364579524D3177494F7236563159552F6E644C553D',X'C2" |
| 2742 "88101A0A12687474703A2F2F7765626B69742E6F72672F1204504E4758',X'C288101" |
| 2743 "C0A13687474703A2F2F7765626B69742E6F72672F781205504E473259',NULL,X'222" |
| 2744 "480000000001000005A5678314E7976364579524D3177494F7236563159552F6E644C" |
| 2745 "553D',X'222480000000001000005A5678314E7976364579524D3177494F723656315" |
| 2746 "9552F6E644C553D',NULL);" |
| 2747 "CREATE TABLE deleted_metas (metahandle bigint primary key ON CONFLICT FA" |
| 2748 "IL,base_version bigint default -1,server_version bigint default 0,loc" |
| 2749 "al_external_id bigint default 0,transaction_version bigint default 0," |
| 2750 "mtime bigint default 0,server_mtime bigint default 0,ctime bigint def" |
| 2751 "ault 0,server_ctime bigint default 0,id varchar(255) default 'r',pare" |
| 2752 "nt_id varchar(255) default 'r',server_parent_id varchar(255) default " |
| 2753 "'r',is_unsynced bit default 0,is_unapplied_update bit default 0,is_de" |
| 2754 "l bit default 0,is_dir bit default 0,server_is_dir bit default 0,serv" |
| 2755 "er_is_del bit default 0,non_unique_name varchar,server_non_unique_nam" |
| 2756 "e varchar(255),unique_server_tag varchar,unique_client_tag varchar,un" |
| 2757 "ique_bookmark_tag varchar,specifics blob,server_specifics blob,base_s" |
| 2758 "erver_specifics blob,server_unique_position blob,unique_position blob" |
| 2759 ",attachment_metadata blob);" |
| 2760 "CREATE TABLE 'share_info' (id TEXT primary key, name TEXT, store_birthda" |
| 2761 "y TEXT, db_create_version TEXT, db_create_time INT, next_id INT defau" |
| 2762 "lt -2, cache_guid TEXT, notification_state BLOB, bag_of_chips BLOB);" |
| 2763 "INSERT INTO 'share_info' VALUES('nick@chromium.org','nick@chromium.org'," |
| 2764 "'c27e9f59-08ca-46f8-b0cc-f16a2ed778bb','Unknown',1263522064,-131078,'" |
| 2765 "9010788312004066376x-6609234393368420856x',NULL,NULL);")); |
| 2766 ASSERT_TRUE(connection->CommitTransaction()); |
| 2767 } |
| 2768 |
2653 TEST_F(DirectoryBackingStoreTest, MigrateVersion67To68) { | 2769 TEST_F(DirectoryBackingStoreTest, MigrateVersion67To68) { |
2654 sql::Connection connection; | 2770 sql::Connection connection; |
2655 ASSERT_TRUE(connection.OpenInMemory()); | 2771 ASSERT_TRUE(connection.OpenInMemory()); |
2656 | 2772 |
2657 SetUpVersion67Database(&connection); | 2773 SetUpVersion67Database(&connection); |
2658 | 2774 |
2659 // Columns existing before version 67. | 2775 // Columns existing before version 67. |
2660 ASSERT_TRUE(connection.DoesColumnExist("metas", "name")); | 2776 ASSERT_TRUE(connection.DoesColumnExist("metas", "name")); |
2661 ASSERT_TRUE(connection.DoesColumnExist("metas", "unsanitized_name")); | 2777 ASSERT_TRUE(connection.DoesColumnExist("metas", "unsanitized_name")); |
2662 ASSERT_TRUE(connection.DoesColumnExist("metas", "server_name")); | 2778 ASSERT_TRUE(connection.DoesColumnExist("metas", "server_name")); |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3121 EXPECT_FALSE(connection.DoesColumnExist("metas", "attachment_metadata")); | 3237 EXPECT_FALSE(connection.DoesColumnExist("metas", "attachment_metadata")); |
3122 | 3238 |
3123 scoped_ptr<TestDirectoryBackingStore> dbs( | 3239 scoped_ptr<TestDirectoryBackingStore> dbs( |
3124 new TestDirectoryBackingStore(GetUsername(), &connection)); | 3240 new TestDirectoryBackingStore(GetUsername(), &connection)); |
3125 EXPECT_TRUE(dbs->MigrateVersion86To87()); | 3241 EXPECT_TRUE(dbs->MigrateVersion86To87()); |
3126 EXPECT_EQ(87, dbs->GetVersion()); | 3242 EXPECT_EQ(87, dbs->GetVersion()); |
3127 EXPECT_TRUE(connection.DoesColumnExist("metas", "attachment_metadata")); | 3243 EXPECT_TRUE(connection.DoesColumnExist("metas", "attachment_metadata")); |
3128 EXPECT_TRUE(dbs->needs_column_refresh_); | 3244 EXPECT_TRUE(dbs->needs_column_refresh_); |
3129 } | 3245 } |
3130 | 3246 |
| 3247 TEST_F(DirectoryBackingStoreTest, MigrateVersion87To88) { |
| 3248 sql::Connection connection; |
| 3249 ASSERT_TRUE(connection.OpenInMemory()); |
| 3250 SetUpVersion87Database(&connection); |
| 3251 |
| 3252 scoped_ptr<TestDirectoryBackingStore> dbs( |
| 3253 new TestDirectoryBackingStore(GetUsername(), &connection)); |
| 3254 ASSERT_TRUE(dbs->MigrateVersion87To88()); |
| 3255 ASSERT_EQ(88, dbs->GetVersion()); |
| 3256 ASSERT_TRUE(connection.DoesColumnExist("models", "context")); |
| 3257 } |
| 3258 |
3131 // The purpose of this test case is to make it easier to get a dump of the | 3259 // The purpose of this test case is to make it easier to get a dump of the |
3132 // database so you can implement a SetUpVersionYDatabase method. Here's what | 3260 // database so you can implement a SetUpVersionYDatabase method. Here's what |
3133 // you should do: | 3261 // you should do: |
3134 // | 3262 // |
3135 // 1. Say you're going from version X to version Y. Write the migration | 3263 // 1. Say you're going from version X to version Y. Write the migration |
3136 // method MigrateVersionXToY. | 3264 // method MigrateVersionXToY. |
3137 // 2. Update the test below to call SetUpVersionXDatabase and then | 3265 // 2. Update the test below to call SetUpVersionXDatabase and then |
3138 // MigrateVersionXToY. You now have a database at version Y. Let's dump it. | 3266 // MigrateVersionXToY. You now have a database at version Y. Let's dump it. |
3139 // 3. Set a breakpoint to stop execution just after the connection is | 3267 // 3. Set a breakpoint to stop execution just after the connection is |
3140 // destroyed. Examine temp_dir_ to find the version Y database that was | 3268 // destroyed. Examine temp_dir_ to find the version Y database that was |
3141 // created on disk. E.g. (gdb) p temp_dir_.path().value().c_str() | 3269 // created on disk. E.g. (gdb) p temp_dir_.path().value().c_str() |
3142 // 4. Dump the database using the sqlite3 command line tool: | 3270 // 4. Dump the database using the sqlite3 command line tool: |
3143 // > .output foo_dump.sql | 3271 // > .output foo_dump.sql |
3144 // > .dump | 3272 // > .dump |
3145 // 5. Replace the timestamp columns with META_PROTO_TIMES(x) (or | 3273 // 5. Replace the timestamp columns with META_PROTO_TIMES(x) (or |
3146 // LEGACY_META_PROTO_TIMES(x) if before Version 77). Use this dump to write | 3274 // LEGACY_META_PROTO_TIMES(x) if before Version 77). Use this dump to write |
3147 // a SetupVersionYDatabase method. | 3275 // a SetupVersionYDatabase method. |
3148 TEST_F(DirectoryBackingStoreTest, MigrateToLatestAndDump) { | 3276 TEST_F(DirectoryBackingStoreTest, MigrateToLatestAndDump) { |
3149 { | 3277 { |
3150 sql::Connection connection; | 3278 sql::Connection connection; |
3151 ASSERT_TRUE(connection.Open(GetDatabasePath())); | 3279 ASSERT_TRUE(connection.Open(GetDatabasePath())); |
3152 SetUpVersion86Database(&connection); // Update this. | 3280 SetUpVersion87Database(&connection); // Update this. |
3153 | 3281 |
3154 scoped_ptr<TestDirectoryBackingStore> dbs( | 3282 scoped_ptr<TestDirectoryBackingStore> dbs( |
3155 new TestDirectoryBackingStore(GetUsername(), &connection)); | 3283 new TestDirectoryBackingStore(GetUsername(), &connection)); |
3156 ASSERT_TRUE(dbs->MigrateVersion86To87()); // Update this. | 3284 ASSERT_TRUE(dbs->MigrateVersion87To88()); // Update this. |
3157 ASSERT_TRUE(LoadAndIgnoreReturnedData(dbs.get())); | 3285 ASSERT_TRUE(LoadAndIgnoreReturnedData(dbs.get())); |
3158 EXPECT_EQ(87, dbs->GetVersion()); // Update this. | 3286 EXPECT_EQ(88, dbs->GetVersion()); // Update this. |
3159 ASSERT_FALSE(dbs->needs_column_refresh_); | 3287 ASSERT_FALSE(dbs->needs_column_refresh_); |
3160 } | 3288 } |
3161 // Set breakpoint here. | 3289 // Set breakpoint here. |
3162 } | 3290 } |
3163 | 3291 |
3164 TEST_F(DirectoryBackingStoreTest, DetectInvalidPosition) { | 3292 TEST_F(DirectoryBackingStoreTest, DetectInvalidPosition) { |
3165 sql::Connection connection; | 3293 sql::Connection connection; |
3166 ASSERT_TRUE(connection.OpenInMemory()); | 3294 ASSERT_TRUE(connection.OpenInMemory()); |
3167 SetUpVersion86Database(&connection); | 3295 SetUpVersion86Database(&connection); |
3168 | 3296 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3247 break; | 3375 break; |
3248 case 85: | 3376 case 85: |
3249 SetUpVersion85Database(&connection); | 3377 SetUpVersion85Database(&connection); |
3250 break; | 3378 break; |
3251 case 86: | 3379 case 86: |
3252 SetUpVersion86Database(&connection); | 3380 SetUpVersion86Database(&connection); |
3253 break; | 3381 break; |
3254 case 87: | 3382 case 87: |
3255 SetUpVersion87Database(&connection); | 3383 SetUpVersion87Database(&connection); |
3256 break; | 3384 break; |
| 3385 case 88: |
| 3386 SetUpVersion88Database(&connection); |
| 3387 break; |
3257 default: | 3388 default: |
3258 // If you see this error, it may mean that you've increased the | 3389 // If you see this error, it may mean that you've increased the |
3259 // database version number but you haven't finished adding unit tests | 3390 // database version number but you haven't finished adding unit tests |
3260 // for the database migration code. You need to need to supply a | 3391 // for the database migration code. You need to need to supply a |
3261 // SetUpVersionYDatabase function with a dump of the test database | 3392 // SetUpVersionYDatabase function with a dump of the test database |
3262 // at the new schema. See the MigrateToLatestAndDump test case. | 3393 // at the new schema. See the MigrateToLatestAndDump test case. |
3263 FAIL() << "Need to supply database dump for version " << GetParam(); | 3394 FAIL() << "Need to supply database dump for version " << GetParam(); |
3264 } | 3395 } |
3265 | 3396 |
3266 syncable::Directory::KernelLoadInfo dir_info; | 3397 syncable::Directory::KernelLoadInfo dir_info; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3336 ASSERT_FALSE(connection.DoesColumnExist("models", "initial_sync_ended")); | 3467 ASSERT_FALSE(connection.DoesColumnExist("models", "initial_sync_ended")); |
3337 | 3468 |
3338 // Columns removed in version 86. | 3469 // Columns removed in version 86. |
3339 ASSERT_FALSE(connection.DoesColumnExist("metas", "next_id")); | 3470 ASSERT_FALSE(connection.DoesColumnExist("metas", "next_id")); |
3340 ASSERT_FALSE(connection.DoesColumnExist("metas", "prev_id")); | 3471 ASSERT_FALSE(connection.DoesColumnExist("metas", "prev_id")); |
3341 ASSERT_FALSE(connection.DoesColumnExist("metas", "server_ordinal_in_parent")); | 3472 ASSERT_FALSE(connection.DoesColumnExist("metas", "server_ordinal_in_parent")); |
3342 | 3473 |
3343 // Column added in version 87. | 3474 // Column added in version 87. |
3344 ASSERT_TRUE(connection.DoesColumnExist("metas", "attachment_metadata")); | 3475 ASSERT_TRUE(connection.DoesColumnExist("metas", "attachment_metadata")); |
3345 | 3476 |
| 3477 // Column added in version 88. |
| 3478 ASSERT_TRUE(connection.DoesColumnExist("models", "context")); |
| 3479 |
3346 // Check download_progress state (v75 migration) | 3480 // Check download_progress state (v75 migration) |
3347 ASSERT_EQ(694, | 3481 ASSERT_EQ(694, |
3348 dir_info.kernel_info.download_progress[BOOKMARKS] | 3482 dir_info.kernel_info.download_progress[BOOKMARKS] |
3349 .timestamp_token_for_migration()); | 3483 .timestamp_token_for_migration()); |
3350 ASSERT_FALSE( | 3484 ASSERT_FALSE( |
3351 dir_info.kernel_info.download_progress[BOOKMARKS] | 3485 dir_info.kernel_info.download_progress[BOOKMARKS] |
3352 .has_token()); | 3486 .has_token()); |
3353 ASSERT_EQ(32904, | 3487 ASSERT_EQ(32904, |
3354 dir_info.kernel_info.download_progress[BOOKMARKS] | 3488 dir_info.kernel_info.download_progress[BOOKMARKS] |
3355 .data_type_id()); | 3489 .data_type_id()); |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3667 const std::string& guid2 = TestDirectoryBackingStore::GenerateCacheGUID(); | 3801 const std::string& guid2 = TestDirectoryBackingStore::GenerateCacheGUID(); |
3668 EXPECT_EQ(24U, guid1.size()); | 3802 EXPECT_EQ(24U, guid1.size()); |
3669 EXPECT_EQ(24U, guid2.size()); | 3803 EXPECT_EQ(24U, guid2.size()); |
3670 // In theory this test can fail, but it won't before the universe | 3804 // In theory this test can fail, but it won't before the universe |
3671 // dies of heat death. | 3805 // dies of heat death. |
3672 EXPECT_NE(guid1, guid2); | 3806 EXPECT_NE(guid1, guid2); |
3673 } | 3807 } |
3674 | 3808 |
3675 } // namespace syncable | 3809 } // namespace syncable |
3676 } // namespace syncer | 3810 } // namespace syncer |
OLD | NEW |