| 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 77be6baf7553959d5523a412f5a2311f70a310da..6d9b16d1143c0ed0b20319daecea40f463a18ab5 100644
|
| --- a/third_party/WebKit/Source/platform/text/TextEncodingDetectorTest.cpp
|
| +++ b/third_party/WebKit/Source/platform/text/TextEncodingDetectorTest.cpp
|
| @@ -81,11 +81,19 @@ TEST(TextEncodingDetectorTest, LanguageHintHelpsEUCJP) {
|
| EXPECT_EQ(WTF::TextEncoding("GBK"), encoding)
|
| << "Without language hint, it's detected as GBK";
|
|
|
| + KURL url(ParsedURLString, "http://example.com/");
|
| result = detectTextEncoding(eucjpBytes.c_str(), eucjpBytes.length(), nullptr,
|
| - KURL(), "ja", &encoding);
|
| + url, "ja", &encoding);
|
| + EXPECT_TRUE(result);
|
| + EXPECT_EQ(WTF::TextEncoding("GBK"), encoding)
|
| + << "Language hint doesn't help for normal URL. Should be detected as GBK";
|
| +
|
| + KURL fileUrl(ParsedURLString, "file:///text.txt");
|
| + result = detectTextEncoding(eucjpBytes.c_str(), eucjpBytes.length(), nullptr,
|
| + fileUrl, "ja", &encoding);
|
| EXPECT_TRUE(result);
|
| EXPECT_EQ(WTF::TextEncoding("EUC-JP"), encoding)
|
| - << "With language hint 'ja', it's detected as EUC-JP";
|
| + << "Language hint works for file resource. Should be detected as EUC-JP";
|
| }
|
|
|
| TEST(TextEncodingDetectorTest, UTF8DetectionShouldFail) {
|
|
|