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

Unified Diff: chromeos/ime/composition_text_unittest.cc

Issue 727143002: Moves code from chromeos/ime to ui/base/ime/chromeos. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit. Created 6 years, 1 month 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
« no previous file with comments | « chromeos/ime/composition_text.cc ('k') | chromeos/ime/extension_ime_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/ime/composition_text_unittest.cc
diff --git a/chromeos/ime/composition_text_unittest.cc b/chromeos/ime/composition_text_unittest.cc
deleted file mode 100644
index 68f034291911afb9417d2270b0a55d0aa0fcf30b..0000000000000000000000000000000000000000
--- a/chromeos/ime/composition_text_unittest.cc
+++ /dev/null
@@ -1,54 +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.
-// TODO(nona): Add more tests.
-
-#include "chromeos/ime/composition_text.h"
-
-#include "base/strings/utf_string_conversions.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace chromeos {
-
-TEST(CompositionTextTest, CopyTest) {
- const base::string16 kSampleText = base::UTF8ToUTF16("Sample Text");
- const CompositionText::UnderlineAttribute kSampleUnderlineAttribute1 = {
- CompositionText::COMPOSITION_TEXT_UNDERLINE_SINGLE, 10, 20};
-
- const CompositionText::UnderlineAttribute kSampleUnderlineAttribute2 = {
- CompositionText::COMPOSITION_TEXT_UNDERLINE_DOUBLE, 11, 21};
-
- const CompositionText::UnderlineAttribute kSampleUnderlineAttribute3 = {
- CompositionText::COMPOSITION_TEXT_UNDERLINE_ERROR, 12, 22};
-
- // Make CompositionText
- CompositionText text;
- text.set_text(kSampleText);
- std::vector<CompositionText::UnderlineAttribute>* underline_attributes =
- text.mutable_underline_attributes();
- underline_attributes->push_back(kSampleUnderlineAttribute1);
- underline_attributes->push_back(kSampleUnderlineAttribute2);
- underline_attributes->push_back(kSampleUnderlineAttribute3);
- text.set_selection_start(30);
- text.set_selection_end(40);
-
- CompositionText text2;
- text2.CopyFrom(text);
-
- EXPECT_EQ(text.text(), text2.text());
- EXPECT_EQ(text.underline_attributes().size(),
- text2.underline_attributes().size());
- for (size_t i = 0; i < text.underline_attributes().size(); ++i) {
- EXPECT_EQ(text.underline_attributes()[i].type,
- text2.underline_attributes()[i].type);
- EXPECT_EQ(text.underline_attributes()[i].start_index,
- text2.underline_attributes()[i].start_index);
- EXPECT_EQ(text.underline_attributes()[i].end_index,
- text2.underline_attributes()[i].end_index);
- }
-
- EXPECT_EQ(text.selection_start(), text2.selection_start());
- EXPECT_EQ(text.selection_end(), text2.selection_end());
-}
-
-} // namespace chromeos
« no previous file with comments | « chromeos/ime/composition_text.cc ('k') | chromeos/ime/extension_ime_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698