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/test_util.h" | 5 #include "components/domain_reliability/test_util.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/ptr_util.h" |
9 #include "components/domain_reliability/scheduler.h" | 10 #include "components/domain_reliability/scheduler.h" |
10 #include "net/url_request/url_request_status.h" | 11 #include "net/url_request/url_request_status.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
12 | 13 |
13 namespace domain_reliability { | 14 namespace domain_reliability { |
14 | 15 |
15 namespace { | 16 namespace { |
16 | 17 |
17 class MockTimer : public MockableTime::Timer { | 18 class MockTimer : public MockableTime::Timer { |
18 public: | 19 public: |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 } | 163 } |
163 | 164 |
164 std::unique_ptr<DomainReliabilityConfig> MakeTestConfig() { | 165 std::unique_ptr<DomainReliabilityConfig> MakeTestConfig() { |
165 return MakeTestConfigWithOrigin(GURL("https://example/")); | 166 return MakeTestConfigWithOrigin(GURL("https://example/")); |
166 } | 167 } |
167 | 168 |
168 std::unique_ptr<DomainReliabilityConfig> MakeTestConfigWithOrigin( | 169 std::unique_ptr<DomainReliabilityConfig> MakeTestConfigWithOrigin( |
169 const GURL& origin) { | 170 const GURL& origin) { |
170 DomainReliabilityConfig* config = new DomainReliabilityConfig(); | 171 DomainReliabilityConfig* config = new DomainReliabilityConfig(); |
171 config->origin = origin; | 172 config->origin = origin; |
172 config->collectors.push_back(new GURL("https://exampleuploader/upload")); | 173 config->collectors.push_back( |
| 174 base::MakeUnique<GURL>("https://exampleuploader/upload")); |
173 config->failure_sample_rate = 1.0; | 175 config->failure_sample_rate = 1.0; |
174 config->success_sample_rate = 0.0; | 176 config->success_sample_rate = 0.0; |
175 | 177 |
176 DCHECK(config->IsValid()); | 178 DCHECK(config->IsValid()); |
177 | 179 |
178 return std::unique_ptr<DomainReliabilityConfig>(config); | 180 return std::unique_ptr<DomainReliabilityConfig>(config); |
179 } | 181 } |
180 | 182 |
181 } // namespace domain_reliability | 183 } // namespace domain_reliability |
OLD | NEW |