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 <algorithm> | 5 #include <algorithm> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 const gfx::Size kSmallSize = gfx::Size(16, 16); | 49 const gfx::Size kSmallSize = gfx::Size(16, 16); |
50 const gfx::Size kLargeSize = gfx::Size(32, 32); | 50 const gfx::Size kLargeSize = gfx::Size(32, 32); |
51 | 51 |
52 } // namespace | 52 } // namespace |
53 | 53 |
54 class ThumbnailDatabaseTest : public testing::Test { | 54 class ThumbnailDatabaseTest : public testing::Test { |
55 public: | 55 public: |
56 ThumbnailDatabaseTest() { | 56 ThumbnailDatabaseTest() { |
57 } | 57 } |
58 ~ThumbnailDatabaseTest() { | 58 virtual ~ThumbnailDatabaseTest() { |
59 } | 59 } |
60 | 60 |
61 protected: | 61 protected: |
62 virtual void SetUp() { | 62 virtual void SetUp() { |
63 // Get a temporary directory for the test DB files. | 63 // Get a temporary directory for the test DB files. |
64 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 64 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
65 | 65 |
66 file_name_ = temp_dir_.path().AppendASCII("TestThumbnails.db"); | 66 file_name_ = temp_dir_.path().AppendASCII("TestThumbnails.db"); |
67 new_file_name_ = temp_dir_.path().AppendASCII("TestFavicons.db"); | 67 new_file_name_ = temp_dir_.path().AppendASCII("TestFavicons.db"); |
68 history_db_name_ = temp_dir_.path().AppendASCII("TestHistory.db"); | 68 history_db_name_ = temp_dir_.path().AppendASCII("TestHistory.db"); |
(...skipping 13 matching lines...) Expand all Loading... |
82 base::ScopedTempDir temp_dir_; | 82 base::ScopedTempDir temp_dir_; |
83 FilePath file_name_; | 83 FilePath file_name_; |
84 FilePath new_file_name_; | 84 FilePath new_file_name_; |
85 FilePath history_db_name_; | 85 FilePath history_db_name_; |
86 }; | 86 }; |
87 | 87 |
88 class IconMappingMigrationTest : public HistoryUnitTestBase { | 88 class IconMappingMigrationTest : public HistoryUnitTestBase { |
89 public: | 89 public: |
90 IconMappingMigrationTest() { | 90 IconMappingMigrationTest() { |
91 } | 91 } |
92 ~IconMappingMigrationTest() { | 92 virtual ~IconMappingMigrationTest() { |
93 } | 93 } |
94 | 94 |
95 protected: | 95 protected: |
96 virtual void SetUp() { | 96 virtual void SetUp() { |
97 profile_.reset(new TestingProfile); | 97 profile_.reset(new TestingProfile); |
98 | 98 |
99 FilePath data_path; | 99 FilePath data_path; |
100 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &data_path)); | 100 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &data_path)); |
101 data_path = data_path.AppendASCII("History"); | 101 data_path = data_path.AppendASCII("History"); |
102 | 102 |
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
868 } | 868 } |
869 | 869 |
870 std::string sizes_as_string; | 870 std::string sizes_as_string; |
871 ThumbnailDatabase::FaviconSizesToDatabaseString(sizes_valid, | 871 ThumbnailDatabase::FaviconSizesToDatabaseString(sizes_valid, |
872 &sizes_as_string); | 872 &sizes_as_string); |
873 EXPECT_TRUE(sizes_as_string == "10 15 20 25" || | 873 EXPECT_TRUE(sizes_as_string == "10 15 20 25" || |
874 sizes_as_string == "20 25 10 15"); | 874 sizes_as_string == "20 25 10 15"); |
875 } | 875 } |
876 | 876 |
877 } // namespace history | 877 } // namespace history |
OLD | NEW |