Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Side by Side Diff: athena/input/accelerator_manager_unittest.cc

Issue 654343002: Intorduce PowerButtonObserver API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: speculative fix Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « athena/input/DEPS ('k') | athena/input/input_manager_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/base/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
(...skipping 25 matching lines...) Expand all
36 fired_command_id_ = command_id; 36 fired_command_id_ = command_id;
37 return true; 37 return true;
38 } 38 }
39 39
40 int fired_command_id_; 40 int fired_command_id_;
41 bool enabled_; 41 bool enabled_;
42 42
43 DISALLOW_COPY_AND_ASSIGN(TestHandler); 43 DISALLOW_COPY_AND_ASSIGN(TestHandler);
44 }; 44 };
45 45
46 } // namespace athena 46 } // namespace
47 47
48 typedef test::AthenaTestBase InputManagerTest; 48 typedef test::AthenaTestBase InputManagerTest;
49 49
50 TEST_F(InputManagerTest, Basic) { 50 TEST_F(InputManagerTest, Basic) {
51 enum TestCommandId { 51 enum TestCommandId {
52 COMMAND_A, 52 COMMAND_A,
53 COMMAND_B, 53 COMMAND_B,
54 COMMAND_C, 54 COMMAND_C,
55 COMMAND_D, 55 COMMAND_D,
56 COMMAND_E, 56 COMMAND_E,
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « athena/input/DEPS ('k') | athena/input/input_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698