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

Unified Diff: chrome/browser/download/save_page_browsertest.cc

Issue 1371533002: Remove "recursive" parameter from WebPageSerializer::serialize. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@page-serialization-complete-serialization
Patch Set: Rebasing... Created 5 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 | « no previous file | chrome/test/data/downloads/iframe-src-is-a-download.htm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/save_page_browsertest.cc
diff --git a/chrome/browser/download/save_page_browsertest.cc b/chrome/browser/download/save_page_browsertest.cc
index 5f9c24c25501016ad7d766ad32f6d870406e54ff..b331969e10f96cfaae4a08b1f9b8b1fcea5cebb6 100644
--- a/chrome/browser/download/save_page_browsertest.cc
+++ b/chrome/browser/download/save_page_browsertest.cc
@@ -776,6 +776,27 @@ IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, SavePageBrowserTest_NonMHTML) {
EXPECT_EQ("foo", contents);
}
+// Test that we don't crash when the page contains an iframe that
+// was handled as a download (http://crbug.com/42212).
+IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, SaveDownloadableIFrame) {
+ GURL url = URLRequestMockHTTPJob::GetMockUrl(
+ base::FilePath(FILE_PATH_LITERAL("downloads"))
+ .AppendASCII("iframe-src-is-a-download.htm"));
+ ui_test_utils::NavigateToURL(browser(), url);
+
+ // Wait for and then dismiss the non-save-page-as-related download item
+ // (the one associated with downloading of "thisdayinhistory.xls" file).
+ VerifySavePackageExpectations(browser(), url);
+ GetDownloadManager()->RemoveAllDownloads();
+
+ base::FilePath full_file_name, dir;
+ SaveCurrentTab(url, content::SAVE_PAGE_TYPE_AS_COMPLETE_HTML,
+ "iframe-src-is-a-download", 2, &dir, &full_file_name);
+ ASSERT_FALSE(HasFailure());
+
+ EXPECT_TRUE(base::PathExists(full_file_name));
+}
+
class SavePageSitePerProcessBrowserTest : public SavePageBrowserTest {
public:
SavePageSitePerProcessBrowserTest() {}
« no previous file with comments | « no previous file | chrome/test/data/downloads/iframe-src-is-a-download.htm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698