summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorjaphet@chromium.org <japhet@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-12 19:12:29 +0000
committerjaphet@chromium.org <japhet@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-12 19:12:29 +0000
commitb90b874fe7023537531fbd08df403694e3e3a520 (patch)
tree3b988f12c4e6f933ec94dd0b3aa32a17e7ac2ee8 /webkit
parent034fbbd8fb6271e4193f97bdda129791c0ba6b72 (diff)
downloadchromium_src-b90b874fe7023537531fbd08df403694e3e3a520.zip
chromium_src-b90b874fe7023537531fbd08df403694e3e3a520.tar.gz
chromium_src-b90b874fe7023537531fbd08df403694e3e3a520.tar.bz2
Test that serializing a document with an iframe that was downloaded doesn't cause a renderer crash.
BUG=42212 TEST=DomSerializerTests.SerializeDocumentWithDownloadedIFrame Review URL: http://codereview.chromium.org/1917007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47054 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/data/dom_serializer/dummy.exe0
-rw-r--r--webkit/data/dom_serializer/iframe-src-is-exe.htm8
-rw-r--r--webkit/glue/dom_serializer_unittest.cc14
3 files changed, 22 insertions, 0 deletions
diff --git a/webkit/data/dom_serializer/dummy.exe b/webkit/data/dom_serializer/dummy.exe
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/webkit/data/dom_serializer/dummy.exe
diff --git a/webkit/data/dom_serializer/iframe-src-is-exe.htm b/webkit/data/dom_serializer/iframe-src-is-exe.htm
new file mode 100644
index 0000000..ed32b12
--- /dev/null
+++ b/webkit/data/dom_serializer/iframe-src-is-exe.htm
@@ -0,0 +1,8 @@
+<html>
+<body>
+This tests that we can serialize a page that has a downloaded url in an iframe without crashing.
+
+<iframe src="dummy.exe"></iframe>
+
+</body>
+</html> \ No newline at end of file
diff --git a/webkit/glue/dom_serializer_unittest.cc b/webkit/glue/dom_serializer_unittest.cc
index ce5be4d..a38d82f 100644
--- a/webkit/glue/dom_serializer_unittest.cc
+++ b/webkit/glue/dom_serializer_unittest.cc
@@ -836,4 +836,18 @@ TEST_F(DomSerializerTests, SerializeHTMLDOMWithEmptyHead) {
ASSERT_TRUE(std::string(text_node_contents.utf8()) == "hello world");
}
+// Test that we don't crash when the page contains an iframe that
+// was handled as a download (http://crbug.com/42212).
+TEST_F(DomSerializerTests, SerializeDocumentWithDownloadedIFrame) {
+ FilePath page_file_path = data_dir_;
+ page_file_path = page_file_path.AppendASCII("dom_serializer");
+ page_file_path = page_file_path.AppendASCII("iframe-src-is-exe.htm");
+ GURL file_url = net::FilePathToFileURL(page_file_path);
+ ASSERT_TRUE(file_url.SchemeIsFile());
+ // Load the test file.
+ LoadPageFromURL(file_url);
+ // Do a recursive serialization. We pass if we don't crash.
+ SerializeDomForURL(file_url, true);
+}
+
} // namespace