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

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

Issue 803063003: Fix crash when passing temporary variable as document/manifest URL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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.h ('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 fd47fe211c833a30b53f0328828b30d9d44e1af7..362177eb0511119d4c3efd1fc8ea92dcce9f4254 100644
--- a/content/renderer/manifest/manifest_parser_unittest.cc
+++ b/content/renderer/manifest/manifest_parser_unittest.cc
@@ -51,6 +51,18 @@ const GURL ManifestParserTest::default_document_url(
const GURL ManifestParserTest::default_manifest_url(
"http://foo.com/manifest.json");
+TEST_F(ManifestParserTest, CrashTest) {
+ // Passing temporary variables should not crash.
+ ManifestParser parser("{\"start_url\": \"/\"}",
+ GURL("http://example.com"),
+ GURL("http://example.com"));
+ parser.Parse();
+
+ // .Parse() should have been call without crashing and succeeded.
+ EXPECT_EQ(0u, parser.errors().size());
+ EXPECT_FALSE(parser.manifest().IsEmpty());
+}
+
TEST_F(ManifestParserTest, EmptyStringNull) {
Manifest manifest = ParseManifest("");
« no previous file with comments | « content/renderer/manifest/manifest_parser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698