| 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/files/file_util.h" | 7 #include "base/files/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/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 // > .output version_nn.sql | 241 // > .output version_nn.sql |
| 242 // > .dump | 242 // > .dump |
| 243 void LoadDatabase(const base::FilePath::StringType& file); | 243 void LoadDatabase(const base::FilePath::StringType& file); |
| 244 | 244 |
| 245 private: | 245 private: |
| 246 base::ScopedTempDir temp_dir_; | 246 base::ScopedTempDir temp_dir_; |
| 247 | 247 |
| 248 DISALLOW_COPY_AND_ASSIGN(WebDatabaseMigrationTest); | 248 DISALLOW_COPY_AND_ASSIGN(WebDatabaseMigrationTest); |
| 249 }; | 249 }; |
| 250 | 250 |
| 251 const int WebDatabaseMigrationTest::kCurrentTestedVersionNumber = 61; | 251 const int WebDatabaseMigrationTest::kCurrentTestedVersionNumber = 62; |
| 252 | 252 |
| 253 void WebDatabaseMigrationTest::LoadDatabase( | 253 void WebDatabaseMigrationTest::LoadDatabase( |
| 254 const base::FilePath::StringType& file) { | 254 const base::FilePath::StringType& file) { |
| 255 std::string contents; | 255 std::string contents; |
| 256 ASSERT_TRUE(GetWebDatabaseData(base::FilePath(file), &contents)); | 256 ASSERT_TRUE(GetWebDatabaseData(base::FilePath(file), &contents)); |
| 257 | 257 |
| 258 sql::Connection connection; | 258 sql::Connection connection; |
| 259 ASSERT_TRUE(connection.Open(GetDatabasePath())); | 259 ASSERT_TRUE(connection.Open(GetDatabasePath())); |
| 260 ASSERT_TRUE(connection.Execute(contents.data())); | 260 ASSERT_TRUE(connection.Execute(contents.data())); |
| 261 } | 261 } |
| (...skipping 2541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2803 ASSERT_TRUE(sql::MetaTable::DoesTableExist(&connection)); | 2803 ASSERT_TRUE(sql::MetaTable::DoesTableExist(&connection)); |
| 2804 | 2804 |
| 2805 // Check version. | 2805 // Check version. |
| 2806 EXPECT_EQ(kCurrentTestedVersionNumber, VersionFromConnection(&connection)); | 2806 EXPECT_EQ(kCurrentTestedVersionNumber, VersionFromConnection(&connection)); |
| 2807 | 2807 |
| 2808 ASSERT_TRUE(connection.DoesTableExist("masked_credit_cards")); | 2808 ASSERT_TRUE(connection.DoesTableExist("masked_credit_cards")); |
| 2809 ASSERT_TRUE(connection.DoesTableExist("unmasked_credit_cards")); | 2809 ASSERT_TRUE(connection.DoesTableExist("unmasked_credit_cards")); |
| 2810 ASSERT_TRUE(connection.DoesTableExist("server_addresses")); | 2810 ASSERT_TRUE(connection.DoesTableExist("server_addresses")); |
| 2811 } | 2811 } |
| 2812 } | 2812 } |
| OLD | NEW |