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 "chrome/common/thumbnail_score.h" | 5 #include "components/history/core/common/thumbnail_score.h" |
blundell
2014/06/03 08:30:33
This test should move too, and should be run in co
nshaik
2014/06/08 08:43:41
Done.
| |
6 #include "testing/gtest/include/gtest/gtest.h" | 6 #include "testing/gtest/include/gtest/gtest.h" |
7 | 7 |
8 // Tests that the different types of thumbnails are compared properly. | 8 // Tests that the different types of thumbnails are compared properly. |
9 TEST(ThumbnailScoreTest, ShouldReplaceThumbnailWithType) { | 9 TEST(ThumbnailScoreTest, ShouldReplaceThumbnailWithType) { |
10 base::Time now = base::Time::Now(); | 10 base::Time now = base::Time::Now(); |
11 | 11 |
12 ThumbnailScore nothing_good(0.5, false, false, now); | 12 ThumbnailScore nothing_good(0.5, false, false, now); |
13 ThumbnailScore not_at_top(0.5, false, true, now); | 13 ThumbnailScore not_at_top(0.5, false, true, now); |
14 ThumbnailScore bad_clipping(0.5, true, false, now); | 14 ThumbnailScore bad_clipping(0.5, true, false, now); |
15 ThumbnailScore life_is_awesome(0.5, true, true, now); | 15 ThumbnailScore life_is_awesome(0.5, true, true, now); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
79 // isn't used for judging whether we should update or not. See comments | 79 // isn't used for judging whether we should update or not. See comments |
80 // at boring_score in thumbnail_score.h for why. | 80 // at boring_score in thumbnail_score.h for why. |
81 score.boring_score = 1.0; | 81 score.boring_score = 1.0; |
82 EXPECT_FALSE(score.ShouldConsiderUpdating()); | 82 EXPECT_FALSE(score.ShouldConsiderUpdating()); |
83 | 83 |
84 // Make it old. Then, it's no longer new enough. | 84 // Make it old. Then, it's no longer new enough. |
85 score.time_at_snapshot -= | 85 score.time_at_snapshot -= |
86 base::TimeDelta::FromDays(ThumbnailScore::kUpdateThumbnailTimeDays); | 86 base::TimeDelta::FromDays(ThumbnailScore::kUpdateThumbnailTimeDays); |
87 EXPECT_TRUE(score.ShouldConsiderUpdating()); | 87 EXPECT_TRUE(score.ShouldConsiderUpdating()); |
88 } | 88 } |
OLD | NEW |