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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 class IMEAppTest : public shell::test::ServiceTest { | 55 class IMEAppTest : public shell::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 // shell::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("mojo:test_ime_driver"); | 64 connector()->Connect("service:test_ime_driver"); |
65 connector()->ConnectToInterface("mojo: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_; |
71 | 71 |
72 DISALLOW_COPY_AND_ASSIGN(IMEAppTest); | 72 DISALLOW_COPY_AND_ASSIGN(IMEAppTest); |
73 }; | 73 }; |
74 | 74 |
75 // Tests sending a KeyEvent to the IMEDriver through the Mus IMEServer. | 75 // Tests sending a KeyEvent to the IMEDriver through the Mus IMEServer. |
(...skipping 26 matching lines...) Expand all 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 |