OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "athena/input/public/accelerator_manager.h" | 5 #include "athena/input/public/accelerator_manager.h" |
6 | 6 |
7 #include "athena/input/public/input_manager.h" | 7 #include "athena/input/public/input_manager.h" |
8 #include "athena/test/athena_test_base.h" | 8 #include "athena/test/base/athena_test_base.h" |
9 #include "ui/events/test/event_generator.h" | 9 #include "ui/events/test/event_generator.h" |
10 | 10 |
11 namespace athena { | 11 namespace athena { |
12 namespace { | 12 namespace { |
13 | 13 |
14 const int kInvalidCommandId = -1; | 14 const int kInvalidCommandId = -1; |
15 | 15 |
16 class TestHandler : public AcceleratorHandler { | 16 class TestHandler : public AcceleratorHandler { |
17 public: | 17 public: |
18 TestHandler() : fired_command_id_(kInvalidCommandId), enabled_(true) {} | 18 TestHandler() : fired_command_id_(kInvalidCommandId), enabled_(true) {} |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 generator.PressKey(ui::VKEY_D, ui::EF_SHIFT_DOWN | ui::EF_IS_REPEAT); | 110 generator.PressKey(ui::VKEY_D, ui::EF_SHIFT_DOWN | ui::EF_IS_REPEAT); |
111 EXPECT_EQ(kInvalidCommandId, test_handler.GetFiredCommandIdAndReset()); | 111 EXPECT_EQ(kInvalidCommandId, test_handler.GetFiredCommandIdAndReset()); |
112 | 112 |
113 // TODO(oshima): Add scenario where the key event is consumed by | 113 // TODO(oshima): Add scenario where the key event is consumed by |
114 // an app. | 114 // an app. |
115 generator.PressKey(ui::VKEY_E, ui::EF_SHIFT_DOWN); | 115 generator.PressKey(ui::VKEY_E, ui::EF_SHIFT_DOWN); |
116 EXPECT_EQ(COMMAND_E, test_handler.GetFiredCommandIdAndReset()); | 116 EXPECT_EQ(COMMAND_E, test_handler.GetFiredCommandIdAndReset()); |
117 } | 117 } |
118 | 118 |
119 } // namespace athena | 119 } // namespace athena |
OLD | NEW |