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

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

Issue 580513002: Add support for gcm_sender_id in Manifest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@manifest_start_url
Patch Set: Created 6 years, 3 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 32730f760ba9da402408f5f11212a41a7eb6df84..72127560a3e0fbee7c1e8098f8abaa05e3aab5b6 100644
--- a/content/renderer/manifest/manifest_parser_unittest.cc
+++ b/content/renderer/manifest/manifest_parser_unittest.cc
@@ -580,4 +580,28 @@ TEST_F(ManifestParserTest, IconSizesParseRules) {
}
}
+TEST_F(ManifestParserTest, GCMSenderIDParseRules) {
+ // Smoke test.
+ {
+ Manifest manifest = ParseManifest("{ \"gcm_sender_id\": \"foo\" }");
+ EXPECT_TRUE(EqualsASCII(manifest.gcm_sender_id.string(), "foo"));
+ }
+
+ // Trim whitespaces.
+ {
+ Manifest manifest = ParseManifest("{ \"gcm_sender_id\": \" foo \" }");
+ EXPECT_TRUE(EqualsASCII(manifest.gcm_sender_id.string(), "foo"));
+ }
+
+ // Don't parse if property isn't a string.
+ {
+ Manifest manifest = ParseManifest("{ \"gcm_sender_id\": {} }");
+ EXPECT_TRUE(manifest.gcm_sender_id.is_null());
+ }
+ {
+ Manifest manifest = ParseManifest("{ \"gcm_sender_id\": 42 }");
+ EXPECT_TRUE(manifest.gcm_sender_id.is_null());
+ }
+}
+
} // namespace content
« 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