OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "chrome/browser/predictors/resource_prefetch_predictor_test_util.h" | 5 #include "chrome/browser/predictors/resource_prefetch_predictor_test_util.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 namespace { | 9 namespace { |
10 | 10 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 int number_of_misses, | 47 int number_of_misses, |
48 int consecutive_misses) { | 48 int consecutive_misses) { |
49 redirect->set_url(url); | 49 redirect->set_url(url); |
50 redirect->set_number_of_hits(number_of_hits); | 50 redirect->set_number_of_hits(number_of_hits); |
51 redirect->set_number_of_misses(number_of_misses); | 51 redirect->set_number_of_misses(number_of_misses); |
52 redirect->set_consecutive_misses(consecutive_misses); | 52 redirect->set_consecutive_misses(consecutive_misses); |
53 } | 53 } |
54 | 54 |
55 void InitializePrecacheResource(precache::PrecacheResource* resource, | 55 void InitializePrecacheResource(precache::PrecacheResource* resource, |
56 const std::string& url, | 56 const std::string& url, |
57 double weight_ratio) { | 57 double weight_ratio, |
| 58 precache::PrecacheResource::Type type) { |
58 resource->set_url(url); | 59 resource->set_url(url); |
59 resource->set_weight_ratio(weight_ratio); | 60 resource->set_weight_ratio(weight_ratio); |
| 61 resource->set_type(type); |
60 } | 62 } |
61 | 63 |
62 void InitializeOriginStat(OriginStat* origin_stat, | 64 void InitializeOriginStat(OriginStat* origin_stat, |
63 const std::string& origin, | 65 const std::string& origin, |
64 int number_of_hits, | 66 int number_of_hits, |
65 int number_of_misses, | 67 int number_of_misses, |
66 int consecutive_misses, | 68 int consecutive_misses, |
67 double average_position, | 69 double average_position, |
68 bool always_access_network, | 70 bool always_access_network, |
69 bool accessed_network) { | 71 bool accessed_network) { |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 | 353 |
352 return equal; | 354 return equal; |
353 } | 355 } |
354 | 356 |
355 bool operator==(const PrecacheResource& lhs, const PrecacheResource& rhs) { | 357 bool operator==(const PrecacheResource& lhs, const PrecacheResource& rhs) { |
356 return lhs.url() == rhs.url() && | 358 return lhs.url() == rhs.url() && |
357 AlmostEqual(lhs.weight_ratio(), rhs.weight_ratio()); | 359 AlmostEqual(lhs.weight_ratio(), rhs.weight_ratio()); |
358 } | 360 } |
359 | 361 |
360 } // namespace precache | 362 } // namespace precache |
OLD | NEW |