| 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
|
|
|