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

Side by Side Diff: third_party/WebKit/Source/platform/text/TextEncodingDetectorTest.cpp

Issue 2799683005: Rewrite references to "wtf/" to "platform/wtf/" in platform/text. (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "platform/text/TextEncodingDetector.h" 5 #include "platform/text/TextEncodingDetector.h"
6 6
7 #include "platform/weborigin/KURL.h" 7 #include "platform/weborigin/KURL.h"
8 #include "platform/wtf/text/TextEncoding.h"
8 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
9 #include "wtf/text/TextEncoding.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 TEST(TextEncodingDetectorTest, RespectIso2022Jp) { 13 TEST(TextEncodingDetectorTest, RespectIso2022Jp) {
14 // ISO-2022-JP is the only 7-bit encoding defined in WHATWG standard. 14 // ISO-2022-JP is the only 7-bit encoding defined in WHATWG standard.
15 std::string iso2022jp = 15 std::string iso2022jp =
16 " \x1B" 16 " \x1B"
17 "$BKL3$F;F|K\\%O%`%U%!%$%?!<%:$,%=%U%H%P%s%/$H$N%W%l!<%*%U$r@)$7!\""; 17 "$BKL3$F;F|K\\%O%`%U%!%$%?!<%:$,%=%U%H%P%s%/$H$N%W%l!<%*%U$r@)$7!\"";
18 WTF::TextEncoding encoding; 18 WTF::TextEncoding encoding;
19 bool result = detectTextEncoding(iso2022jp.c_str(), iso2022jp.length(), 19 bool result = detectTextEncoding(iso2022jp.c_str(), iso2022jp.length(),
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 "tnegirjji gosa gii beare s\xC3\xA1htt\xC3\xA1 \xC4\x8D\xC3" 103 "tnegirjji gosa gii beare s\xC3\xA1htt\xC3\xA1 \xC4\x8D\xC3"
104 "\xA1llit artihkkaliid. Maid don s\xC3\xA1ht\xC3\xA1t dievasmah"; 104 "\xA1llit artihkkaliid. Maid don s\xC3\xA1ht\xC3\xA1t dievasmah";
105 WTF::TextEncoding encoding; 105 WTF::TextEncoding encoding;
106 KURL fileUrl(ParsedURLString, "file:///text.txt"); 106 KURL fileUrl(ParsedURLString, "file:///text.txt");
107 bool result = detectTextEncoding(utf8Bytes.c_str(), utf8Bytes.length(), 107 bool result = detectTextEncoding(utf8Bytes.c_str(), utf8Bytes.length(),
108 nullptr, fileUrl, nullptr, &encoding); 108 nullptr, fileUrl, nullptr, &encoding);
109 EXPECT_TRUE(result); 109 EXPECT_TRUE(result);
110 } 110 }
111 111
112 } // namespace blink 112 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/text/TextEncodingDetector.cpp ('k') | third_party/WebKit/Source/platform/text/TextRun.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698