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

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

Issue 2268283005: predictors: Refactor the resource_prefetch_predictor database handling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 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..ee3dac1534385a4eb2cee7ce065c0b8cdc9dbe26
--- /dev/null
+++ b/chrome/browser/predictors/resource_prefetch_predictor_test_util.h
@@ -0,0 +1,41 @@
+// 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.pb.h"
+#include "chrome/browser/predictors/resource_prefetch_predictor_tables.h"
+#include "content/public/common/resource_type.h"
+#include "net/base/request_priority.h"
+
+class ostream;
+
+namespace predictors {
+
+::chrome_browser_predictors::ResourceData MakeResourceData(
+ 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 ::chrome_browser_predictors::ResourceData& resource,
+ ::std::ostream* os);
+void PrintTo(const ResourcePrefetchPredictorTables::PrefetchData& data,
+ ::std::ostream* os);
+
+bool operator==(const ::chrome_browser_predictors::ResourceData& lhs,
+ const ::chrome_browser_predictors::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