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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 | 183 |
184 WebDatabase db; | 184 WebDatabase db; |
185 db.AddTable(&autofill_table); | 185 db.AddTable(&autofill_table); |
186 db.AddTable(&keyword_table); | 186 db.AddTable(&keyword_table); |
187 db.AddTable(&logins_table); | 187 db.AddTable(&logins_table); |
188 db.AddTable(&token_service_table); | 188 db.AddTable(&token_service_table); |
189 db.AddTable(&web_apps_table); | 189 db.AddTable(&web_apps_table); |
190 db.AddTable(&web_intents_table); | 190 db.AddTable(&web_intents_table); |
191 | 191 |
192 // This causes the migration to occur. | 192 // This causes the migration to occur. |
193 ASSERT_EQ(sql::INIT_OK, db.Init(GetDatabasePath(), std::string())); | 193 ASSERT_EQ(sql::INIT_OK, db.Init(GetDatabasePath())); |
194 } | 194 } |
195 | 195 |
196 protected: | 196 protected: |
197 // Current tested version number. When adding a migration in | 197 // Current tested version number. When adding a migration in |
198 // |WebDatabase::MigrateOldVersionsAsNeeded()| and changing the version number | 198 // |WebDatabase::MigrateOldVersionsAsNeeded()| and changing the version number |
199 // |kCurrentVersionNumber| this value should change to reflect the new version | 199 // |kCurrentVersionNumber| this value should change to reflect the new version |
200 // number and a new migration test added below. | 200 // number and a new migration test added below. |
201 static const int kCurrentTestedVersionNumber; | 201 static const int kCurrentTestedVersionNumber; |
202 | 202 |
203 base::FilePath GetDatabasePath() { | 203 base::FilePath GetDatabasePath() { |
(...skipping 1778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1982 ASSERT_TRUE(sql::MetaTable::DoesTableExist(&connection)); | 1982 ASSERT_TRUE(sql::MetaTable::DoesTableExist(&connection)); |
1983 | 1983 |
1984 // Check version. | 1984 // Check version. |
1985 EXPECT_EQ(kCurrentTestedVersionNumber, VersionFromConnection(&connection)); | 1985 EXPECT_EQ(kCurrentTestedVersionNumber, VersionFromConnection(&connection)); |
1986 | 1986 |
1987 // A new column should have been created. | 1987 // A new column should have been created. |
1988 EXPECT_TRUE(connection.DoesColumnExist("keywords", | 1988 EXPECT_TRUE(connection.DoesColumnExist("keywords", |
1989 "search_terms_replacement_key")); | 1989 "search_terms_replacement_key")); |
1990 } | 1990 } |
1991 } | 1991 } |
OLD | NEW |