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

Unified Diff: third_party/WebKit/Source/wtf/text/TextCodecICUTest.cpp

Issue 2771783003: Move wtf_unittests to platform/wtf/. (Closed)
Patch Set: Rebase. Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/wtf/text/TextCodecICUTest.cpp
diff --git a/third_party/WebKit/Source/wtf/text/TextCodecICUTest.cpp b/third_party/WebKit/Source/wtf/text/TextCodecICUTest.cpp
deleted file mode 100644
index c1aef9319641e4d726a15df57b237e1f10d102fe..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/wtf/text/TextCodecICUTest.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "wtf/text/TextCodecICU.h"
-
-#include "testing/gtest/include/gtest/gtest.h"
-#include "wtf/Vector.h"
-#include "wtf/text/CharacterNames.h"
-
-namespace WTF {
-
-TEST(TextCodecICUTest, IgnorableCodePoint) {
- TextEncoding iso2022jp("iso-2022-jp");
- std::unique_ptr<TextCodec> codec = TextCodecICU::create(iso2022jp, nullptr);
- Vector<UChar> source;
- source.push_back('a');
- source.push_back(zeroWidthJoinerCharacter);
- CString encoded =
- codec->encode(source.data(), source.size(), EntitiesForUnencodables);
- EXPECT_STREQ("a&#8205;", encoded.data());
-}
-
-TEST(TextCodecICUTest, UTF32AndQuestionMarks) {
- Vector<String> aliases;
- Vector<CString> results;
-
- const UChar poo[] = {0xd83d, 0xdca9}; // U+1F4A9 PILE OF POO
-
- aliases.push_back("UTF-32");
- results.push_back("\xFF\xFE\x00\x00\xA9\xF4\x01\x00");
-
- aliases.push_back("UTF-32LE");
- results.push_back("\xA9\xF4\x01\x00");
-
- aliases.push_back("UTF-32BE");
- results.push_back("\x00\x01\xF4\xA9");
-
- ASSERT_EQ(aliases.size(), results.size());
- for (unsigned i = 0; i < aliases.size(); ++i) {
- const String& alias = aliases[i];
- const CString& expected = results[i];
-
- TextEncoding encoding(alias);
- std::unique_ptr<TextCodec> codec = TextCodecICU::create(encoding, nullptr);
- {
- const UChar* data = nullptr;
- CString encoded = codec->encode(data, 0, QuestionMarksForUnencodables);
- EXPECT_STREQ("", encoded.data());
- }
- {
- CString encoded = codec->encode(poo, WTF_ARRAY_LENGTH(poo),
- QuestionMarksForUnencodables);
- EXPECT_STREQ(expected.data(), encoded.data());
- }
- }
-}
-}
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringViewTest.cpp ('k') | third_party/WebKit/Source/wtf/text/TextCodecLatin1Test.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698