Chromium Code Reviews| 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 494f0713505ffc3e915dcbb684d4756014b7332f..c1790132c7378e375b8d4e80719ee5767c23d595 100644 |
| --- a/third_party/WebKit/Source/web/tests/MHTMLTest.cpp |
| +++ b/third_party/WebKit/Source/web/tests/MHTMLTest.cpp |
| @@ -35,6 +35,7 @@ |
| #include "platform/SerializedResource.h" |
| #include "platform/SharedBuffer.h" |
| #include "platform/mhtml/MHTMLArchive.h" |
| +#include "platform/mhtml/MHTMLParser.h" |
| #include "platform/testing/URLTestHelpers.h" |
| #include "platform/testing/UnitTestHelpers.h" |
| #include "platform/weborigin/KURL.h" |
| @@ -207,6 +208,10 @@ TEST_F(MHTMLTest, TestMHTMLEncoding) { |
| RefPtr<RawData> data = Serialize("Test Serialization", "text/html", |
| MHTMLArchive::kUseDefaultEncoding); |
| + // Validate the generated MHTML. |
| + MHTMLParser parser(SharedBuffer::Create(data->data(), data->length())); |
| + ASSERT_FALSE(parser.ParseArchive().IsEmpty()) << "Invalid MHTML"; |
|
Łukasz Anforowicz
2017/04/25 19:01:24
Would it be possible to increase the coverage of t
carlosk
2017/04/25 19:49:30
Done.
|
| + |
| // Read the MHTML data line per line and do some pseudo-parsing to make sure |
| // the right encoding is used for the different sections. |
| LineReader line_reader(std::string(data->data(), data->length())); |