| 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 b6be851d4e8433cc73ea62e29003d162839a6956..5cc1100a572538527de7102ff425a2c20446ea48 100644
|
| --- a/chrome/browser/predictors/resource_prefetch_predictor_tables_unittest.cc
|
| +++ b/chrome/browser/predictors/resource_prefetch_predictor_tables_unittest.cc
|
| @@ -430,6 +430,26 @@ void ResourcePrefetchPredictorTablesTest::InitializeSampleData() {
|
|
|
| // Test cases.
|
|
|
| +TEST_F(ResourcePrefetchPredictorTablesTest, ComputeScore) {
|
| + typedef ResourcePrefetchPredictorTables::ResourceRow ResourceRow;
|
| + ResourceRow js_resource(std::string(),
|
| + "http://www.resources.google.com/script.js",
|
| + content::RESOURCE_TYPE_SCRIPT, 11, 0, 0, 1.);
|
| + ResourceRow image_resource(std::string(),
|
| + "http://www.resources.google.com/image.jpg",
|
| + content::RESOURCE_TYPE_IMAGE, 11, 0, 0, 1.);
|
| + ResourceRow css_resource(std::string(),
|
| + "http://www.resources.google.com/stylesheet.css",
|
| + content::RESOURCE_TYPE_STYLESHEET, 11, 0, 0, 1.);
|
| + ResourceRow font_resource(std::string(),
|
| + "http://www.resources.google.com/font.woff",
|
| + content::RESOURCE_TYPE_FONT_RESOURCE, 11, 0, 0, 1.);
|
| + EXPECT_TRUE(js_resource.score == css_resource.score);
|
| + EXPECT_TRUE(js_resource.score == font_resource.score);
|
| + EXPECT_NEAR(199., js_resource.score, 1e-4);
|
| + EXPECT_NEAR(99., image_resource.score, 1e-4);
|
| +}
|
| +
|
| TEST_F(ResourcePrefetchPredictorTablesTest, GetAllData) {
|
| TestGetAllData();
|
| }
|
|
|