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

Unified Diff: content/renderer/manifest/manifest_parser_unittest.cc

Issue 1901363003: Remove support for the web manifest icon density member. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename test Created 4 years, 8 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
« no previous file with comments | « content/renderer/manifest/manifest_parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/manifest/manifest_parser_unittest.cc
diff --git a/content/renderer/manifest/manifest_parser_unittest.cc b/content/renderer/manifest/manifest_parser_unittest.cc
index 9a8569d14b243805339a68291c412ee07f76546b..47ae44d145415d3aa467b5b3b7f72a3f4504f6ac 100644
--- a/content/renderer/manifest/manifest_parser_unittest.cc
+++ b/content/renderer/manifest/manifest_parser_unittest.cc
@@ -631,84 +631,6 @@ TEST_F(ManifestParserTest, IconTypeParseRules) {
}
}
-TEST_F(ManifestParserTest, IconDensityParseRules) {
- // Smoke test.
- {
- Manifest manifest =
- ParseManifest("{ \"icons\": [ {\"src\": \"\", \"density\": 42 } ] }");
- EXPECT_EQ(manifest.icons[0].density, 42);
- EXPECT_EQ(0u, GetErrorCount());
- }
-
- // Decimal value.
- {
- Manifest manifest =
- ParseManifest("{ \"icons\": [ {\"src\": \"\", \"density\": 2.5 } ] }");
- EXPECT_EQ(manifest.icons[0].density, 2.5);
- EXPECT_EQ(0u, GetErrorCount());
- }
-
- // Parse fail if it isn't a float.
- {
- Manifest manifest =
- ParseManifest("{ \"icons\": [ {\"src\": \"\", \"density\": {} } ] }");
- EXPECT_EQ(manifest.icons[0].density, Manifest::Icon::kDefaultDensity);
- EXPECT_EQ(1u, GetErrorCount());
- EXPECT_EQ("Manifest parsing error: icon 'density' ignored, "
- "must be float greater than 0.",
- errors()[0]);
- }
-
- // Parse fail if it isn't a float.
- {
- Manifest manifest =
- ParseManifest("{ \"icons\": [ {\"src\": \"\", \"density\":\"2\" } ] }");
- EXPECT_EQ(manifest.icons[0].density, Manifest::Icon::kDefaultDensity);
- EXPECT_EQ(1u, GetErrorCount());
- EXPECT_EQ("Manifest parsing error: icon 'density' ignored, "
- "must be float greater than 0.",
- errors()[0]);
- }
-
- // Edge case: 1.0.
- {
- Manifest manifest =
- ParseManifest("{ \"icons\": [ {\"src\": \"\", \"density\": 1.00 } ] }");
- EXPECT_EQ(manifest.icons[0].density, 1);
- EXPECT_EQ(0u, GetErrorCount());
- }
-
- // Edge case: values between 0.0 and 1.0 are allowed.
- {
- Manifest manifest =
- ParseManifest("{ \"icons\": [ {\"src\": \"\", \"density\": 0.42 } ] }");
- EXPECT_EQ(manifest.icons[0].density, 0.42);
- EXPECT_EQ(0u, GetErrorCount());
- }
-
- // 0 is an invalid value.
- {
- Manifest manifest =
- ParseManifest("{ \"icons\": [ {\"src\": \"\", \"density\": 0.0 } ] }");
- EXPECT_EQ(manifest.icons[0].density, Manifest::Icon::kDefaultDensity);
- EXPECT_EQ(1u, GetErrorCount());
- EXPECT_EQ("Manifest parsing error: icon 'density' ignored, "
- "must be float greater than 0.",
- errors()[0]);
- }
-
- // Negative values are invalid.
- {
- Manifest manifest =
- ParseManifest("{ \"icons\": [ {\"src\": \"\", \"density\": -2.5 } ] }");
- EXPECT_EQ(manifest.icons[0].density, Manifest::Icon::kDefaultDensity);
- EXPECT_EQ(1u, GetErrorCount());
- EXPECT_EQ("Manifest parsing error: icon 'density' ignored, "
- "must be float greater than 0.",
- errors()[0]);
- }
-}
-
TEST_F(ManifestParserTest, IconSizesParseRules) {
// Smoke test.
{
« no previous file with comments | « content/renderer/manifest/manifest_parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698