OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 #ifndef CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_TEST_UTIL_H_ |
| 5 #define CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_TEST_UTIL_H_ |
| 6 |
| 7 #include "chrome/browser/predictors/resource_prefetch_predictor.pb.h" |
| 8 #include "chrome/browser/predictors/resource_prefetch_predictor_tables.h" |
| 9 #include "content/public/common/resource_type.h" |
| 10 #include "net/base/request_priority.h" |
| 11 |
| 12 class ostream; |
| 13 |
| 14 namespace predictors { |
| 15 |
| 16 ::chrome_browser_predictors::ResourceData MakeResourceData( |
| 17 std::string resource_url, |
| 18 content::ResourceType resource_type, |
| 19 int number_of_hits, |
| 20 int number_of_misses, |
| 21 int consecutive_misses, |
| 22 double average_position, |
| 23 net::RequestPriority priority, |
| 24 bool has_validators, |
| 25 bool always_revalidate); |
| 26 |
| 27 // For printing failures nicely. |
| 28 void PrintTo(const ::chrome_browser_predictors::ResourceData& resource, |
| 29 ::std::ostream* os); |
| 30 void PrintTo(const ResourcePrefetchPredictorTables::PrefetchData& data, |
| 31 ::std::ostream* os); |
| 32 |
| 33 bool operator==(const ::chrome_browser_predictors::ResourceData& lhs, |
| 34 const ::chrome_browser_predictors::ResourceData& rhs); |
| 35 |
| 36 bool operator==(const ResourcePrefetchPredictorTables::PrefetchData& lhs, |
| 37 const ResourcePrefetchPredictorTables::PrefetchData& rhs); |
| 38 |
| 39 } // namespace predictors |
| 40 |
| 41 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_TEST_UTIL_H_ |
OLD | NEW |