| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/gfx/jpeg_codec.h" | 8 #include "base/gfx/jpeg_codec.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "chrome/browser/history/thumbnail_database.h" | 10 #include "chrome/browser/history/thumbnail_database.h" |
| 11 #include "chrome/common/chrome_paths.h" | 11 #include "chrome/common/chrome_paths.h" |
| 12 #include "chrome/common/thumbnail_score.h" | 12 #include "chrome/common/thumbnail_score.h" |
| 13 #include "chrome/tools/profiles/thumbnail-inl.h" | 13 #include "chrome/tools/profiles/thumbnail-inl.h" |
| 14 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 16 #include "SkBitmap.h" | 16 #include "third_party/skia/include/core/SkBitmap.h" |
| 17 | 17 |
| 18 using base::Time; | 18 using base::Time; |
| 19 using base::TimeDelta; | 19 using base::TimeDelta; |
| 20 | 20 |
| 21 namespace history { | 21 namespace history { |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 // data we'll put into the thumbnail database | 25 // data we'll put into the thumbnail database |
| 26 static const unsigned char blob1[] = | 26 static const unsigned char blob1[] = |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 ThumbnailScore totally_boring_in_the_future( | 323 ThumbnailScore totally_boring_in_the_future( |
| 324 kTotallyBoring, true, true, kNow + TimeDelta::FromDays(365)); | 324 kTotallyBoring, true, true, kNow + TimeDelta::FromDays(365)); |
| 325 db.SetPageThumbnail(gurl, kPage1, *google_bitmap_, | 325 db.SetPageThumbnail(gurl, kPage1, *google_bitmap_, |
| 326 totally_boring_in_the_future, time); | 326 totally_boring_in_the_future, time); |
| 327 ASSERT_TRUE(db.GetPageThumbnail(kPage1, &jpeg_data)); | 327 ASSERT_TRUE(db.GetPageThumbnail(kPage1, &jpeg_data)); |
| 328 ASSERT_TRUE(db.ThumbnailScoreForId(kPage1, &score_out)); | 328 ASSERT_TRUE(db.ThumbnailScoreForId(kPage1, &score_out)); |
| 329 ASSERT_TRUE(base_boring.Equals(score_out)); | 329 ASSERT_TRUE(base_boring.Equals(score_out)); |
| 330 } | 330 } |
| 331 | 331 |
| 332 } // namespace history | 332 } // namespace history |
| OLD | NEW |