Chromium Code Reviews| 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..8c3fa8d362481ee15c8bc513788a1ba817cd1c16 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); |
|
pasko
2016/07/28 14:04:04
any reason not to define it as double, but do it o
Benoit L
2016/07/28 16:11:53
Done.
|
| +} |
| + |
| TEST_F(ResourcePrefetchPredictorTablesTest, GetAllData) { |
| TestGetAllData(); |
| } |