| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/file_path.h" | 5 #include "base/file_path.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/scoped_temp_dir.h" | 7 #include "base/scoped_temp_dir.h" |
| 8 #include "chrome/browser/history/top_sites_database.h" | 8 #include "chrome/browser/history/top_sites_database.h" |
| 9 #include "sql/connection.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 11 |
| 11 namespace history { | 12 namespace history { |
| 12 | 13 |
| 13 class TopSitesDatabaseTest : public testing::Test { | 14 class TopSitesDatabaseTest : public testing::Test { |
| 14 protected: | 15 protected: |
| 15 virtual void SetUp() { | 16 virtual void SetUp() { |
| 16 // Get a temporary directory for the test DB files. | 17 // Get a temporary directory for the test DB files. |
| 17 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 18 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 18 file_name_ = temp_dir_.path().AppendASCII("TestTopSites.db"); | 19 file_name_ = temp_dir_.path().AppendASCII("TestTopSites.db"); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 47 | 48 |
| 48 // Upgrade to version 2. | 49 // Upgrade to version 2. |
| 49 ASSERT_TRUE(db.UpgradeToVersion2()); | 50 ASSERT_TRUE(db.UpgradeToVersion2()); |
| 50 | 51 |
| 51 // Make sure the table meets the version 2 criteria. | 52 // Make sure the table meets the version 2 criteria. |
| 52 ASSERT_EQ(2, db.meta_table_.GetVersionNumber()); | 53 ASSERT_EQ(2, db.meta_table_.GetVersionNumber()); |
| 53 ASSERT_TRUE(db.db_->DoesColumnExist("thumbnails", "load_completed")); | 54 ASSERT_TRUE(db.db_->DoesColumnExist("thumbnails", "load_completed")); |
| 54 } | 55 } |
| 55 | 56 |
| 56 } // namespace history | 57 } // namespace history |
| OLD | NEW |