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

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

Issue 1424503006: Page Serializer: Specify encoding for serialized CSS files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@nfc-css
Patch Set: Review feedback Created 5 years, 1 month 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
« no previous file with comments | « third_party/WebKit/Source/core/page/PageSerializer.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/tests/PageSerializerTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/PageSerializerTest.cpp b/third_party/WebKit/Source/web/tests/PageSerializerTest.cpp
index 9f4b5e0efabeefb5d2d94081e9e1cda51cc82039..6cbf3fdc036e473793546b9d18599a1bafebf62c 100644
--- a/third_party/WebKit/Source/web/tests/PageSerializerTest.cpp
+++ b/third_party/WebKit/Source/web/tests/PageSerializerTest.cpp
@@ -347,6 +347,12 @@ TEST_F(PageSerializerTest, CSS)
EXPECT_TRUE(isSerialized("ul-dot.png", "image/png"));
EXPECT_TRUE(isSerialized("ol-dot.png", "image/png"));
+ // Ensure encodings are specified.
+ EXPECT_TRUE(getSerializedData("link_styles.css", "text/css").startsWith("@charset"));
+ EXPECT_TRUE(getSerializedData("import_styles.css", "text/css").startsWith("@charset"));
+ EXPECT_TRUE(getSerializedData("import_style_from_link.css", "text/css").startsWith("@charset"));
+ EXPECT_TRUE(getSerializedData("encoding.css", "text/css").startsWith("@charset \"euc-kr\";"));
+
// Ensure that stylesheet contents are not NFC-normalized before encoding.
EXPECT_TRUE(getSerializedData("encoding.css", "text/css").contains("\xE4\xC5\xD1\xE2"));
EXPECT_FALSE(getSerializedData("encoding.css", "text/css").contains("\xE4\xC5\xE4\xC5"));
« no previous file with comments | « third_party/WebKit/Source/core/page/PageSerializer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698