Lines Matching full:entry
40 TestBackoffEntry entry(&base_policy); in TEST() local
41 EXPECT_FALSE(entry.ShouldRejectRequest()); in TEST()
42 EXPECT_EQ(TimeDelta(), entry.GetTimeUntilRelease()); in TEST()
44 entry.InformOfRequest(false); in TEST()
45 EXPECT_TRUE(entry.ShouldRejectRequest()); in TEST()
46 EXPECT_EQ(TimeDelta::FromMilliseconds(1000), entry.GetTimeUntilRelease()); in TEST()
59 TestBackoffEntry entry(&base_policy); in TEST() local
61 EXPECT_FALSE(entry.CanDiscard()); in TEST()
64 entry.InformOfRequest(false); in TEST()
65 EXPECT_FALSE(entry.CanDiscard()); in TEST()
68 entry.set_now( in TEST()
69 entry.GetReleaseTime() + TimeDelta::FromMilliseconds(1)); in TEST()
70 EXPECT_FALSE(entry.CanDiscard()); in TEST()
71 entry.set_now(entry.GetReleaseTime() + TimeDelta::FromMilliseconds( in TEST()
73 EXPECT_TRUE(entry.CanDiscard()); in TEST()
76 entry.set_now(entry.GetReleaseTime() + TimeDelta::FromMilliseconds( in TEST()
78 entry.InformOfRequest(true); in TEST()
79 EXPECT_FALSE(entry.CanDiscard()); in TEST()
80 entry.set_now(entry.GetReleaseTime() + TimeDelta::FromMilliseconds( in TEST()
82 EXPECT_TRUE(entry.CanDiscard()); in TEST()
90 TestBackoffEntry entry(&always_delay_policy); in TEST() local
93 entry.set_now(entry.GetReleaseTime() + TimeDelta::FromMilliseconds(2000)); in TEST()
94 EXPECT_TRUE(entry.CanDiscard()); in TEST()
97 entry.InformOfRequest(true); in TEST()
98 EXPECT_FALSE(entry.CanDiscard()); in TEST()
100 // Wait until the delay expires, and we can discard the entry again. in TEST()
101 entry.set_now(entry.GetReleaseTime() + TimeDelta::FromMilliseconds(1000)); in TEST()
102 EXPECT_TRUE(entry.CanDiscard()); in TEST()
116 BackoffEntry entry(&lenient_policy); in TEST() local
118 entry.InformOfRequest(false); in TEST()
119 EXPECT_FALSE(entry.ShouldRejectRequest()); in TEST()
121 entry.InformOfRequest(false); in TEST()
122 EXPECT_FALSE(entry.ShouldRejectRequest()); in TEST()
124 entry.InformOfRequest(false); in TEST()
125 EXPECT_TRUE(entry.ShouldRejectRequest()); in TEST()
129 TestBackoffEntry entry(&base_policy); in TEST() local
132 TimeTicks result = entry.GetReleaseTime(); in TEST()
133 EXPECT_EQ(entry.ImplGetTimeNow(), result); in TEST()
136 entry.InformOfRequest(false); in TEST()
137 result = entry.GetReleaseTime(); in TEST()
138 EXPECT_EQ(entry.ImplGetTimeNow() + TimeDelta::FromMilliseconds(1000), result); in TEST()
139 EXPECT_EQ(TimeDelta::FromMilliseconds(1000), entry.GetTimeUntilRelease()); in TEST()
142 entry.InformOfRequest(false); in TEST()
143 result = entry.GetReleaseTime(); in TEST()
144 EXPECT_EQ(entry.ImplGetTimeNow() + TimeDelta::FromMilliseconds(2000), result); in TEST()
145 EXPECT_EQ(TimeDelta::FromMilliseconds(2000), entry.GetTimeUntilRelease()); in TEST()
148 entry.InformOfRequest(false); in TEST()
149 result = entry.GetReleaseTime(); in TEST()
150 EXPECT_EQ(entry.ImplGetTimeNow() + TimeDelta::FromMilliseconds(4000), result); in TEST()
151 EXPECT_EQ(TimeDelta::FromMilliseconds(4000), entry.GetTimeUntilRelease()); in TEST()
154 entry.InformOfRequest(false); in TEST()
155 entry.InformOfRequest(false); in TEST()
156 entry.InformOfRequest(false); in TEST()
157 result = entry.GetReleaseTime(); in TEST()
159 entry.ImplGetTimeNow() + TimeDelta::FromMilliseconds(20000), result); in TEST()
167 TestBackoffEntry entry(&always_delay_policy); in TEST() local
170 TimeTicks result = entry.GetReleaseTime(); in TEST()
171 EXPECT_EQ(TimeDelta(), entry.GetTimeUntilRelease()); in TEST()
174 entry.InformOfRequest(false); in TEST()
175 EXPECT_EQ(TimeDelta::FromMilliseconds(1000), entry.GetTimeUntilRelease()); in TEST()
178 entry.InformOfRequest(false); in TEST()
179 EXPECT_EQ(TimeDelta::FromMilliseconds(1000), entry.GetTimeUntilRelease()); in TEST()
182 entry.InformOfRequest(false); in TEST()
183 EXPECT_EQ(TimeDelta::FromMilliseconds(2000), entry.GetTimeUntilRelease()); in TEST()
186 entry.InformOfRequest(false); in TEST()
187 EXPECT_EQ(TimeDelta::FromMilliseconds(4000), entry.GetTimeUntilRelease()); in TEST()
190 entry.InformOfRequest(false); in TEST()
191 entry.InformOfRequest(false); in TEST()
192 entry.InformOfRequest(false); in TEST()
193 entry.InformOfRequest(false); in TEST()
194 result = entry.GetReleaseTime(); in TEST()
195 EXPECT_EQ(TimeDelta::FromMilliseconds(20000), entry.GetTimeUntilRelease()); in TEST()
203 TestBackoffEntry entry(&jittery_policy); in TEST() local
205 entry.InformOfRequest(false); in TEST()
206 entry.InformOfRequest(false); in TEST()
207 entry.InformOfRequest(false); in TEST()
208 TimeTicks result = entry.GetReleaseTime(); in TEST()
210 entry.ImplGetTimeNow() + TimeDelta::FromMilliseconds(3200), result); in TEST()
212 entry.ImplGetTimeNow() + TimeDelta::FromMilliseconds(4000), result); in TEST()
217 TestBackoffEntry entry(&base_policy); in TEST() local
220 entry.InformOfRequest(false); in TEST()
221 TimeTicks release_time = entry.GetReleaseTime(); in TEST()
226 entry.set_now(release_time - TimeDelta::FromMilliseconds(200)); in TEST()
227 entry.InformOfRequest(true); in TEST()
228 EXPECT_EQ(release_time, entry.GetReleaseTime()); in TEST()
231 entry.InformOfRequest(false); in TEST()
233 entry.GetReleaseTime()); in TEST()
241 TestBackoffEntry entry(&always_delay_policy); in TEST() local
244 entry.InformOfRequest(false); in TEST()
245 EXPECT_EQ(TimeDelta::FromMilliseconds(1000), entry.GetTimeUntilRelease()); in TEST()
248 entry.InformOfRequest(false); in TEST()
249 EXPECT_EQ(TimeDelta::FromMilliseconds(2000), entry.GetTimeUntilRelease()); in TEST()
250 entry.set_now(entry.GetReleaseTime() + TimeDelta::FromMilliseconds(2000)); in TEST()
253 entry.InformOfRequest(true); in TEST()
254 EXPECT_EQ(TimeDelta::FromMilliseconds(1000), entry.GetTimeUntilRelease()); in TEST()
257 entry.InformOfRequest(false); in TEST()
258 EXPECT_EQ(TimeDelta::FromMilliseconds(2000), entry.GetTimeUntilRelease()); in TEST()
259 entry.set_now(entry.GetReleaseTime() + TimeDelta::FromMilliseconds(2000)); in TEST()