OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/domain_reliability/util.h" | 5 #include "components/domain_reliability/util.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "components/domain_reliability/test_util.h" | 8 #include "components/domain_reliability/test_util.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
| 11 namespace domain_reliability { |
| 12 namespace { |
| 13 |
11 using base::TimeDelta; | 14 using base::TimeDelta; |
12 using base::TimeTicks; | 15 using base::TimeTicks; |
13 | 16 |
14 namespace domain_reliability { | |
15 | |
16 class DomainReliabilityMockTimeTest : public testing::Test { | 17 class DomainReliabilityMockTimeTest : public testing::Test { |
17 protected: | 18 protected: |
18 MockTime time_; | 19 MockTime time_; |
19 }; | 20 }; |
20 | 21 |
21 TEST_F(DomainReliabilityMockTimeTest, Create) { | 22 TEST_F(DomainReliabilityMockTimeTest, Create) { |
22 } | 23 } |
23 | 24 |
24 TEST_F(DomainReliabilityMockTimeTest, NowAndAdvance) { | 25 TEST_F(DomainReliabilityMockTimeTest, NowAndAdvance) { |
25 const TimeDelta delta = TimeDelta::FromSeconds(1); | 26 const TimeDelta delta = TimeDelta::FromSeconds(1); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 delta, | 114 delta, |
114 callback.callback())); | 115 callback.callback())); |
115 time_.Advance(delta); | 116 time_.Advance(delta); |
116 EXPECT_FALSE(callback.called()); | 117 EXPECT_FALSE(callback.called()); |
117 EXPECT_TRUE(timer->IsRunning()); | 118 EXPECT_TRUE(timer->IsRunning()); |
118 time_.Advance(delta); | 119 time_.Advance(delta); |
119 EXPECT_TRUE(callback.called()); | 120 EXPECT_TRUE(callback.called()); |
120 EXPECT_FALSE(timer->IsRunning()); | 121 EXPECT_FALSE(timer->IsRunning()); |
121 } | 122 } |
122 | 123 |
| 124 } // namespace |
123 } // namespace domain_reliability | 125 } // namespace domain_reliability |
OLD | NEW |