Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6201)

Unified Diff: chrome/browser/predictors/resource_prefetch_predictor_test_util.h

Issue 2355273002: Redirect handling in the resource_prefetch_predictor. (Closed)
Patch Set: Minor changes Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/predictors/resource_prefetch_predictor_test_util.h
diff --git a/chrome/browser/predictors/resource_prefetch_predictor_test_util.h b/chrome/browser/predictors/resource_prefetch_predictor_test_util.h
index c07fc13b8bd2e6cd15b6526177a68913594b9138..6dcbdd3f07509e4188972eb3c8ca4f30ea3f3705 100644
--- a/chrome/browser/predictors/resource_prefetch_predictor_test_util.h
+++ b/chrome/browser/predictors/resource_prefetch_predictor_test_util.h
@@ -18,15 +18,35 @@ ResourceData CreateResourceData(const std::string& resource_url,
bool has_validators,
bool always_revalidate);
+void InitializeRedirectStat(RedirectStat* redirect,
+ const std::string& url,
+ int number_of_hits,
+ int number_of_misses,
+ int consecutive_misses);
+
// For printing failures nicely.
-void PrintTo(const ResourceData& resource, ::std::ostream* os);
void PrintTo(const ResourcePrefetchPredictorTables::PrefetchData& data,
::std::ostream* os);
-bool operator==(const ResourceData& lhs, const ResourceData& rhs);
bool operator==(const ResourcePrefetchPredictorTables::PrefetchData& lhs,
const ResourcePrefetchPredictorTables::PrefetchData& rhs);
} // namespace predictors
+// These functions should be declared in the same namespace as the classes
+// ResourceData, ResourceData_RedirectStat, RedirectData. Otherwise,
+// Google Mock can't find these declarations and unit tests are not compiled.
pasko 2016/09/22 14:27:09 the last part of the sentence is not necessary (st
pasko 2016/09/26 12:28:15 plz do not forget to respond with 'Done' in cases
alexilin 2016/09/26 15:38:28 Done.
+namespace chrome_browser_predictors {
+
+void PrintTo(const ResourceData& resource, ::std::ostream* os);
+void PrintTo(const RedirectData_RedirectStat& redirect, ::std::ostream* os);
+void PrintTo(const RedirectData& data, ::std::ostream* os);
+
+bool operator==(const ResourceData& lhs, const ResourceData& rhs);
+bool operator==(const RedirectData_RedirectStat& lhs,
+ const RedirectData_RedirectStat& rhs);
+bool operator==(const RedirectData& lhs, const RedirectData& rhs);
+
+} // namespace chrome_browser_predictors
+
#endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_TEST_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698