OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/base/ime/input_method_chromeos.h" | 5 #include "ui/base/ime/input_method_chromeos.h" |
6 | 6 |
7 #include <X11/Xlib.h> | 7 #include <X11/Xlib.h> |
8 #undef Bool | 8 #undef Bool |
9 #undef FocusIn | 9 #undef FocusIn |
10 #undef FocusOut | 10 #undef FocusOut |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 }; | 336 }; |
337 | 337 |
338 // Tests public APIs in ui::InputMethod first. | 338 // Tests public APIs in ui::InputMethod first. |
339 | 339 |
340 TEST_F(InputMethodChromeOSTest, GetInputLocale) { | 340 TEST_F(InputMethodChromeOSTest, GetInputLocale) { |
341 // ui::InputMethodChromeOS does not support the API. | 341 // ui::InputMethodChromeOS does not support the API. |
342 ime_->OnFocus(); | 342 ime_->OnFocus(); |
343 EXPECT_EQ("", ime_->GetInputLocale()); | 343 EXPECT_EQ("", ime_->GetInputLocale()); |
344 } | 344 } |
345 | 345 |
346 TEST_F(InputMethodChromeOSTest, IsActive) { | |
347 ime_->OnFocus(); | |
348 // ui::InputMethodChromeOS always returns true. | |
349 EXPECT_TRUE(ime_->IsActive()); | |
350 } | |
351 | |
352 TEST_F(InputMethodChromeOSTest, GetInputTextType) { | 346 TEST_F(InputMethodChromeOSTest, GetInputTextType) { |
353 ime_->OnFocus(); | 347 ime_->OnFocus(); |
354 EXPECT_EQ(TEXT_INPUT_TYPE_NONE, ime_->GetTextInputType()); | 348 EXPECT_EQ(TEXT_INPUT_TYPE_NONE, ime_->GetTextInputType()); |
355 input_type_ = TEXT_INPUT_TYPE_PASSWORD; | 349 input_type_ = TEXT_INPUT_TYPE_PASSWORD; |
356 ime_->OnTextInputTypeChanged(this); | 350 ime_->OnTextInputTypeChanged(this); |
357 EXPECT_EQ(TEXT_INPUT_TYPE_PASSWORD, ime_->GetTextInputType()); | 351 EXPECT_EQ(TEXT_INPUT_TYPE_PASSWORD, ime_->GetTextInputType()); |
358 input_type_ = TEXT_INPUT_TYPE_TEXT; | 352 input_type_ = TEXT_INPUT_TYPE_TEXT; |
359 ime_->OnTextInputTypeChanged(this); | 353 ime_->OnTextInputTypeChanged(this); |
360 EXPECT_EQ(TEXT_INPUT_TYPE_TEXT, ime_->GetTextInputType()); | 354 EXPECT_EQ(TEXT_INPUT_TYPE_TEXT, ime_->GetTextInputType()); |
361 } | 355 } |
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 stop_propagation_post_ime_ = false; | 999 stop_propagation_post_ime_ = false; |
1006 ime_->DispatchKeyEvent(eventA); | 1000 ime_->DispatchKeyEvent(eventA); |
1007 mock_ime_engine_handler_->last_passed_callback().Run(false); | 1001 mock_ime_engine_handler_->last_passed_callback().Run(false); |
1008 | 1002 |
1009 key_event = mock_ime_engine_handler_->last_processed_key_event(); | 1003 key_event = mock_ime_engine_handler_->last_processed_key_event(); |
1010 EXPECT_EQ(ui::VKEY_A, key_event->key_code()); | 1004 EXPECT_EQ(ui::VKEY_A, key_event->key_code()); |
1011 EXPECT_EQ(L'A', inserted_char_); | 1005 EXPECT_EQ(L'A', inserted_char_); |
1012 } | 1006 } |
1013 | 1007 |
1014 } // namespace ui | 1008 } // namespace ui |
OLD | NEW |