Index: third_party/WebKit/Source/web/tests/WebPageSerializerTest.cpp |
diff --git a/third_party/WebKit/Source/web/tests/WebPageSerializerTest.cpp b/third_party/WebKit/Source/web/tests/WebPageSerializerTest.cpp |
index 0c2821a8cfcdc0d54a4725388dc3fdaef386d99d..afc35c70e12af2d68fb2a723defbb3db9176c244 100644 |
--- a/third_party/WebKit/Source/web/tests/WebPageSerializerTest.cpp |
+++ b/third_party/WebKit/Source/web/tests/WebPageSerializerTest.cpp |
@@ -151,6 +151,27 @@ TEST_F(WebPageSerializerTest, HTMLNodes) |
EXPECT_TRUE(webVectorContains(resources, "file://c/my_folder/file.gif")); |
} |
+TEST_F(WebPageSerializerTest, URLAttributeValues) |
+{ |
+ WebURL topFrameURL = toKURL("http://www.test.com"); |
+ registerMockedURLLoad(topFrameURL.spec(), WebString::fromUTF8("url_attribute_values.html")); |
+ loadURLInTopFrame(topFrameURL); |
+ |
+ SimpleWebPageSerializerClient serializerClient; |
+ WebVector<WebURL> links(&topFrameURL, 1); |
+ WebVector<WebString> localPaths(&"local", 1); |
+ WebPageSerializer::serialize(webView()->mainFrame()->toWebLocalFrame(), &serializerClient, links, localPaths, ""); |
+ |
+ const char* expectedHTML = |
+ "\n<!-- saved from url=(0020)http://www.test.com/ -->\n" |
+ "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf8\">\n" |
+ "</head><body><img src=\"javascript:"\">\n" |
+ "<a href=\"http://www.test.com/local#"\">local</a>\n" |
+ "<a href=\"http://www.example.com/#"><script>alert(0)</script>\">external</a>\n" |
+ "</body></html>"; |
+ EXPECT_EQ(expectedHTML, serializerClient.toString()); |
+} |
+ |
TEST_F(WebPageSerializerTest, fromUrlWithMinusMinus) |
{ |
WebURL topFrameURL = toKURL("http://www.test.com?--x--"); |