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

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

Issue 2539263004: predictors: Take RESOURCE_TYPE_XHR into account. (Closed)
Patch Set: Add test. Created 4 years 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
« no previous file with comments | « chrome/browser/predictors/resource_prefetch_predictor.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/predictors/resource_prefetch_predictor_unittest.cc
diff --git a/chrome/browser/predictors/resource_prefetch_predictor_unittest.cc b/chrome/browser/predictors/resource_prefetch_predictor_unittest.cc
index 4ad1343e9c1b0e528b3ef1cfe42825cff7333e48..bf1e16092a4558a1f713c3a90582ebee9a49289d 100644
--- a/chrome/browser/predictors/resource_prefetch_predictor_unittest.cc
+++ b/chrome/browser/predictors/resource_prefetch_predictor_unittest.cc
@@ -1163,6 +1163,12 @@ TEST_F(ResourcePrefetchPredictorTest, HandledResourceTypes) {
content::RESOURCE_TYPE_PREFETCH, "application/font-woff"));
EXPECT_TRUE(ResourcePrefetchPredictor::IsHandledResourceType(
content::RESOURCE_TYPE_PREFETCH, "font/woff2"));
+ EXPECT_FALSE(ResourcePrefetchPredictor::IsHandledResourceType(
+ content::RESOURCE_TYPE_XHR, ""));
+ EXPECT_FALSE(ResourcePrefetchPredictor::IsHandledResourceType(
+ content::RESOURCE_TYPE_XHR, "bogus/mime-type"));
+ EXPECT_TRUE(ResourcePrefetchPredictor::IsHandledResourceType(
+ content::RESOURCE_TYPE_XHR, "application/javascript"));
}
TEST_F(ResourcePrefetchPredictorTest, ShouldRecordRequestMainFrame) {
« no previous file with comments | « chrome/browser/predictors/resource_prefetch_predictor.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698