OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/ui/ash/ime_controller_chromeos.h" | 5 #include "chrome/browser/ui/ash/ime_controller_chromeos.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" | 8 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" |
9 #include "chrome/browser/chromeos/input_method/mock_input_method_manager.h" | 9 #include "chrome/browser/chromeos/input_method/mock_input_method_manager.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 #include "ui/base/accelerators/accelerator.h" | 11 #include "ui/base/accelerators/accelerator.h" |
12 #include "ui/events/event_constants.h" | 12 #include "ui/events/event_constants.h" |
13 #include "ui/events/keycodes/keyboard_codes.h" | 13 #include "ui/events/keycodes/keyboard_codes.h" |
14 | 14 |
15 class ImeControllerTest : public testing::Test { | 15 class ImeControllerTest : public testing::Test { |
16 public: | 16 public: |
17 ImeControllerTest() : mock_input_method_manager_(NULL) {} | 17 ImeControllerTest() : mock_input_method_manager_(NULL) {} |
18 virtual ~ImeControllerTest() {} | 18 virtual ~ImeControllerTest() {} |
19 | 19 |
20 virtual void SetUp() OVERRIDE { | 20 virtual void SetUp() override { |
21 mock_input_method_manager_ = | 21 mock_input_method_manager_ = |
22 new chromeos::input_method::MockInputMethodManager; | 22 new chromeos::input_method::MockInputMethodManager; |
23 chromeos::input_method::InitializeForTesting( | 23 chromeos::input_method::InitializeForTesting( |
24 mock_input_method_manager_); | 24 mock_input_method_manager_); |
25 } | 25 } |
26 | 26 |
27 virtual void TearDown() OVERRIDE { | 27 virtual void TearDown() override { |
28 chromeos::input_method::Shutdown(); | 28 chromeos::input_method::Shutdown(); |
29 mock_input_method_manager_ = NULL; | 29 mock_input_method_manager_ = NULL; |
30 } | 30 } |
31 | 31 |
32 protected: | 32 protected: |
33 ImeController controller_; | 33 ImeController controller_; |
34 chromeos::input_method::MockInputMethodManager* mock_input_method_manager_; | 34 chromeos::input_method::MockInputMethodManager* mock_input_method_manager_; |
35 | 35 |
36 private: | 36 private: |
37 DISALLOW_COPY_AND_ASSIGN(ImeControllerTest); | 37 DISALLOW_COPY_AND_ASSIGN(ImeControllerTest); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 ui::Accelerator accel(ui::VKEY_1, ui::EF_SHIFT_DOWN); | 71 ui::Accelerator accel(ui::VKEY_1, ui::EF_SHIFT_DOWN); |
72 ui::Accelerator remapped = controller_.RemapAccelerator(accel); | 72 ui::Accelerator remapped = controller_.RemapAccelerator(accel); |
73 ui::Accelerator expected(ui::VKEY_1, 0); | 73 ui::Accelerator expected(ui::VKEY_1, 0); |
74 EXPECT_EQ(expected, remapped); | 74 EXPECT_EQ(expected, remapped); |
75 accel.set_type(ui::ET_KEY_RELEASED); | 75 accel.set_type(ui::ET_KEY_RELEASED); |
76 remapped = controller_.RemapAccelerator(accel); | 76 remapped = controller_.RemapAccelerator(accel); |
77 expected.set_type(ui::ET_KEY_RELEASED); | 77 expected.set_type(ui::ET_KEY_RELEASED); |
78 EXPECT_EQ(expected, remapped); | 78 EXPECT_EQ(expected, remapped); |
79 } | 79 } |
80 } | 80 } |
OLD | NEW |