Lines Matching defs:now
14 base::TimeTicks now;
15 RateEstimator estimator(TimeDelta::FromSeconds(1), 10u, now);
16 EXPECT_EQ(0u, estimator.GetCountPerSecond(now));
18 estimator.Increment(50u, now);
19 EXPECT_EQ(50u, estimator.GetCountPerSecond(now));
21 now += TimeDelta::FromMilliseconds(800);
22 estimator.Increment(50, now);
23 EXPECT_EQ(100u, estimator.GetCountPerSecond(now));
26 now += TimeDelta::FromSeconds(3);
27 EXPECT_EQ(25u, estimator.GetCountPerSecond(now));
28 estimator.Increment(60, now);
29 EXPECT_EQ(40u, estimator.GetCountPerSecond(now));
32 now += TimeDelta::FromSeconds(4);
33 EXPECT_EQ(20u, estimator.GetCountPerSecond(now));
36 now += TimeDelta::FromSeconds(2);
37 EXPECT_EQ(16u, estimator.GetCountPerSecond(now));
38 estimator.Increment(100, now);
39 EXPECT_EQ(26u, estimator.GetCountPerSecond(now));
42 now += TimeDelta::FromSeconds(1);
43 EXPECT_EQ(16u, estimator.GetCountPerSecond(now));
44 estimator.Increment(100, now);
45 EXPECT_EQ(26u, estimator.GetCountPerSecond(now));
48 now += TimeDelta::FromSeconds(40);
49 EXPECT_EQ(0u, estimator.GetCountPerSecond(now));
50 estimator.Increment(100, now);
51 EXPECT_EQ(100u, estimator.GetCountPerSecond(now));
54 now = base::TimeTicks();
55 EXPECT_EQ(0u, estimator.GetCountPerSecond(now));