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

Unified Diff: third_party/WebKit/Source/web/tests/WebFrameSerializerTest.cpp

Issue 1541463002: Rename [Web]PageSerializer[Test|Client|Impl] to ...FrameSerializer... (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mhtml-deduplication-of-resources
Patch Set: Rebasing... Created 5 years 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 side-by-side diff with in-line comments
Download patch
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));
« no previous file with comments | « third_party/WebKit/Source/web/tests/PageSerializerTest.cpp ('k') | third_party/WebKit/Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698