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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 } | 45 } |
46 | 46 |
47 mojo::Binding<ui::mojom::TextInputClient> binding_; | 47 mojo::Binding<ui::mojom::TextInputClient> binding_; |
48 std::unique_ptr<base::RunLoop> run_loop_; | 48 std::unique_ptr<base::RunLoop> run_loop_; |
49 ui::mojom::CompositionEventPtr receieved_composition_event_; | 49 ui::mojom::CompositionEventPtr receieved_composition_event_; |
50 std::unique_ptr<ui::Event> unhandled_event_; | 50 std::unique_ptr<ui::Event> unhandled_event_; |
51 | 51 |
52 DISALLOW_COPY_AND_ASSIGN(TestTextInputClient); | 52 DISALLOW_COPY_AND_ASSIGN(TestTextInputClient); |
53 }; | 53 }; |
54 | 54 |
55 class IMEAppTest : public shell::test::ServiceTest { | 55 class IMEAppTest : public service_manager::test::ServiceTest { |
56 public: | 56 public: |
57 IMEAppTest() : ServiceTest("exe:mus_ime_unittests") {} | 57 IMEAppTest() : ServiceTest("exe:mus_ime_unittests") {} |
58 ~IMEAppTest() override {} | 58 ~IMEAppTest() override {} |
59 | 59 |
60 // shell::test::ServiceTest: | 60 // service_manager::test::ServiceTest: |
61 void SetUp() override { | 61 void SetUp() override { |
62 ServiceTest::SetUp(); | 62 ServiceTest::SetUp(); |
63 // test_ime_driver will register itself as the current IMEDriver. | 63 // test_ime_driver will register itself as the current IMEDriver. |
64 connector()->Connect("service:test_ime_driver"); | 64 connector()->Connect("service:test_ime_driver"); |
65 connector()->ConnectToInterface("service:ui", &ime_server_); | 65 connector()->ConnectToInterface("service:ui", &ime_server_); |
66 } | 66 } |
67 | 67 |
68 protected: | 68 protected: |
69 ui::mojom::IMEServerPtr ime_server_; | 69 ui::mojom::IMEServerPtr ime_server_; |
70 std::unique_ptr<base::RunLoop> run_loop_; | 70 std::unique_ptr<base::RunLoop> run_loop_; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 input_method->ProcessKeyEvent(ui::Event::Clone(nonchar_event)); | 102 input_method->ProcessKeyEvent(ui::Event::Clone(nonchar_event)); |
103 | 103 |
104 ui::Event* unhandled_event = client.WaitUntilUnhandledEvent(); | 104 ui::Event* unhandled_event = client.WaitUntilUnhandledEvent(); |
105 EXPECT_TRUE(unhandled_event); | 105 EXPECT_TRUE(unhandled_event); |
106 EXPECT_TRUE(unhandled_event->IsKeyEvent()); | 106 EXPECT_TRUE(unhandled_event->IsKeyEvent()); |
107 EXPECT_FALSE(unhandled_event->AsKeyEvent()->is_char()); | 107 EXPECT_FALSE(unhandled_event->AsKeyEvent()->is_char()); |
108 EXPECT_EQ(ui::ET_KEY_PRESSED, unhandled_event->type()); | 108 EXPECT_EQ(ui::ET_KEY_PRESSED, unhandled_event->type()); |
109 EXPECT_EQ(nonchar_event.key_code(), | 109 EXPECT_EQ(nonchar_event.key_code(), |
110 unhandled_event->AsKeyEvent()->key_code()); | 110 unhandled_event->AsKeyEvent()->key_code()); |
111 } | 111 } |
OLD | NEW |