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

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

Issue 2940933003: DO NOT SUBMIT results of new clang-format (Closed)
Patch Set: Created 3 years, 6 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/wtf/text/TextCodecUserDefined.h" 5 #include "platform/wtf/text/TextCodecUserDefined.h"
6 6
7 #include <memory>
7 #include "platform/wtf/text/CString.h" 8 #include "platform/wtf/text/CString.h"
8 #include "platform/wtf/text/TextCodec.h" 9 #include "platform/wtf/text/TextCodec.h"
9 #include "platform/wtf/text/TextEncoding.h" 10 #include "platform/wtf/text/TextEncoding.h"
10 #include "platform/wtf/text/TextEncodingRegistry.h" 11 #include "platform/wtf/text/TextEncodingRegistry.h"
11 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
12 #include <memory>
13 13
14 TEST(TextCodecUserDefinedTest, QuestionMarksAndSurrogates) { 14 TEST(TextCodecUserDefinedTest, QuestionMarksAndSurrogates) {
15 WTF::TextEncoding encoding("x-user-defined"); 15 WTF::TextEncoding encoding("x-user-defined");
16 std::unique_ptr<WTF::TextCodec> codec(NewTextCodec(encoding)); 16 std::unique_ptr<WTF::TextCodec> codec(NewTextCodec(encoding));
17 17
18 { 18 {
19 const LChar testCase[] = {0xd1, 0x16, 0x86}; 19 const LChar testCase[] = {0xd1, 0x16, 0x86};
20 size_t testCaseSize = WTF_ARRAY_LENGTH(testCase); 20 size_t testCaseSize = WTF_ARRAY_LENGTH(testCase);
21 CString result = codec->Encode(testCase, testCaseSize, 21 CString result = codec->Encode(testCase, testCaseSize,
22 WTF::kQuestionMarksForUnencodables); 22 WTF::kQuestionMarksForUnencodables);
(...skipping 14 matching lines...) Expand all
37 EXPECT_STREQ("??", result.data()); 37 EXPECT_STREQ("??", result.data());
38 } 38 }
39 { 39 {
40 const UChar testCase[] = {0x0041, 0xd9f0, 0xdcd9, 0xf7c1, 0xd9f0, 0xdcd9}; 40 const UChar testCase[] = {0x0041, 0xd9f0, 0xdcd9, 0xf7c1, 0xd9f0, 0xdcd9};
41 size_t testCaseSize = WTF_ARRAY_LENGTH(testCase); 41 size_t testCaseSize = WTF_ARRAY_LENGTH(testCase);
42 CString result = codec->Encode(testCase, testCaseSize, 42 CString result = codec->Encode(testCase, testCaseSize,
43 WTF::kQuestionMarksForUnencodables); 43 WTF::kQuestionMarksForUnencodables);
44 EXPECT_STREQ("A?\xC1?", result.data()); 44 EXPECT_STREQ("A?\xC1?", result.data());
45 } 45 }
46 } 46 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698