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

Side by Side Diff: third_party/WebKit/Source/web/tests/MHTMLTest.cpp

Issue 2731293004: Move the writing of the MHTML footer to the browser process. (Closed)
Patch Set: Comments and naming changes. 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 // all the examples in the MHTML spec - RFC 2557. 152 // all the examples in the MHTML spec - RFC 2557.
153 String boundary = String::fromUTF8("boundary-example"); 153 String boundary = String::fromUTF8("boundary-example");
154 154
155 RefPtr<RawData> mhtmlData = RawData::create(); 155 RefPtr<RawData> mhtmlData = RawData::create();
156 MHTMLArchive::generateMHTMLHeader(boundary, title, mimeType, 156 MHTMLArchive::generateMHTMLHeader(boundary, title, mimeType,
157 *mhtmlData->mutableData()); 157 *mhtmlData->mutableData());
158 for (const auto& resource : resources) { 158 for (const auto& resource : resources) {
159 MHTMLArchive::generateMHTMLPart(boundary, String(), encodingPolicy, 159 MHTMLArchive::generateMHTMLPart(boundary, String(), encodingPolicy,
160 resource, *mhtmlData->mutableData()); 160 resource, *mhtmlData->mutableData());
161 } 161 }
162 MHTMLArchive::generateMHTMLFooter(boundary, *mhtmlData->mutableData()); 162 MHTMLArchive::generateMHTMLFooterForTesting(boundary,
163 *mhtmlData->mutableData());
163 return mhtmlData.release(); 164 return mhtmlData.release();
164 } 165 }
165 166
166 PassRefPtr<RawData> serialize(const char* title, 167 PassRefPtr<RawData> serialize(const char* title,
167 const char* mime, 168 const char* mime,
168 MHTMLArchive::EncodingPolicy encodingPolicy) { 169 MHTMLArchive::EncodingPolicy encodingPolicy) {
169 return generateMHTMLData(m_resources, encodingPolicy, title, mime); 170 return generateMHTMLData(m_resources, encodingPolicy, title, mime);
170 } 171 }
171 172
172 private: 173 private:
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 // Full sandboxing should be turned on. 279 // Full sandboxing should be turned on.
279 EXPECT_TRUE(document->isSandboxed(SandboxAll)); 280 EXPECT_TRUE(document->isSandboxed(SandboxAll));
280 281
281 // MHTML document should be loaded into unique origin. 282 // MHTML document should be loaded into unique origin.
282 EXPECT_TRUE(document->getSecurityOrigin()->isUnique()); 283 EXPECT_TRUE(document->getSecurityOrigin()->isUnique());
283 // Script execution should be disabled. 284 // Script execution should be disabled.
284 EXPECT_FALSE(document->canExecuteScripts(NotAboutToExecuteScript)); 285 EXPECT_FALSE(document->canExecuteScripts(NotAboutToExecuteScript));
285 } 286 }
286 287
287 } // namespace blink 288 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698