Index: third_party/WebKit/Source/web/tests/WebFrameSerializerTest.cpp |
diff --git a/third_party/WebKit/Source/web/tests/WebPageSerializerTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameSerializerTest.cpp |
similarity index 83% |
rename from third_party/WebKit/Source/web/tests/WebPageSerializerTest.cpp |
rename to third_party/WebKit/Source/web/tests/WebFrameSerializerTest.cpp |
index 1c851d68415742e1ce337e3f95be6444e48f175a..26838a2409652aae3c9b409af7265597fd7f0346 100644 |
--- a/third_party/WebKit/Source/web/tests/WebPageSerializerTest.cpp |
+++ b/third_party/WebKit/Source/web/tests/WebFrameSerializerTest.cpp |
@@ -28,7 +28,7 @@ |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#include "public/web/WebPageSerializer.h" |
+#include "public/web/WebFrameSerializer.h" |
#include "platform/testing/URLTestHelpers.h" |
#include "platform/weborigin/KURL.h" |
@@ -36,7 +36,7 @@ |
#include "public/platform/WebString.h" |
#include "public/platform/WebURL.h" |
#include "public/platform/WebUnitTestSupport.h" |
-#include "public/web/WebPageSerializerClient.h" |
+#include "public/web/WebFrameSerializerClient.h" |
#include "testing/gtest/include/gtest/gtest.h" |
#include "web/WebLocalFrameImpl.h" |
#include "web/WebViewImpl.h" |
@@ -46,12 +46,12 @@ |
namespace blink { |
namespace { |
-class SimpleWebPageSerializerClient final : public WebPageSerializerClient { |
+class SimpleWebFrameSerializerClient final : public WebFrameSerializerClient { |
public: |
String toString() { return m_builder.toString(); } |
private: |
- void didSerializeDataForFrame(const WebCString& data, PageSerializationStatus) final |
+ void didSerializeDataForFrame(const WebCString& data, FrameSerializationStatus) final |
{ |
m_builder.append(data.data(), data.length()); |
} |
@@ -61,14 +61,14 @@ private: |
} // namespace |
-class WebPageSerializerTest : public testing::Test { |
+class WebFrameSerializerTest : public testing::Test { |
protected: |
- WebPageSerializerTest() |
+ WebFrameSerializerTest() |
{ |
m_helper.initialize(); |
} |
- ~WebPageSerializerTest() override |
+ ~WebFrameSerializerTest() override |
{ |
Platform::current()->unitTestSupport()->unregisterAllMockedURLs(); |
} |
@@ -76,18 +76,18 @@ protected: |
void registerMockedImageURL(const String& url) |
{ |
// Image resources need to be mocked, but irrelevant here what image they map to. |
- URLTestHelpers::registerMockedURLLoad(KURL(ParsedURLString, url), "pageserialization/awesome.png"); |
+ URLTestHelpers::registerMockedURLLoad(KURL(ParsedURLString, url), "frameserialization/awesome.png"); |
} |
String serializeFile(const String& url, const String& fileName) |
{ |
KURL parsedURL(ParsedURLString, url); |
- URLTestHelpers::registerMockedURLLoad(parsedURL, fileName, "pageserialization/", "text/html"); |
+ URLTestHelpers::registerMockedURLLoad(parsedURL, fileName, "frameserialization/", "text/html"); |
FrameTestHelpers::loadFrame(mainFrameImpl(), url.utf8().data()); |
std::vector<std::pair<WebURL, WebString>> urlsToLocalPaths; |
urlsToLocalPaths.push_back(std::make_pair(parsedURL, WebString("local"))); |
- SimpleWebPageSerializerClient serializerClient; |
- WebPageSerializer::serialize(mainFrameImpl(), &serializerClient, urlsToLocalPaths); |
+ SimpleWebFrameSerializerClient serializerClient; |
+ WebFrameSerializer::serialize(mainFrameImpl(), &serializerClient, urlsToLocalPaths); |
return serializerClient.toString(); |
} |
@@ -100,7 +100,7 @@ private: |
FrameTestHelpers::WebViewHelper m_helper; |
}; |
-TEST_F(WebPageSerializerTest, URLAttributeValues) |
+TEST_F(WebFrameSerializerTest, URLAttributeValues) |
{ |
registerMockedImageURL("javascript:\""); |
@@ -115,13 +115,13 @@ TEST_F(WebPageSerializerTest, URLAttributeValues) |
EXPECT_EQ(expectedHTML, actualHTML); |
} |
-TEST_F(WebPageSerializerTest, EncodingAndNormalization) |
+TEST_F(WebFrameSerializerTest, EncodingAndNormalization) |
{ |
const char* expectedHTML = |
"<!DOCTYPE html>\n" |
"<!-- saved from url=(0020)http://www.test.com/ -->\n" |
"<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=EUC-KR\">\n" |
- "<title>Ensure NFC normalization is not performed by page serializer</title>\n" |
+ "<title>Ensure NFC normalization is not performed by frame serializer</title>\n" |
"</head><body>\n" |
"\xe4\xc5\xd1\xe2\n" |
"\n</body></html>"; |
@@ -129,7 +129,7 @@ TEST_F(WebPageSerializerTest, EncodingAndNormalization) |
EXPECT_EQ(expectedHTML, actualHTML); |
} |
-TEST_F(WebPageSerializerTest, FromUrlWithMinusMinus) |
+TEST_F(WebFrameSerializerTest, FromUrlWithMinusMinus) |
{ |
String actualHTML = serializeFile("http://www.test.com?--x--", "text_only_page.html"); |
EXPECT_EQ("<!-- saved from url=(0030)http://www.test.com/?-%2Dx-%2D -->", actualHTML.substring(1, 60)); |