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

Unified Diff: third_party/WebKit/Source/platform/text/TextEncodingDetectorTest.cpp

Issue 2784483003: Respect UTF-8 detection result for local file resources (Closed)
Patch Set: Created 3 years, 9 months 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/platform/text/TextEncodingDetectorTest.cpp
diff --git a/third_party/WebKit/Source/platform/text/TextEncodingDetectorTest.cpp b/third_party/WebKit/Source/platform/text/TextEncodingDetectorTest.cpp
index 598dbf3cfcbf924ef9f3d9e6eb97c1ae8cd05b60..e677c990d0fd8770f55201b6a4db796af0811aee 100644
--- a/third_party/WebKit/Source/platform/text/TextEncodingDetectorTest.cpp
+++ b/third_party/WebKit/Source/platform/text/TextEncodingDetectorTest.cpp
@@ -96,4 +96,14 @@ TEST(TextEncodingDetectorTest, UTF8DetectionShouldFail) {
EXPECT_FALSE(result);
}
+TEST(TextEncodingDetectorTest, RespectUTF8DetectionForFileResource) {
+ std::string utf8Bytes =
+ "tnegirjji gosa gii beare s\xC3\xA1htt\xC3\xA1 \xC4\x8D\xC3"
+ "\xA1llit artihkkaliid. Maid don s\xC3\xA1ht\xC3\xA1t dievasmah";
+ WTF::TextEncoding encoding;
+ bool result = detectTextEncoding(utf8Bytes.c_str(), utf8Bytes.length(),
+ nullptr, "file:///text", nullptr, &encoding);
+ EXPECT_TRUE(result);
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698