OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <cstring> | 5 #include <cstring> |
6 | 6 |
7 #include "base/i18n/char_iterator.h" | 7 #include "base/i18n/char_iterator.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chromeos/dbus/dbus_thread_manager.h" | 10 #include "chromeos/dbus/dbus_thread_manager.h" |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 input_type_ = TEXT_INPUT_TYPE_TEXT; | 284 input_type_ = TEXT_INPUT_TYPE_TEXT; |
285 ime_->OnTextInputTypeChanged(this); | 285 ime_->OnTextInputTypeChanged(this); |
286 EXPECT_EQ(TEXT_INPUT_TYPE_TEXT, ime_->GetTextInputType()); | 286 EXPECT_EQ(TEXT_INPUT_TYPE_TEXT, ime_->GetTextInputType()); |
287 } | 287 } |
288 | 288 |
289 TEST_F(InputMethodIBusTest, CanComposeInline) { | 289 TEST_F(InputMethodIBusTest, CanComposeInline) { |
290 ime_->Init(true); | 290 ime_->Init(true); |
291 EXPECT_EQ(true, ime_->CanComposeInline()); | 291 EXPECT_EQ(true, ime_->CanComposeInline()); |
292 can_compose_inline_ = false; | 292 can_compose_inline_ = false; |
293 ime_->OnTextInputTypeChanged(this); | 293 ime_->OnTextInputTypeChanged(this); |
294 EXPECT_EQ(false, ime_->CanComposeInline()); | 294 EXPECT_FALSE(ime_->CanComposeInline()); |
295 } | 295 } |
296 | 296 |
297 TEST_F(InputMethodIBusTest, GetTextInputClient) { | 297 TEST_F(InputMethodIBusTest, GetTextInputClient) { |
298 ime_->Init(true); | 298 ime_->Init(true); |
299 EXPECT_EQ(this, ime_->GetTextInputClient()); | 299 EXPECT_EQ(this, ime_->GetTextInputClient()); |
300 ime_->SetFocusedTextInputClient(NULL); | 300 ime_->SetFocusedTextInputClient(NULL); |
301 EXPECT_EQ(NULL, ime_->GetTextInputClient()); | 301 EXPECT_EQ(NULL, ime_->GetTextInputClient()); |
302 } | 302 } |
303 | 303 |
304 TEST_F(InputMethodIBusTest, GetInputTextType_WithoutFocusedClient) { | 304 TEST_F(InputMethodIBusTest, GetInputTextType_WithoutFocusedClient) { |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 composition_text.underlines[0].start_offset); | 771 composition_text.underlines[0].start_offset); |
772 EXPECT_EQ(GetOffsetInUTF16(kSampleText, selection.end_index), | 772 EXPECT_EQ(GetOffsetInUTF16(kSampleText, selection.end_index), |
773 composition_text.underlines[0].end_offset); | 773 composition_text.underlines[0].end_offset); |
774 EXPECT_EQ(SK_ColorBLACK, composition_text.underlines[0].color); | 774 EXPECT_EQ(SK_ColorBLACK, composition_text.underlines[0].color); |
775 EXPECT_TRUE(composition_text.underlines[0].thick); | 775 EXPECT_TRUE(composition_text.underlines[0].thick); |
776 } | 776 } |
777 | 777 |
778 // TODO(nona): Write more tests, especially for key event functions. | 778 // TODO(nona): Write more tests, especially for key event functions. |
779 | 779 |
780 } // namespace ui | 780 } // namespace ui |
OLD | NEW |