| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 // > .output version_nn.sql | 125 // > .output version_nn.sql |
| 126 // > .dump | 126 // > .dump |
| 127 void LoadDatabase(const base::FilePath::StringType& file); | 127 void LoadDatabase(const base::FilePath::StringType& file); |
| 128 | 128 |
| 129 private: | 129 private: |
| 130 base::ScopedTempDir temp_dir_; | 130 base::ScopedTempDir temp_dir_; |
| 131 | 131 |
| 132 DISALLOW_COPY_AND_ASSIGN(WebDatabaseMigrationTest); | 132 DISALLOW_COPY_AND_ASSIGN(WebDatabaseMigrationTest); |
| 133 }; | 133 }; |
| 134 | 134 |
| 135 const int WebDatabaseMigrationTest::kCurrentTestedVersionNumber = 63; | 135 const int WebDatabaseMigrationTest::kCurrentTestedVersionNumber = 64; |
| 136 | 136 |
| 137 void WebDatabaseMigrationTest::LoadDatabase( | 137 void WebDatabaseMigrationTest::LoadDatabase( |
| 138 const base::FilePath::StringType& file) { | 138 const base::FilePath::StringType& file) { |
| 139 std::string contents; | 139 std::string contents; |
| 140 ASSERT_TRUE(GetWebDatabaseData(base::FilePath(file), &contents)); | 140 ASSERT_TRUE(GetWebDatabaseData(base::FilePath(file), &contents)); |
| 141 | 141 |
| 142 sql::Connection connection; | 142 sql::Connection connection; |
| 143 ASSERT_TRUE(connection.Open(GetDatabasePath())); | 143 ASSERT_TRUE(connection.Open(GetDatabasePath())); |
| 144 ASSERT_TRUE(connection.Execute(contents.data())); | 144 ASSERT_TRUE(connection.Execute(contents.data())); |
| 145 } | 145 } |
| (...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 927 | 927 |
| 928 // Check version. | 928 // Check version. |
| 929 EXPECT_EQ(kCurrentTestedVersionNumber, VersionFromConnection(&connection)); | 929 EXPECT_EQ(kCurrentTestedVersionNumber, VersionFromConnection(&connection)); |
| 930 | 930 |
| 931 EXPECT_TRUE(connection.DoesColumnExist("unmasked_credit_cards", | 931 EXPECT_TRUE(connection.DoesColumnExist("unmasked_credit_cards", |
| 932 "use_count")); | 932 "use_count")); |
| 933 EXPECT_TRUE(connection.DoesColumnExist("unmasked_credit_cards", | 933 EXPECT_TRUE(connection.DoesColumnExist("unmasked_credit_cards", |
| 934 "use_date")); | 934 "use_date")); |
| 935 } | 935 } |
| 936 } | 936 } |
| OLD | NEW |