OLD | NEW |
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 "net/base/expiring_cache.h" | 5 #include "net/base/expiring_cache.h" |
6 | 6 |
7 #include <functional> | 7 #include <functional> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
12 #include "base/time.h" | 12 #include "base/time/time.h" |
13 #include "testing/gmock/include/gmock/gmock.h" | 13 #include "testing/gmock/include/gmock/gmock.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 | 15 |
16 using testing::Pointee; | 16 using testing::Pointee; |
17 using testing::StrEq; | 17 using testing::StrEq; |
18 | 18 |
19 namespace net { | 19 namespace net { |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 // should be able to add something at kHeatDeath that expires at kMuchLater. | 302 // should be able to add something at kHeatDeath that expires at kMuchLater. |
303 cache.Put("test7", "foo7", kHeatDeath, kMuchLater); | 303 cache.Put("test7", "foo7", kHeatDeath, kMuchLater); |
304 EXPECT_EQ(1U, cache.size()); | 304 EXPECT_EQ(1U, cache.size()); |
305 EXPECT_THAT(cache.Get("test7", kNow), Pointee(StrEq("foo7"))); | 305 EXPECT_THAT(cache.Get("test7", kNow), Pointee(StrEq("foo7"))); |
306 EXPECT_THAT(cache.Get("test7", kLater), Pointee(StrEq("foo7"))); | 306 EXPECT_THAT(cache.Get("test7", kLater), Pointee(StrEq("foo7"))); |
307 EXPECT_THAT(cache.Get("test7", kHeatDeath), Pointee(StrEq("foo7"))); | 307 EXPECT_THAT(cache.Get("test7", kHeatDeath), Pointee(StrEq("foo7"))); |
308 EXPECT_FALSE(cache.Get("test7", kMuchLater)); | 308 EXPECT_FALSE(cache.Get("test7", kMuchLater)); |
309 } | 309 } |
310 | 310 |
311 } // namespace net | 311 } // namespace net |
OLD | NEW |