| Index: third_party/WebKit/Source/web/tests/WebFrameSerializerTest.cpp
|
| diff --git a/third_party/WebKit/Source/web/tests/WebFrameSerializerTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameSerializerTest.cpp
|
| index 60d6fa6f9932a389d2fd92cf06b175414fda8fe9..70e9374e6bae9e15b9d91a74705545a3816880cb 100644
|
| --- a/third_party/WebKit/Source/web/tests/WebFrameSerializerTest.cpp
|
| +++ b/third_party/WebKit/Source/web/tests/WebFrameSerializerTest.cpp
|
| @@ -215,4 +215,22 @@ TEST_F(WebFrameSerializerSanitizationTest, RemoveInlineScriptInAttributes) {
|
| EXPECT_NE(std::string::npos, mhtml.find("id="));
|
| }
|
|
|
| +TEST_F(WebFrameSerializerSanitizationTest, RemoveHiddenElements) {
|
| + String mhtml =
|
| + generateMHTMLParts("http://www.test.com", "hidden_elements.html");
|
| +
|
| + // These hidden elements that do not affect layout should be removed.
|
| + EXPECT_EQ(std::string::npos, mhtml.find("<h1"));
|
| + EXPECT_EQ(std::string::npos, mhtml.find("<p id=3D\"hidden_id\""));
|
| + EXPECT_EQ(std::string::npos, mhtml.find("<input type=3D\"hidden\""));
|
| +
|
| + // These hidden elements that affect layout should remain intact.
|
| + EXPECT_NE(std::string::npos, mhtml.find("<h2"));
|
| +
|
| + // These visible elements should remain intact.
|
| + EXPECT_NE(std::string::npos, mhtml.find("<h2"));
|
| + EXPECT_NE(std::string::npos, mhtml.find("<p id=3D\"visible_id\""));
|
| + EXPECT_NE(std::string::npos, mhtml.find("<input type=3D\"text\""));
|
| +}
|
| +
|
| } // namespace blink
|
|
|