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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "mojo/public/cpp/bindings/interface_request.h" | 10 #include "mojo/public/cpp/bindings/interface_request.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 mojo::Binding<ui::mojom::TextInputClient> binding_; | 43 mojo::Binding<ui::mojom::TextInputClient> binding_; |
44 std::unique_ptr<base::RunLoop> run_loop_; | 44 std::unique_ptr<base::RunLoop> run_loop_; |
45 std::unique_ptr<ui::Event> receieved_event_; | 45 std::unique_ptr<ui::Event> receieved_event_; |
46 | 46 |
47 DISALLOW_COPY_AND_ASSIGN(TestTextInputClient); | 47 DISALLOW_COPY_AND_ASSIGN(TestTextInputClient); |
48 }; | 48 }; |
49 | 49 |
50 class IMEAppTest : public service_manager::test::ServiceTest { | 50 class IMEAppTest : public service_manager::test::ServiceTest { |
51 public: | 51 public: |
52 IMEAppTest() : ServiceTest("mus_ime_unittests") {} | 52 IMEAppTest() : ServiceTest("ime_unittests") {} |
53 ~IMEAppTest() override {} | 53 ~IMEAppTest() override {} |
54 | 54 |
55 // service_manager::test::ServiceTest: | 55 // service_manager::test::ServiceTest: |
56 void SetUp() override { | 56 void SetUp() override { |
57 ServiceTest::SetUp(); | 57 ServiceTest::SetUp(); |
58 // test_ime_driver will register itself as the current IMEDriver. | 58 // test_ime_driver will register itself as the current IMEDriver. |
59 connector()->StartService("test_ime_driver"); | 59 connector()->StartService("test_ime_driver"); |
60 connector()->BindInterface(ui::mojom::kServiceName, &ime_server_); | 60 connector()->BindInterface(ui::mojom::kServiceName, &ime_server_); |
61 } | 61 } |
62 | 62 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 108 |
109 ui::KeyEvent* received_key_event = received_event->AsKeyEvent(); | 109 ui::KeyEvent* received_key_event = received_event->AsKeyEvent(); |
110 EXPECT_EQ(ui::ET_KEY_PRESSED, received_key_event->type()); | 110 EXPECT_EQ(ui::ET_KEY_PRESSED, received_key_event->type()); |
111 EXPECT_TRUE(received_key_event->is_char()); | 111 EXPECT_TRUE(received_key_event->is_char()); |
112 EXPECT_EQ(char_event.GetCharacter(), received_key_event->GetCharacter()); | 112 EXPECT_EQ(char_event.GetCharacter(), received_key_event->GetCharacter()); |
113 | 113 |
114 // Send non-character key event. | 114 // Send non-character key event. |
115 ui::KeyEvent nonchar_event(ui::ET_KEY_PRESSED, ui::VKEY_LEFT, 0); | 115 ui::KeyEvent nonchar_event(ui::ET_KEY_PRESSED, ui::VKEY_LEFT, 0); |
116 EXPECT_FALSE(ProcessKeyEvent(&input_method, ui::Event::Clone(nonchar_event))); | 116 EXPECT_FALSE(ProcessKeyEvent(&input_method, ui::Event::Clone(nonchar_event))); |
117 } | 117 } |
OLD | NEW |