OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "wtf/text/TextCodecReplacement.h" | 5 #include "wtf/text/TextCodecReplacement.h" |
6 | 6 |
| 7 #include <memory> |
7 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
8 #include "wtf/text/CString.h" | 9 #include "wtf/text/CString.h" |
9 #include "wtf/text/TextCodec.h" | 10 #include "wtf/text/TextCodec.h" |
10 #include "wtf/text/TextEncoding.h" | 11 #include "wtf/text/TextEncoding.h" |
11 #include "wtf/text/TextEncodingRegistry.h" | 12 #include "wtf/text/TextEncodingRegistry.h" |
12 #include "wtf/text/WTFString.h" | 13 #include "wtf/text/WTFString.h" |
13 #include <memory> | |
14 | 14 |
15 namespace WTF { | 15 namespace WTF { |
16 | 16 |
17 namespace { | 17 namespace { |
18 | 18 |
19 // Just one example, others are listed in the codec implementation. | 19 // Just one example, others are listed in the codec implementation. |
20 const char* replacementAlias = "iso-2022-kr"; | 20 const char* replacementAlias = "iso-2022-kr"; |
21 | 21 |
22 TEST(TextCodecReplacement, Aliases) { | 22 TEST(TextCodecReplacement, Aliases) { |
23 // "replacement" is not a valid alias for itself | 23 // "replacement" is not a valid alias for itself |
(...skipping 28 matching lines...) Expand all Loading... |
52 size_t testCaseSize = WTF_ARRAY_LENGTH(testCase); | 52 size_t testCaseSize = WTF_ARRAY_LENGTH(testCase); |
53 CString result = | 53 CString result = |
54 codec->encode(testCase, testCaseSize, QuestionMarksForUnencodables); | 54 codec->encode(testCase, testCaseSize, QuestionMarksForUnencodables); |
55 | 55 |
56 EXPECT_STREQ("\xE6\xBC\xA2\xE5\xAD\x97", result.data()); | 56 EXPECT_STREQ("\xE6\xBC\xA2\xE5\xAD\x97", result.data()); |
57 } | 57 } |
58 | 58 |
59 } // namespace | 59 } // namespace |
60 | 60 |
61 } // namespace WTF | 61 } // namespace WTF |
OLD | NEW |