| 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 #ifndef COMPONENTS_DOMAIN_RELIABILITY_TEST_UTIL_H_ | 5 #ifndef COMPONENTS_DOMAIN_RELIABILITY_TEST_UTIL_H_ |
| 6 #define COMPONENTS_DOMAIN_RELIABILITY_TEST_UTIL_H_ | 6 #define COMPONENTS_DOMAIN_RELIABILITY_TEST_UTIL_H_ |
| 7 | 7 |
| 8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "components/domain_reliability/config.h" | 10 #include "components/domain_reliability/config.h" |
| 11 #include "components/domain_reliability/scheduler.h" | 11 #include "components/domain_reliability/scheduler.h" |
| 12 #include "components/domain_reliability/uploader.h" | 12 #include "components/domain_reliability/uploader.h" |
| 13 #include "components/domain_reliability/util.h" | 13 #include "components/domain_reliability/util.h" |
| 14 #include "net/base/host_port_pair.h" | 14 #include "net/base/host_port_pair.h" |
| 15 #include "url/gurl.h" |
| 15 | 16 |
| 16 namespace net { | 17 namespace net { |
| 17 class URLRequestStatus; | 18 class URLRequestStatus; |
| 18 } // namespace net | 19 } // namespace net |
| 19 | 20 |
| 20 namespace domain_reliability { | 21 namespace domain_reliability { |
| 21 | 22 |
| 22 // A simple test callback that remembers whether it's been called. | 23 // A simple test callback that remembers whether it's been called. |
| 23 class TestCallback { | 24 class TestCallback { |
| 24 public: | 25 public: |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 113 |
| 113 int elapsed_sec() { return (now_ticks_ - epoch_ticks_).InSeconds(); } | 114 int elapsed_sec() { return (now_ticks_ - epoch_ticks_).InSeconds(); } |
| 114 | 115 |
| 115 base::Time now_; | 116 base::Time now_; |
| 116 base::TimeTicks now_ticks_; | 117 base::TimeTicks now_ticks_; |
| 117 base::TimeTicks epoch_ticks_; | 118 base::TimeTicks epoch_ticks_; |
| 118 int task_sequence_number_; | 119 int task_sequence_number_; |
| 119 TaskMap tasks_; | 120 TaskMap tasks_; |
| 120 }; | 121 }; |
| 121 | 122 |
| 122 scoped_ptr<const DomainReliabilityConfig> MakeTestConfig(); | 123 scoped_ptr<DomainReliabilityConfig> MakeTestConfig(); |
| 123 scoped_ptr<const DomainReliabilityConfig> MakeTestConfigWithDomain( | 124 scoped_ptr<DomainReliabilityConfig> MakeTestConfigWithOrigin( |
| 124 const std::string& domain); | 125 const GURL& origin); |
| 125 DomainReliabilityScheduler::Params MakeTestSchedulerParams(); | 126 DomainReliabilityScheduler::Params MakeTestSchedulerParams(); |
| 126 | 127 |
| 127 } // namespace domain_reliability | 128 } // namespace domain_reliability |
| 128 | 129 |
| 129 #endif // COMPONENTS_DOMAIN_RELIABILITY_TEST_UTIL_H_ | 130 #endif // COMPONENTS_DOMAIN_RELIABILITY_TEST_UTIL_H_ |
| OLD | NEW |