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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 | 145 |
146 TEST_F(ThumbnailDatabaseTest, GetFaviconIDForURL) { | 146 TEST_F(ThumbnailDatabaseTest, GetFaviconIDForURL) { |
147 ThumbnailDatabase db; | 147 ThumbnailDatabase db; |
148 ASSERT_EQ(sql::INIT_OK, db.Init(file_name_, NULL, NULL)); | 148 ASSERT_EQ(sql::INIT_OK, db.Init(file_name_, NULL, NULL)); |
149 db.BeginTransaction(); | 149 db.BeginTransaction(); |
150 | 150 |
151 std::vector<unsigned char> data(blob1, blob1 + sizeof(blob1)); | 151 std::vector<unsigned char> data(blob1, blob1 + sizeof(blob1)); |
152 scoped_refptr<base::RefCountedBytes> favicon(new base::RefCountedBytes(data)); | 152 scoped_refptr<base::RefCountedBytes> favicon(new base::RefCountedBytes(data)); |
153 | 153 |
154 GURL url("http://google.com"); | 154 GURL url("http://google.com"); |
155 base::Time time = base::Time::Now(); | 155 //base::Time time = base::Time::Now(); |
156 | 156 |
157 FaviconID id1 = db.AddFavicon(url, kFaviconRegularSize, FAVICON); | 157 FaviconID id1 = db.AddFavicon(url, kFaviconRegularSize, FAVICON); |
158 EXPECT_NE(0, id1); | 158 EXPECT_NE(0, id1); |
159 | 159 |
160 FaviconID id2 = db.AddFavicon(url, kFaviconRegularSize, | 160 FaviconID id2 = db.AddFavicon(url, kFaviconRegularSize, |
161 TOUCH_PRECOMPOSED_ICON); | 161 TOUCH_PRECOMPOSED_ICON); |
162 EXPECT_NE(0, id2); | 162 EXPECT_NE(0, id2); |
163 | 163 |
164 FaviconID id3 = db.AddFavicon(url, kFaviconLargeSize, | 164 FaviconID id3 = db.AddFavicon(url, kFaviconLargeSize, |
165 TOUCH_PRECOMPOSED_ICON); | 165 TOUCH_PRECOMPOSED_ICON); |
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 ASSERT_TRUE(enumerator2.GetNextIconMapping(&icon_mapping)); | 735 ASSERT_TRUE(enumerator2.GetNextIconMapping(&icon_mapping)); |
736 EXPECT_EQ(touch_mapping_id1, icon_mapping.mapping_id); | 736 EXPECT_EQ(touch_mapping_id1, icon_mapping.mapping_id); |
737 EXPECT_EQ(url, icon_mapping.page_url); | 737 EXPECT_EQ(url, icon_mapping.page_url); |
738 EXPECT_EQ(touch_icon_id1, icon_mapping.icon_id); | 738 EXPECT_EQ(touch_icon_id1, icon_mapping.icon_id); |
739 EXPECT_EQ(TOUCH_ICON, icon_mapping.icon_type); | 739 EXPECT_EQ(TOUCH_ICON, icon_mapping.icon_type); |
740 | 740 |
741 EXPECT_FALSE(enumerator2.GetNextIconMapping(&icon_mapping)); | 741 EXPECT_FALSE(enumerator2.GetNextIconMapping(&icon_mapping)); |
742 } | 742 } |
743 | 743 |
744 } // namespace history | 744 } // namespace history |
OLD | NEW |