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

Unified Diff: content/browser/download/mhtml_generation_browsertest.cc

Issue 2683493002: Get signals working in the EXTRA_DATA section of MHTML (Closed)
Patch Set: FIx tests, add unit test Created 3 years, 9 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
Index: content/browser/download/mhtml_generation_browsertest.cc
diff --git a/content/browser/download/mhtml_generation_browsertest.cc b/content/browser/download/mhtml_generation_browsertest.cc
index 6adf1212067e82662735802eb6ae34847e5b2cad..8d490a1b96e488fabc62b59b0001d024180de832 100644
--- a/content/browser/download/mhtml_generation_browsertest.cc
+++ b/content/browser/download/mhtml_generation_browsertest.cc
@@ -672,4 +672,30 @@ IN_PROC_BROWSER_TEST_F(MHTMLGenerationTest, RemovePopupOverlay) {
EXPECT_THAT(mhtml, Not(HasSubstr("class=3D\"modal")));
}
+IN_PROC_BROWSER_TEST_F(MHTMLGenerationSitePerProcessTest,
+ GenerateMHTMLWithExtraData) {
+ const char kFakeSignalData = "FakeSignalData";
+ base::FilePath path(temp_dir_.GetPath());
+ path = path.Append(FILE_PATH_LITERAL("test.mht"));
+
+ GURL url(embedded_test_server()->GetURL("/page_with_image.html"));
+
+ MHTMLGenerationParams params(path);
+ params.remove_popup_overlay = true;
+ params.extra_data = kFakeSignalData;
+
+ GenerateMHTML(params, url);
+ ASSERT_FALSE(HasFailure());
+
+ std::string mhtml;
+ {
+ base::ThreadRestrictions::ScopedAllowIO allow_io_for_content_verification;
+ ASSERT_TRUE(base::ReadFileToString(path, &mhtml));
+ }
+
+ // Make sure that extra data made it into the mhtml.
+ EXPECT_THAT(mhtml, HasSubstr(kFakeSignalData));
+}
+
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698