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

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

Issue 2357593002: Refactor the resource_prefetch_predictor. (Closed)
Patch Set: rebase 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
new file mode 100644
index 0000000000000000000000000000000000000000..c07fc13b8bd2e6cd15b6526177a68913594b9138
--- /dev/null
+++ b/chrome/browser/predictors/resource_prefetch_predictor_test_util.h
@@ -0,0 +1,32 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+#ifndef CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_TEST_UTIL_H_
+#define CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_TEST_UTIL_H_
+
+#include "chrome/browser/predictors/resource_prefetch_predictor_tables.h"
+
+namespace predictors {
+
+ResourceData CreateResourceData(const std::string& resource_url,
+ content::ResourceType resource_type,
+ int number_of_hits,
+ int number_of_misses,
+ int consecutive_misses,
+ double average_position,
+ net::RequestPriority priority,
+ bool has_validators,
+ bool always_revalidate);
+
+// 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
+
+#endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_TEST_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698