Lines Matching refs:base
5 #include "net/base/host_cache.h"
7 #include "base/format_macros.h"
8 #include "base/stl_util-inl.h"
9 #include "base/string_util.h"
10 #include "base/stringprintf.h"
11 #include "net/base/net_errors.h"
19 const base::TimeDelta kSuccessEntryTTL = base::TimeDelta::FromSeconds(10);
20 const base::TimeDelta kFailureEntryTTL = base::TimeDelta::FromSeconds(0);
33 base::TimeTicks now;
41 EXPECT_TRUE(cache.Lookup(Key("foobar.com"), base::TimeTicks()) == NULL);
43 entry1 = cache.Lookup(Key("foobar.com"), base::TimeTicks());
48 now += base::TimeDelta::FromSeconds(5);
51 EXPECT_TRUE(cache.Lookup(Key("foobar2.com"), base::TimeTicks()) == NULL);
53 entry2 = cache.Lookup(Key("foobar2.com"), base::TimeTicks());
58 now += base::TimeDelta::FromSeconds(4);
65 now += base::TimeDelta::FromSeconds(1);
81 now += base::TimeDelta::FromSeconds(10);
93 base::TimeTicks now;
95 EXPECT_TRUE(cache.Lookup(Key("foobar.com"), base::TimeTicks()) == NULL);
113 base::TimeDelta::FromSeconds(0), // success entry TTL.
114 base::TimeDelta::FromSeconds(10)); // failure entry TTL.
117 base::TimeTicks now;
125 EXPECT_TRUE(cache.Lookup(Key("foobar.com"), base::TimeTicks()) == NULL);
127 entry1 = cache.Lookup(Key("foobar.com"), base::TimeTicks());
132 now += base::TimeDelta::FromSeconds(5);
135 EXPECT_TRUE(cache.Lookup(Key("foobar2.com"), base::TimeTicks()) == NULL);
137 entry2 = cache.Lookup(Key("foobar2.com"), base::TimeTicks());
142 now += base::TimeDelta::FromSeconds(4);
149 now += base::TimeDelta::FromSeconds(1);
165 now += base::TimeDelta::FromSeconds(10);
178 base::TimeTicks now = base::TimeTicks() + base::TimeDelta::FromSeconds(10);
182 std::string hostname = base::StringPrintf("valid%d", i);
189 std::string hostname = base::StringPrintf("expired%d", i);
190 base::TimeTicks t = now - base::TimeDelta::FromSeconds(10);
197 std::string hostname = base::StringPrintf("negative%d", i);
242 base::TimeTicks now = base::TimeTicks() + kSuccessEntryTTL;
278 base::TimeTicks now;
289 EXPECT_TRUE(cache.Lookup(key1, base::TimeTicks()) == NULL);
291 entry1 = cache.Lookup(key1, base::TimeTicks());
296 EXPECT_TRUE(cache.Lookup(key2, base::TimeTicks()) == NULL);
298 entry2 = cache.Lookup(key2, base::TimeTicks());
313 base::TimeTicks now;
328 EXPECT_TRUE(cache.Lookup(key1, base::TimeTicks()) == NULL);
330 entry1 = cache.Lookup(key1, base::TimeTicks());
335 EXPECT_TRUE(cache.Lookup(key2, base::TimeTicks()) == NULL);
337 entry2 = cache.Lookup(key2, base::TimeTicks());
342 EXPECT_TRUE(cache.Lookup(key3, base::TimeTicks()) == NULL);
344 entry3 = cache.Lookup(key3, base::TimeTicks());
361 base::TimeTicks now;
364 EXPECT_TRUE(cache.Lookup(Key("foobar.com"), base::TimeTicks()) == NULL);
366 EXPECT_TRUE(cache.Lookup(Key("foobar.com"), base::TimeTicks()) == NULL);
375 base::TimeTicks now;
456 SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "]", i));