| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_auralinux.h" | 5 #include "ui/base/ime/input_method_auralinux.h" |
| 6 | 6 |
| 7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
| 8 #include "base/strings/string_split.h" | 8 #include "base/strings/string_split.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 | 599 |
| 600 KeyEvent key(ET_KEY_PRESSED, VKEY_A, 0); | 600 KeyEvent key(ET_KEY_PRESSED, VKEY_A, 0); |
| 601 key.set_character(L'a'); | 601 key.set_character(L'a'); |
| 602 input_method_auralinux_->DispatchKeyEvent(key); | 602 input_method_auralinux_->DispatchKeyEvent(key); |
| 603 | 603 |
| 604 test_result_->ExpectAction("keydown:229"); | 604 test_result_->ExpectAction("keydown:229"); |
| 605 test_result_->ExpectAction("textinput:b"); | 605 test_result_->ExpectAction("textinput:b"); |
| 606 test_result_->ExpectAction("compositionstart"); | 606 test_result_->ExpectAction("compositionstart"); |
| 607 test_result_->ExpectAction("compositionupdate:a"); | 607 test_result_->ExpectAction("compositionupdate:a"); |
| 608 test_result_->Verify(); | 608 test_result_->Verify(); |
| 609 |
| 610 // crbug.com/513124. |
| 611 context_->SetSyncMode(true); |
| 612 context_->SetEatKey(true); |
| 613 context_->AddCommitAction("c"); |
| 614 context_->AddCompositionUpdateAction(""); |
| 615 input_method_auralinux_->DispatchKeyEvent(key); |
| 616 |
| 617 test_result_->ExpectAction("keydown:229"); |
| 618 test_result_->ExpectAction("compositionend"); |
| 619 test_result_->ExpectAction("textinput:c"); |
| 620 test_result_->Verify(); |
| 609 } | 621 } |
| 610 | 622 |
| 611 TEST_F(InputMethodAuraLinuxTest, MixedAsyncAndSyncTest) { | 623 TEST_F(InputMethodAuraLinuxTest, MixedAsyncAndSyncTest) { |
| 612 context_->SetSyncMode(false); | 624 context_->SetSyncMode(false); |
| 613 context_->SetEatKey(true); | 625 context_->SetEatKey(true); |
| 614 | 626 |
| 615 scoped_ptr<TextInputClientForTesting> client( | 627 scoped_ptr<TextInputClientForTesting> client( |
| 616 new TextInputClientForTesting(TEXT_INPUT_TYPE_TEXT)); | 628 new TextInputClientForTesting(TEXT_INPUT_TYPE_TEXT)); |
| 617 input_method_auralinux_->SetFocusedTextInputClient(client.get()); | 629 input_method_auralinux_->SetFocusedTextInputClient(client.get()); |
| 618 input_method_auralinux_->OnTextInputTypeChanged(client.get()); | 630 input_method_auralinux_->OnTextInputTypeChanged(client.get()); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 input_method_auralinux_->DispatchKeyEvent(key); | 725 input_method_auralinux_->DispatchKeyEvent(key); |
| 714 | 726 |
| 715 test_result_->ExpectAction("textinput:c"); | 727 test_result_->ExpectAction("textinput:c"); |
| 716 test_result_->ExpectAction("keydown:65"); | 728 test_result_->ExpectAction("keydown:65"); |
| 717 test_result_->ExpectAction("keypress:65"); | 729 test_result_->ExpectAction("keypress:65"); |
| 718 test_result_->Verify(); | 730 test_result_->Verify(); |
| 719 } | 731 } |
| 720 | 732 |
| 721 } // namespace | 733 } // namespace |
| 722 } // namespace ui | 734 } // namespace ui |
| OLD | NEW |