| 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 e677c990d0fd8770f55201b6a4db796af0811aee..9388c210f18ae3c7aea8da4def191110d226d62f 100644
|
| --- a/third_party/WebKit/Source/platform/text/TextEncodingDetectorTest.cpp
|
| +++ b/third_party/WebKit/Source/platform/text/TextEncodingDetectorTest.cpp
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "platform/text/TextEncodingDetector.h"
|
|
|
| +#include "platform/weborigin/KURL.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| #include "wtf/text/TextEncoding.h"
|
|
|
| @@ -59,8 +60,9 @@ TEST(TextEncodingDetectorTest, UrlHintHelpsEUCJP) {
|
| EXPECT_EQ(WTF::TextEncoding("GBK"), encoding)
|
| << "Without language hint, it's detected as GBK";
|
|
|
| + KURL urlJpDomain(ParsedURLString, "http://example.co.jp/");
|
| result = detectTextEncoding(eucjpBytes.c_str(), eucjpBytes.length(), nullptr,
|
| - "http://example.co.jp/", nullptr, &encoding);
|
| + &urlJpDomain, nullptr, &encoding);
|
| EXPECT_TRUE(result);
|
| EXPECT_EQ(WTF::TextEncoding("EUC-JP"), encoding)
|
| << "With URL hint including '.jp', it's detected as EUC-JP";
|
| @@ -101,8 +103,9 @@ TEST(TextEncodingDetectorTest, RespectUTF8DetectionForFileResource) {
|
| "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;
|
| + KURL fileUrl(ParsedURLString, "file:///text.txt");
|
| bool result = detectTextEncoding(utf8Bytes.c_str(), utf8Bytes.length(),
|
| - nullptr, "file:///text", nullptr, &encoding);
|
| + nullptr, &fileUrl, nullptr, &encoding);
|
| EXPECT_TRUE(result);
|
| }
|
|
|
|
|