From eac2fb874930ee15f25c2ba3e932956c2c9de67a Mon Sep 17 00:00:00 2001 From: "uekawa@chromium.org" Date: Wed, 26 Feb 2014 20:09:26 +0000 Subject: Cleanup: remove unneeded inlcudes and make shared constants actually shared. BUG=None. Review URL: https://codereview.chromium.org/180863002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253571 0039d316-1c4b-4281-b951-d872f2087c98 --- ui/base/ime/input_method_chromeos_unittest.cc | 28 ++++++++++----------------- 1 file changed, 10 insertions(+), 18 deletions(-) (limited to 'ui') diff --git a/ui/base/ime/input_method_chromeos_unittest.cc b/ui/base/ime/input_method_chromeos_unittest.cc index 896ef03..187c07d 100644 --- a/ui/base/ime/input_method_chromeos_unittest.cc +++ b/ui/base/ime/input_method_chromeos_unittest.cc @@ -31,6 +31,10 @@ using base::UTF16ToUTF8; namespace ui { namespace { + +const base::string16 kSampleText = base::UTF8ToUTF16( + "\xE3\x81\x82\xE3\x81\x84\xE3\x81\x86\xE3\x81\x88\xE3\x81\x8A"); + typedef chromeos::IMEEngineHandlerInterface::KeyEventDoneCallback KeyEventCallback; @@ -574,16 +578,16 @@ TEST_F(InputMethodChromeOSTest, OnCaretBoundsChanged) { } TEST_F(InputMethodChromeOSTest, ExtractCompositionTextTest_NoAttribute) { - const base::string16 kSampleText = base::UTF8ToUTF16("Sample Text"); + const base::string16 kSampleAsciiText = UTF8ToUTF16("Sample Text"); const uint32 kCursorPos = 2UL; chromeos::CompositionText chromeos_composition_text; - chromeos_composition_text.set_text(kSampleText); + chromeos_composition_text.set_text(kSampleAsciiText); CompositionText composition_text; ime_->ExtractCompositionText( chromeos_composition_text, kCursorPos, &composition_text); - EXPECT_EQ(kSampleText, composition_text.text); + EXPECT_EQ(kSampleAsciiText, composition_text.text); // If there is no selection, |selection| represents cursor position. EXPECT_EQ(kCursorPos, composition_text.selection.start()); EXPECT_EQ(kCursorPos, composition_text.selection.end()); @@ -591,13 +595,11 @@ TEST_F(InputMethodChromeOSTest, ExtractCompositionTextTest_NoAttribute) { // whole text underline. ASSERT_EQ(1UL, composition_text.underlines.size()); EXPECT_EQ(0UL, composition_text.underlines[0].start_offset); - EXPECT_EQ(kSampleText.size(), composition_text.underlines[0].end_offset); + EXPECT_EQ(kSampleAsciiText.size(), composition_text.underlines[0].end_offset); EXPECT_FALSE(composition_text.underlines[0].thick); } TEST_F(InputMethodChromeOSTest, ExtractCompositionTextTest_SingleUnderline) { - const base::string16 kSampleText = base::UTF8ToUTF16( - "\xE3\x81\x82\xE3\x81\x84\xE3\x81\x86\xE3\x81\x88\xE3\x81\x8A"); const uint32 kCursorPos = 2UL; // Set up chromeos composition text with one underline attribute. @@ -628,8 +630,6 @@ TEST_F(InputMethodChromeOSTest, ExtractCompositionTextTest_SingleUnderline) { } TEST_F(InputMethodChromeOSTest, ExtractCompositionTextTest_DoubleUnderline) { - const base::string16 kSampleText = base::UTF8ToUTF16( - "\xE3\x81\x82\xE3\x81\x84\xE3\x81\x86\xE3\x81\x88\xE3\x81\x8A"); const uint32 kCursorPos = 2UL; // Set up chromeos composition text with one underline attribute. @@ -660,8 +660,6 @@ TEST_F(InputMethodChromeOSTest, ExtractCompositionTextTest_DoubleUnderline) { } TEST_F(InputMethodChromeOSTest, ExtractCompositionTextTest_ErrorUnderline) { - const base::string16 kSampleText = base::UTF8ToUTF16( - "\xE3\x81\x82\xE3\x81\x84\xE3\x81\x86\xE3\x81\x88\xE3\x81\x8A"); const uint32 kCursorPos = 2UL; // Set up chromeos composition text with one underline attribute. @@ -691,8 +689,6 @@ TEST_F(InputMethodChromeOSTest, ExtractCompositionTextTest_ErrorUnderline) { } TEST_F(InputMethodChromeOSTest, ExtractCompositionTextTest_Selection) { - const base::string16 kSampleText = base::UTF8ToUTF16( - "\xE3\x81\x82\xE3\x81\x84\xE3\x81\x86\xE3\x81\x88\xE3\x81\x8A"); const uint32 kCursorPos = 2UL; // Set up chromeos composition text with one underline attribute. @@ -720,8 +716,6 @@ TEST_F(InputMethodChromeOSTest, ExtractCompositionTextTest_Selection) { TEST_F(InputMethodChromeOSTest, ExtractCompositionTextTest_SelectionStartWithCursor) { - const base::string16 kSampleText = base::UTF8ToUTF16( - "\xE3\x81\x82\xE3\x81\x84\xE3\x81\x86\xE3\x81\x88\xE3\x81\x8A"); const uint32 kCursorPos = 1UL; // Set up chromeos composition text with one underline attribute. @@ -754,8 +748,6 @@ TEST_F(InputMethodChromeOSTest, TEST_F(InputMethodChromeOSTest, ExtractCompositionTextTest_SelectionEndWithCursor) { - const base::string16 kSampleText = base::UTF8ToUTF16( - "\xE3\x81\x82\xE3\x81\x84\xE3\x81\x86\xE3\x81\x88\xE3\x81\x8A"); const uint32 kCursorPos = 4UL; // Set up chromeos composition text with one underline attribute. @@ -848,7 +840,7 @@ TEST_F(InputMethodChromeOSTest, SurroundingText_PartialText) { ime_->OnTextInputTypeChanged(this); // Set the TextInputClient behaviors. - surrounding_text_ = base::UTF8ToUTF16("abcdefghij"); + surrounding_text_ = UTF8ToUTF16("abcdefghij"); text_range_ = gfx::Range(5, 10); selection_range_ = gfx::Range(7, 9); @@ -876,7 +868,7 @@ TEST_F(InputMethodChromeOSTest, SurroundingText_BecomeEmptyText) { // Set the TextInputClient behaviors. // If the surrounding text becomes empty, text_range become (0, 0) and // selection range become invalid. - surrounding_text_ = base::UTF8ToUTF16(""); + surrounding_text_ = UTF8ToUTF16(""); text_range_ = gfx::Range(0, 0); selection_range_ = gfx::Range::InvalidRange(); -- cgit v1.1