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 #ifndef CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_TEST_UTIL_H_ | 4 #ifndef CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_TEST_UTIL_H_ |
5 #define CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_TEST_UTIL_H_ | 5 #define CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_TEST_UTIL_H_ |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "chrome/browser/predictors/resource_prefetch_predictor.h" | 10 #include "chrome/browser/predictors/resource_prefetch_predictor.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 const std::string& main_frame_url, | 70 const std::string& main_frame_url, |
71 const std::string& resource_url = std::string(), | 71 const std::string& resource_url = std::string(), |
72 content::ResourceType resource_type = content::RESOURCE_TYPE_MAIN_FRAME, | 72 content::ResourceType resource_type = content::RESOURCE_TYPE_MAIN_FRAME, |
73 net::RequestPriority priority = net::MEDIUM, | 73 net::RequestPriority priority = net::MEDIUM, |
74 const std::string& mime_type = std::string(), | 74 const std::string& mime_type = std::string(), |
75 bool was_cached = false, | 75 bool was_cached = false, |
76 const std::string& redirect_url = std::string(), | 76 const std::string& redirect_url = std::string(), |
77 bool has_validators = false, | 77 bool has_validators = false, |
78 bool always_revalidate = false); | 78 bool always_revalidate = false); |
79 | 79 |
| 80 void PopulateTestConfig(LoadingPredictorConfig* config, bool small_db = true); |
| 81 |
80 // For printing failures nicely. | 82 // For printing failures nicely. |
81 std::ostream& operator<<(std::ostream& stream, const PrefetchData& data); | 83 std::ostream& operator<<(std::ostream& stream, const PrefetchData& data); |
82 std::ostream& operator<<(std::ostream& stream, const ResourceData& resource); | 84 std::ostream& operator<<(std::ostream& stream, const ResourceData& resource); |
83 std::ostream& operator<<(std::ostream& stream, const RedirectData& data); | 85 std::ostream& operator<<(std::ostream& stream, const RedirectData& data); |
84 std::ostream& operator<<(std::ostream& stream, const RedirectStat& redirect); | 86 std::ostream& operator<<(std::ostream& stream, const RedirectStat& redirect); |
85 std::ostream& operator<<( | 87 std::ostream& operator<<( |
86 std::ostream& stream, | 88 std::ostream& stream, |
87 const ResourcePrefetchPredictor::PageRequestSummary& summary); | 89 const ResourcePrefetchPredictor::PageRequestSummary& summary); |
88 std::ostream& operator<<( | 90 std::ostream& operator<<( |
89 std::ostream& stream, | 91 std::ostream& stream, |
(...skipping 22 matching lines...) Expand all Loading... |
112 const PrecacheManifest& manifest); | 114 const PrecacheManifest& manifest); |
113 std::ostream& operator<<(std::ostream& stream, | 115 std::ostream& operator<<(std::ostream& stream, |
114 const PrecacheResource& resource); | 116 const PrecacheResource& resource); |
115 | 117 |
116 bool operator==(const PrecacheManifest& lhs, const PrecacheManifest& rhs); | 118 bool operator==(const PrecacheManifest& lhs, const PrecacheManifest& rhs); |
117 bool operator==(const PrecacheResource& lhs, const PrecacheResource& rhs); | 119 bool operator==(const PrecacheResource& lhs, const PrecacheResource& rhs); |
118 | 120 |
119 } // namespace precache | 121 } // namespace precache |
120 | 122 |
121 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_TEST_UTIL_H_ | 123 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_TEST_UTIL_H_ |
OLD | NEW |