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

Unified Diff: third_party/WebKit/Source/platform/wtf/text/TextCodecReplacementTest.cpp

Issue 2774333002: Revert "Move files in wtf/ to platform/wtf/" (Closed)
Patch Set: 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/platform/wtf/text/TextCodecReplacementTest.cpp
diff --git a/third_party/WebKit/Source/platform/wtf/text/TextCodecReplacementTest.cpp b/third_party/WebKit/Source/platform/wtf/text/TextCodecReplacementTest.cpp
deleted file mode 100644
index 8a441f95e6b0f8998b56795f890e0c13ca3e2c92..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/platform/wtf/text/TextCodecReplacementTest.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright 2014 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 "platform/wtf/text/TextCodecReplacement.h"
-
-#include "platform/wtf/text/CString.h"
-#include "platform/wtf/text/TextCodec.h"
-#include "platform/wtf/text/TextEncoding.h"
-#include "platform/wtf/text/TextEncodingRegistry.h"
-#include "platform/wtf/text/WTFString.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include <memory>
-
-namespace WTF {
-
-namespace {
-
-// Just one example, others are listed in the codec implementation.
-const char* replacementAlias = "iso-2022-kr";
-
-TEST(TextCodecReplacement, Aliases) {
- // "replacement" is not a valid alias for itself
- EXPECT_FALSE(TextEncoding("replacement").isValid());
- EXPECT_FALSE(TextEncoding("rEpLaCeMeNt").isValid());
-
- EXPECT_TRUE(TextEncoding(replacementAlias).isValid());
- EXPECT_STREQ("replacement", TextEncoding(replacementAlias).name());
-}
-
-TEST(TextCodecReplacement, DecodesToFFFD) {
- TextEncoding encoding(replacementAlias);
- std::unique_ptr<TextCodec> codec(newTextCodec(encoding));
-
- bool sawError = false;
- const char testCase[] = "hello world";
- size_t testCaseSize = sizeof(testCase) - 1;
-
- const String result =
- codec->decode(testCase, testCaseSize, DataEOF, false, sawError);
- EXPECT_TRUE(sawError);
- ASSERT_EQ(1u, result.length());
- EXPECT_EQ(0xFFFDU, result[0]);
-}
-
-TEST(TextCodecReplacement, EncodesToUTF8) {
- TextEncoding encoding(replacementAlias);
- std::unique_ptr<TextCodec> codec(newTextCodec(encoding));
-
- // "Kanji" in Chinese characters.
- const UChar testCase[] = {0x6F22, 0x5B57};
- size_t testCaseSize = WTF_ARRAY_LENGTH(testCase);
- CString result =
- codec->encode(testCase, testCaseSize, QuestionMarksForUnencodables);
-
- EXPECT_STREQ("\xE6\xBC\xA2\xE5\xAD\x97", result.data());
-}
-
-} // namespace
-
-} // namespace WTF

Powered by Google App Engine
This is Rietveld 408576698