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

Unified Diff: chrome/browser/predictors/resource_prefetch_predictor_tables_unittest.cc

Issue 2263243002: predictors: Store protobufs in the database. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests. 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_tables_unittest.cc
diff --git a/chrome/browser/predictors/resource_prefetch_predictor_tables_unittest.cc b/chrome/browser/predictors/resource_prefetch_predictor_tables_unittest.cc
index ed74da914ef17d0395d3042bd4d2938dd81b41e6..7e19b38216a445aacbfd1eaa1597c1dbe6d2ec2d 100644
--- a/chrome/browser/predictors/resource_prefetch_predictor_tables_unittest.cc
+++ b/chrome/browser/predictors/resource_prefetch_predictor_tables_unittest.cc
@@ -57,19 +57,20 @@ class ResourcePrefetchPredictorTablesTest : public testing::Test {
void AddKey(PrefetchDataMap* m, const std::string& key) const;
- // Useful for debugging test.
+ static void LogResource(const ResourceRow& row) {
+ LOG(ERROR) << "\t\t" << row.resource_url << "\t" << row.resource_type
+ << "\t" << row.number_of_hits << "\t" << row.number_of_misses
+ << "\t" << row.consecutive_misses << "\t" << row.average_position
+ << "\t" << row.priority << "\t" << row.has_validators << "\t"
+ << row.always_revalidate << "\t" << row.score;
+ }
+
+ // Useful for debugging tests.
void PrintPrefetchData(const PrefetchData& data) const {
LOG(ERROR) << "[" << data.key_type << "," << data.primary_key
<< "," << data.last_visit.ToInternalValue() << "]";
- for (ResourceRows::const_iterator it = data.resources.begin();
- it != data.resources.end(); ++it) {
- LOG(ERROR) << "\t\t" << it->resource_url << "\t" << it->resource_type
- << "\t" << it->number_of_hits << "\t" << it->number_of_misses
- << "\t" << it->consecutive_misses << "\t"
- << it->average_position << "\t" << it->priority << "\t"
- << it->has_validators << "\t" << it->always_revalidate << "\t"
- << it->score;
- }
+ for (const ResourceRow& resource : data.resources)
+ LogResource(resource);
}
PrefetchDataMap test_url_data_;

Powered by Google App Engine
This is Rietveld 408576698