Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: chrome/common/thumbnail_score_unittest.cc

Issue 7839019: Remove a static initializer in thumbnail_score.o (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/thumbnail_score.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/common/thumbnail_score.h"
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();
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 score.load_completed = true; 75 score.load_completed = true;
76 EXPECT_FALSE(score.ShouldConsiderUpdating()); 76 EXPECT_FALSE(score.ShouldConsiderUpdating());
77 77
78 // Make it very boring, but it won't change the result. The boring score 78 // Make it very boring, but it won't change the result. The boring score
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 -= ThumbnailScore::kUpdateThumbnailTime; 85 score.time_at_snapshot -=
86 base::TimeDelta::FromDays(ThumbnailScore::kUpdateThumbnailTimeDays);
86 EXPECT_TRUE(score.ShouldConsiderUpdating()); 87 EXPECT_TRUE(score.ShouldConsiderUpdating());
87 } 88 }
OLDNEW
« no previous file with comments | « chrome/common/thumbnail_score.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698