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/guid.h" | 9 #include "base/guid.h" |
9 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
10 #include "base/scoped_temp_dir.h" | |
11 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
12 #include "base/string16.h" | 12 #include "base/string16.h" |
13 #include "base/string_number_conversions.h" | 13 #include "base/string_number_conversions.h" |
14 #include "base/time.h" | 14 #include "base/time.h" |
15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
16 #include "base/values.h" | 16 #include "base/values.h" |
17 #include "chrome/browser/autofill/autofill_profile.h" | 17 #include "chrome/browser/autofill/autofill_profile.h" |
18 #include "chrome/browser/autofill/autofill_type.h" | 18 #include "chrome/browser/autofill/autofill_type.h" |
19 #include "chrome/browser/autofill/credit_card.h" | 19 #include "chrome/browser/autofill/credit_card.h" |
20 #include "chrome/browser/webdata/autofill_change.h" | 20 #include "chrome/browser/webdata/autofill_change.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 // sqlite3 command-line application to dump the contents of the "Web Data" | 183 // sqlite3 command-line application to dump the contents of the "Web Data" |
184 // database. | 184 // database. |
185 // Like this: | 185 // Like this: |
186 // > .output version_nn.sql | 186 // > .output version_nn.sql |
187 // > .dump | 187 // > .dump |
188 void LoadDatabase(const FilePath::StringType& file); | 188 void LoadDatabase(const FilePath::StringType& file); |
189 | 189 |
190 private: | 190 private: |
191 MessageLoopForUI message_loop_for_ui_; | 191 MessageLoopForUI message_loop_for_ui_; |
192 content::TestBrowserThread ui_thread_; | 192 content::TestBrowserThread ui_thread_; |
193 ScopedTempDir temp_dir_; | 193 base::ScopedTempDir temp_dir_; |
194 | 194 |
195 DISALLOW_COPY_AND_ASSIGN(WebDatabaseMigrationTest); | 195 DISALLOW_COPY_AND_ASSIGN(WebDatabaseMigrationTest); |
196 }; | 196 }; |
197 | 197 |
198 const int WebDatabaseMigrationTest::kCurrentTestedVersionNumber = 47; | 198 const int WebDatabaseMigrationTest::kCurrentTestedVersionNumber = 47; |
199 | 199 |
200 void WebDatabaseMigrationTest::LoadDatabase(const FilePath::StringType& file) { | 200 void WebDatabaseMigrationTest::LoadDatabase(const FilePath::StringType& file) { |
201 std::string contents; | 201 std::string contents; |
202 ASSERT_TRUE(GetWebDatabaseData(FilePath(file), &contents)); | 202 ASSERT_TRUE(GetWebDatabaseData(FilePath(file), &contents)); |
203 | 203 |
(...skipping 2101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2305 // Check version. | 2305 // Check version. |
2306 EXPECT_EQ(kCurrentTestedVersionNumber, VersionFromConnection(&connection)); | 2306 EXPECT_EQ(kCurrentTestedVersionNumber, VersionFromConnection(&connection)); |
2307 | 2307 |
2308 // A new column should have been created. | 2308 // A new column should have been created. |
2309 EXPECT_TRUE(connection.DoesColumnExist("keywords", "alternate_urls")); | 2309 EXPECT_TRUE(connection.DoesColumnExist("keywords", "alternate_urls")); |
2310 | 2310 |
2311 // The backup table should be gone. | 2311 // The backup table should be gone. |
2312 EXPECT_FALSE(connection.DoesTableExist("keywords_backup")); | 2312 EXPECT_FALSE(connection.DoesTableExist("keywords_backup")); |
2313 } | 2313 } |
2314 } | 2314 } |
OLD | NEW |