OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/guid.h" | 9 #include "base/guid.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 168 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
169 } | 169 } |
170 | 170 |
171 // Load the database via the WebDatabase class and migrate the database to | 171 // Load the database via the WebDatabase class and migrate the database to |
172 // the current version. | 172 // the current version. |
173 void DoMigration() { | 173 void DoMigration() { |
174 // TODO(joi): This whole unit test file needs to stay in //chrome | 174 // TODO(joi): This whole unit test file needs to stay in //chrome |
175 // for now, as it needs to know about all the different table | 175 // for now, as it needs to know about all the different table |
176 // types. Once all webdata datatypes have been componentized, this | 176 // types. Once all webdata datatypes have been componentized, this |
177 // could move to components_unittests. | 177 // could move to components_unittests. |
178 AutofillTable autofill_table; | 178 AutofillTable autofill_table("en-US"); |
179 KeywordTable keyword_table; | 179 KeywordTable keyword_table; |
180 LoginsTable logins_table; | 180 LoginsTable logins_table; |
181 TokenServiceTable token_service_table; | 181 TokenServiceTable token_service_table; |
182 WebAppsTable web_apps_table; | 182 WebAppsTable web_apps_table; |
183 WebIntentsTable web_intents_table; | 183 WebIntentsTable web_intents_table; |
184 | 184 |
185 WebDatabase db; | 185 WebDatabase db; |
186 db.AddTable(&autofill_table); | 186 db.AddTable(&autofill_table); |
187 db.AddTable(&keyword_table); | 187 db.AddTable(&keyword_table); |
188 db.AddTable(&logins_table); | 188 db.AddTable(&logins_table); |
(...skipping 1794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1983 ASSERT_TRUE(sql::MetaTable::DoesTableExist(&connection)); | 1983 ASSERT_TRUE(sql::MetaTable::DoesTableExist(&connection)); |
1984 | 1984 |
1985 // Check version. | 1985 // Check version. |
1986 EXPECT_EQ(kCurrentTestedVersionNumber, VersionFromConnection(&connection)); | 1986 EXPECT_EQ(kCurrentTestedVersionNumber, VersionFromConnection(&connection)); |
1987 | 1987 |
1988 // A new column should have been created. | 1988 // A new column should have been created. |
1989 EXPECT_TRUE(connection.DoesColumnExist("keywords", | 1989 EXPECT_TRUE(connection.DoesColumnExist("keywords", |
1990 "search_terms_replacement_key")); | 1990 "search_terms_replacement_key")); |
1991 } | 1991 } |
1992 } | 1992 } |
OLD | NEW |