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

Side by Side Diff: components/history/core/browser/visit_filter_unittest.cc

Issue 1548113002: Switch to standard integer types in components/, part 2 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gn Created 4 years, 12 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
OLDNEW
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 "components/history/core/browser/visit_filter.h" 5 #include "components/history/core/browser/visit_filter.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <stddef.h>
8 9
9 #include "base/logging.h" 10 #include "base/logging.h"
10 #include "base/time/time.h" 11 #include "base/time/time.h"
11 #include "components/history/core/browser/history_types.h" 12 #include "components/history/core/browser/history_types.h"
12 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
13 14
14 namespace { 15 namespace {
15 16
16 // So the tests won't go into the other day +/- several hours, return midday of 17 // So the tests won't go into the other day +/- several hours, return midday of
17 // today. 18 // today.
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 visit.visit_time = filter_time - base::TimeDelta::FromDays(7); 306 visit.visit_time = filter_time - base::TimeDelta::FromDays(7);
306 EXPECT_DOUBLE_EQ(0.5, filter.GetVisitScore(visit)); 307 EXPECT_DOUBLE_EQ(0.5, filter.GetVisitScore(visit));
307 // One standard deviation of decay, plus the staleness factor. 308 // One standard deviation of decay, plus the staleness factor.
308 visit.visit_time = filter_time - base::TimeDelta::FromDays(7) - 309 visit.visit_time = filter_time - base::TimeDelta::FromDays(7) -
309 base::TimeDelta::FromHours(1); 310 base::TimeDelta::FromHours(1);
310 EXPECT_DOUBLE_EQ(exp(-0.5) * one_week_one_hour_staleness, 311 EXPECT_DOUBLE_EQ(exp(-0.5) * one_week_one_hour_staleness,
311 filter.GetVisitScore(visit)); 312 filter.GetVisitScore(visit));
312 } 313 }
313 314
314 } // namespace history 315 } // namespace history
OLDNEW
« no previous file with comments | « components/history/core/browser/visit_filter.h ('k') | components/history/core/browser/visit_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698