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

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

Issue 1158923002: Remove support for the "gcm_user_visible_only" manifest key. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a message Created 5 years, 7 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: 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 01fde51224f7ad8f1355249aecdabe92fcd87386..948d5500aa7cbaf768132063461fbc87e15d21cf 100644
--- a/content/renderer/manifest/manifest_parser_unittest.cc
+++ b/content/renderer/manifest/manifest_parser_unittest.cc
@@ -79,7 +79,6 @@ TEST_F(ManifestParserTest, EmptyStringNull) {
ASSERT_EQ(manifest.display, Manifest::DISPLAY_MODE_UNSPECIFIED);
ASSERT_EQ(manifest.orientation, blink::WebScreenOrientationLockDefault);
ASSERT_TRUE(manifest.gcm_sender_id.is_null());
- ASSERT_FALSE(manifest.gcm_user_visible_only);
}
TEST_F(ManifestParserTest, ValidNoContentParses) {
@@ -96,15 +95,14 @@ TEST_F(ManifestParserTest, ValidNoContentParses) {
ASSERT_EQ(manifest.display, Manifest::DISPLAY_MODE_UNSPECIFIED);
ASSERT_EQ(manifest.orientation, blink::WebScreenOrientationLockDefault);
ASSERT_TRUE(manifest.gcm_sender_id.is_null());
- ASSERT_FALSE(manifest.gcm_user_visible_only);
}
TEST_F(ManifestParserTest, MultipleErrorsReporting) {
Manifest manifest = ParseManifest("{ \"name\": 42, \"short_name\": 4,"
"\"orientation\": {}, \"display\": \"foo\", \"start_url\": null,"
- "\"icons\": {}, \"gcm_user_visible_only\": 42 }");
+ "\"icons\": {} }");
- EXPECT_EQ(7u, GetErrorCount());
+ EXPECT_EQ(6u, GetErrorCount());
EXPECT_EQ("Manifest parsing error: property 'name' ignored,"
" type string expected.",
@@ -123,9 +121,6 @@ TEST_F(ManifestParserTest, MultipleErrorsReporting) {
EXPECT_EQ("Manifest parsing error: property 'icons' ignored, "
"type array expected.",
errors()[5]);
- EXPECT_EQ("Manifest parsing error: property 'gcm_user_visible_only' ignored, "
- "type boolean expected.",
- errors()[6]);
}
TEST_F(ManifestParserTest, NameParseRules) {
@@ -1013,50 +1008,4 @@ TEST_F(ManifestParserTest, GCMSenderIDParseRules) {
}
}
-TEST_F(ManifestParserTest, GCMUserVisibleOnlyParseRules) {
- // Smoke test.
- {
- Manifest manifest = ParseManifest("{ \"gcm_user_visible_only\": true }");
- EXPECT_TRUE(manifest.gcm_user_visible_only);
- EXPECT_EQ(0u, GetErrorCount());
- }
-
- // Don't parse if the property isn't a boolean.
- {
- Manifest manifest = ParseManifest("{ \"gcm_user_visible_only\": {} }");
- EXPECT_FALSE(manifest.gcm_user_visible_only);
- EXPECT_EQ(1u, GetErrorCount());
- EXPECT_EQ(
- "Manifest parsing error: property 'gcm_user_visible_only' ignored,"
- " type boolean expected.",
- errors()[0]);
- }
- {
- Manifest manifest = ParseManifest(
- "{ \"gcm_user_visible_only\": \"true\" }");
- EXPECT_FALSE(manifest.gcm_user_visible_only);
- EXPECT_EQ(1u, GetErrorCount());
- EXPECT_EQ(
- "Manifest parsing error: property 'gcm_user_visible_only' ignored,"
- " type boolean expected.",
- errors()[0]);
- }
- {
- Manifest manifest = ParseManifest("{ \"gcm_user_visible_only\": 1 }");
- EXPECT_FALSE(manifest.gcm_user_visible_only);
- EXPECT_EQ(1u, GetErrorCount());
- EXPECT_EQ(
- "Manifest parsing error: property 'gcm_user_visible_only' ignored,"
- " type boolean expected.",
- errors()[0]);
- }
-
- // "False" should set the boolean false without throwing errors.
- {
- Manifest manifest = ParseManifest("{ \"gcm_user_visible_only\": false }");
- EXPECT_FALSE(manifest.gcm_user_visible_only);
- EXPECT_EQ(0u, GetErrorCount());
- }
-}
-
} // namespace content
« no previous file with comments | « content/renderer/manifest/manifest_parser.cc ('k') | content/renderer/push_messaging/push_messaging_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698