OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ash/sticky_keys/sticky_keys_controller.h" | 5 #include "ash/sticky_keys/sticky_keys_controller.h" |
6 | 6 |
7 #include <X11/Xlib.h> | 7 #include <X11/Xlib.h> |
8 #undef None | 8 #undef None |
9 #undef Bool | 9 #undef Bool |
10 #undef RootWindow | 10 #undef RootWindow |
(...skipping 16 matching lines...) Expand all Loading... |
27 const unsigned int kTouchPadDeviceId = 1; | 27 const unsigned int kTouchPadDeviceId = 1; |
28 | 28 |
29 } // namespace | 29 } // namespace |
30 | 30 |
31 class StickyKeysTest : public test::AshTestBase { | 31 class StickyKeysTest : public test::AshTestBase { |
32 protected: | 32 protected: |
33 StickyKeysTest() | 33 StickyKeysTest() |
34 : target_(NULL), | 34 : target_(NULL), |
35 root_window_(NULL) {} | 35 root_window_(NULL) {} |
36 | 36 |
37 virtual void SetUp() OVERRIDE { | 37 virtual void SetUp() override { |
38 test::AshTestBase::SetUp(); | 38 test::AshTestBase::SetUp(); |
39 | 39 |
40 // |target_| owned by root window of shell. It is still safe to delete | 40 // |target_| owned by root window of shell. It is still safe to delete |
41 // it ourselves. | 41 // it ourselves. |
42 target_ = CreateTestWindowInShellWithId(0); | 42 target_ = CreateTestWindowInShellWithId(0); |
43 root_window_ = target_->GetRootWindow(); | 43 root_window_ = target_->GetRootWindow(); |
44 | 44 |
45 ui::SetUpTouchPadForTest(kTouchPadDeviceId); | 45 ui::SetUpTouchPadForTest(kTouchPadDeviceId); |
46 } | 46 } |
47 | 47 |
48 virtual void TearDown() OVERRIDE { | 48 virtual void TearDown() override { |
49 test::AshTestBase::TearDown(); | 49 test::AshTestBase::TearDown(); |
50 } | 50 } |
51 | 51 |
52 virtual void OnShortcutPressed() { | 52 virtual void OnShortcutPressed() { |
53 if (target_) { | 53 if (target_) { |
54 delete target_; | 54 delete target_; |
55 target_ = NULL; | 55 target_ = NULL; |
56 } | 56 } |
57 } | 57 } |
58 | 58 |
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 gfx::Point(0, 0))); | 702 gfx::Point(0, 0))); |
703 released = false; | 703 released = false; |
704 mod_down_flags = 0; | 704 mod_down_flags = 0; |
705 sticky_key.HandleMouseEvent(*mev.get(), &mod_down_flags, &released); | 705 sticky_key.HandleMouseEvent(*mev.get(), &mod_down_flags, &released); |
706 EXPECT_TRUE(mod_down_flags & ui::EF_CONTROL_DOWN); | 706 EXPECT_TRUE(mod_down_flags & ui::EF_CONTROL_DOWN); |
707 EXPECT_TRUE(released); | 707 EXPECT_TRUE(released); |
708 EXPECT_EQ(STICKY_KEY_STATE_DISABLED, sticky_key.current_state()); | 708 EXPECT_EQ(STICKY_KEY_STATE_DISABLED, sticky_key.current_state()); |
709 } | 709 } |
710 | 710 |
711 } // namespace ash | 711 } // namespace ash |
OLD | NEW |