| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/views/mus/input_method_mus.h" | 5 #include "ui/views/mus/input_method_mus.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 DISALLOW_COPY_AND_ASSIGN(TestTextInputClient); | 59 DISALLOW_COPY_AND_ASSIGN(TestTextInputClient); |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 } // namespace | 62 } // namespace |
| 63 | 63 |
| 64 class InputMethodMusTest : public testing::Test { | 64 class InputMethodMusTest : public testing::Test { |
| 65 public: | 65 public: |
| 66 InputMethodMusTest() : message_loop_(base::MessageLoop::TYPE_UI) {} | 66 InputMethodMusTest() : message_loop_(base::MessageLoop::TYPE_UI) {} |
| 67 ~InputMethodMusTest() override {} | 67 ~InputMethodMusTest() override {} |
| 68 | 68 |
| 69 shell::Connector* connector() { | 69 service_manager::Connector* connector() { |
| 70 return WindowManagerConnection::Get()->connector(); | 70 return WindowManagerConnection::Get()->connector(); |
| 71 } | 71 } |
| 72 | 72 |
| 73 private: | 73 private: |
| 74 base::MessageLoop message_loop_; | 74 base::MessageLoop message_loop_; |
| 75 ScopedViewsTestHelper helper_; | 75 ScopedViewsTestHelper helper_; |
| 76 | 76 |
| 77 DISALLOW_COPY_AND_ASSIGN(InputMethodMusTest); | 77 DISALLOW_COPY_AND_ASSIGN(InputMethodMusTest); |
| 78 }; | 78 }; |
| 79 | 79 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 92 ui::KeyEvent key_event('A', ui::VKEY_A, 0); | 92 ui::KeyEvent key_event('A', ui::VKEY_A, 0); |
| 93 input_method.DispatchKeyEvent(&key_event); | 93 input_method.DispatchKeyEvent(&key_event); |
| 94 | 94 |
| 95 ui::KeyEvent* received_event = text_input_client.WaitUntilInputReceieved(); | 95 ui::KeyEvent* received_event = text_input_client.WaitUntilInputReceieved(); |
| 96 EXPECT_EQ(ui::ET_KEY_PRESSED, received_event->type()); | 96 EXPECT_EQ(ui::ET_KEY_PRESSED, received_event->type()); |
| 97 EXPECT_TRUE(received_event->is_char()); | 97 EXPECT_TRUE(received_event->is_char()); |
| 98 EXPECT_EQ(key_event.GetCharacter(), received_event->GetCharacter()); | 98 EXPECT_EQ(key_event.GetCharacter(), received_event->GetCharacter()); |
| 99 } | 99 } |
| 100 | 100 |
| 101 } // namespace views | 101 } // namespace views |
| OLD | NEW |