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

Unified Diff: third_party/WebKit/Source/web/tests/MHTMLTest.cpp

Issue 1436683002: Making PageSerializer operate on single frames only. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mhtml-removing-unused-code
Patch Set: Rebasing... Created 5 years, 1 month 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: third_party/WebKit/Source/web/tests/MHTMLTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/MHTMLTest.cpp b/third_party/WebKit/Source/web/tests/MHTMLTest.cpp
index 0b7c53ea67c26bca7d28a3ce9faf090010d046b8..a7ca20fe2adf7095b07a691f3dbe92ed2d6d8878 100644
--- a/third_party/WebKit/Source/web/tests/MHTMLTest.cpp
+++ b/third_party/WebKit/Source/web/tests/MHTMLTest.cpp
@@ -140,9 +140,26 @@ protected:
addResource("http://www.test.com/ol-dot.png", "image/png", "ol-dot.png");
}
+ static PassRefPtr<SharedBuffer> generateMHTMLData(
+ const Vector<SerializedResource>& resources,
+ MHTMLArchive::EncodingPolicy encodingPolicy,
+ const String& title, const String& mimeType)
+ {
+ String boundary = MHTMLArchive::generateMHTMLBoundary();
+
+ RefPtr<SharedBuffer> mhtmlData = SharedBuffer::create();
+ MHTMLArchive::generateMHTMLHeader(boundary, title, mimeType, *mhtmlData);
+ for (const auto& resource : resources) {
+ MHTMLArchive::generateMHTMLPart(
+ boundary, encodingPolicy, resource, *mhtmlData);
+ }
+ MHTMLArchive::generateMHTMLFooter(boundary, *mhtmlData);
+ return mhtmlData.release();
+ }
+
PassRefPtr<SharedBuffer> serialize(const char *title, const char *mime, MHTMLArchive::EncodingPolicy encodingPolicy)
{
- return MHTMLArchive::generateMHTMLData(m_resources, encodingPolicy, title, mime);
+ return generateMHTMLData(m_resources, encodingPolicy, title, mime);
}
private:
« no previous file with comments | « third_party/WebKit/Source/web/WebPageSerializer.cpp ('k') | third_party/WebKit/Source/web/tests/PageSerializerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698