| 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 "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/test/ash_test_base.h" | 8 #include "ash/test/ash_test_base.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 #if defined(USE_X11) | 28 #if defined(USE_X11) |
| 29 // The device id of the test touchpad device. | 29 // The device id of the test touchpad device. |
| 30 const unsigned int kTouchPadDeviceId = 1; | 30 const unsigned int kTouchPadDeviceId = 1; |
| 31 #endif | 31 #endif |
| 32 | 32 |
| 33 } // namespace | 33 } // namespace |
| 34 | 34 |
| 35 class StickyKeysTest : public test::AshTestBase { | 35 class StickyKeysTest : public test::AshTestBase { |
| 36 protected: | 36 protected: |
| 37 StickyKeysTest() | 37 StickyKeysTest() : target_(NULL), root_window_(NULL) {} |
| 38 : target_(NULL), | |
| 39 root_window_(NULL) {} | |
| 40 | 38 |
| 41 void SetUp() override { | 39 void SetUp() override { |
| 42 test::AshTestBase::SetUp(); | 40 test::AshTestBase::SetUp(); |
| 43 | 41 |
| 44 // |target_| owned by root window of shell. It is still safe to delete | 42 // |target_| owned by root window of shell. It is still safe to delete |
| 45 // it ourselves. | 43 // it ourselves. |
| 46 target_ = CreateTestWindowInShellWithId(0); | 44 target_ = CreateTestWindowInShellWithId(0); |
| 47 root_window_ = target_->GetRootWindow(); | 45 root_window_ = target_->GetRootWindow(); |
| 48 | 46 |
| 49 #if defined(USE_X11) | 47 #if defined(USE_X11) |
| (...skipping 23 matching lines...) Expand all Loading... |
| 73 // This is the standard native event on Chromebooks. | 71 // This is the standard native event on Chromebooks. |
| 74 ui::MouseEvent* GenerateMouseEvent(ui::EventType type) { | 72 ui::MouseEvent* GenerateMouseEvent(ui::EventType type) { |
| 75 return GenerateMouseEventAt(type, gfx::Point()); | 73 return GenerateMouseEventAt(type, gfx::Point()); |
| 76 } | 74 } |
| 77 | 75 |
| 78 // Creates a mouse event backed by a native XInput2 generic button event. | 76 // Creates a mouse event backed by a native XInput2 generic button event. |
| 79 // The |location| should be in physical pixels. | 77 // The |location| should be in physical pixels. |
| 80 ui::MouseEvent* GenerateMouseEventAt(ui::EventType type, | 78 ui::MouseEvent* GenerateMouseEventAt(ui::EventType type, |
| 81 const gfx::Point& location) { | 79 const gfx::Point& location) { |
| 82 #if defined(USE_X11) | 80 #if defined(USE_X11) |
| 83 scoped_xevent_.InitGenericButtonEvent( | 81 scoped_xevent_.InitGenericButtonEvent(kTouchPadDeviceId, type, location, 0); |
| 84 kTouchPadDeviceId, | |
| 85 type, | |
| 86 location, | |
| 87 0); | |
| 88 return new ui::MouseEvent(scoped_xevent_); | 82 return new ui::MouseEvent(scoped_xevent_); |
| 89 #else | 83 #else |
| 90 return GenerateSynthesizedMouseEventAt(type, location); | 84 return GenerateSynthesizedMouseEventAt(type, location); |
| 91 #endif | 85 #endif |
| 92 } | 86 } |
| 93 | 87 |
| 94 ui::MouseWheelEvent* GenerateMouseWheelEvent(int wheel_delta) { | 88 ui::MouseWheelEvent* GenerateMouseWheelEvent(int wheel_delta) { |
| 95 #if defined(USE_X11) | 89 #if defined(USE_X11) |
| 96 EXPECT_NE(0, wheel_delta); | 90 EXPECT_NE(0, wheel_delta); |
| 97 scoped_xevent_.InitGenericMouseWheelEvent( | 91 scoped_xevent_.InitGenericMouseWheelEvent(kTouchPadDeviceId, wheel_delta, |
| 98 kTouchPadDeviceId, wheel_delta, 0); | 92 0); |
| 99 ui::MouseWheelEvent* event = new ui::MouseWheelEvent(scoped_xevent_); | 93 ui::MouseWheelEvent* event = new ui::MouseWheelEvent(scoped_xevent_); |
| 100 ui::Event::DispatcherApi dispatcher(event); | 94 ui::Event::DispatcherApi dispatcher(event); |
| 101 dispatcher.set_target(target_); | 95 dispatcher.set_target(target_); |
| 102 return event; | 96 return event; |
| 103 #else | 97 #else |
| 104 return GenerateSynthesizedMouseWheelEvent(wheel_delta); | 98 return GenerateSynthesizedMouseWheelEvent(wheel_delta); |
| 105 #endif | 99 #endif |
| 106 } | 100 } |
| 107 | 101 |
| 108 ui::ScrollEvent* GenerateScrollEvent(int scroll_delta) { | 102 ui::ScrollEvent* GenerateScrollEvent(int scroll_delta) { |
| 109 #if defined(USE_X11) | 103 #if defined(USE_X11) |
| 110 scoped_xevent_.InitScrollEvent(kTouchPadDeviceId, // deviceid | 104 scoped_xevent_.InitScrollEvent(kTouchPadDeviceId, // deviceid |
| 111 0, // x_offset | 105 0, // x_offset |
| 112 scroll_delta, // y_offset | 106 scroll_delta, // y_offset |
| 113 0, // x_offset_ordinal | 107 0, // x_offset_ordinal |
| 114 scroll_delta, // y_offset_ordinal | 108 scroll_delta, // y_offset_ordinal |
| 115 2); // finger_count | 109 2); // finger_count |
| 116 ui::ScrollEvent* event = new ui::ScrollEvent(scoped_xevent_); | 110 ui::ScrollEvent* event = new ui::ScrollEvent(scoped_xevent_); |
| 117 ui::Event::DispatcherApi dispatcher(event); | 111 ui::Event::DispatcherApi dispatcher(event); |
| 118 dispatcher.set_target(target_); | 112 dispatcher.set_target(target_); |
| 119 return event; | 113 return event; |
| 120 #else | 114 #else |
| 121 ui::ScrollEvent* event = new ui::ScrollEvent( | 115 ui::ScrollEvent* event = new ui::ScrollEvent( |
| 122 ui::ET_SCROLL, gfx::Point(0, 0), ui::EventTimeForNow(), ui::EF_NONE, | 116 ui::ET_SCROLL, gfx::Point(0, 0), ui::EventTimeForNow(), ui::EF_NONE, |
| 123 0, // x_offset | 117 0, // x_offset |
| 124 scroll_delta, // y_offset | 118 scroll_delta, // y_offset |
| 125 0, // x_offset_ordinal | 119 0, // x_offset_ordinal |
| 126 scroll_delta, // y_offset_ordinal | 120 scroll_delta, // y_offset_ordinal |
| 127 2); // finger_count | 121 2); // finger_count |
| 128 ui::Event::DispatcherApi dispatcher(event); | 122 ui::Event::DispatcherApi dispatcher(event); |
| 129 dispatcher.set_target(target_); | 123 dispatcher.set_target(target_); |
| 130 return event; | 124 return event; |
| 131 #endif | 125 #endif |
| 132 } | 126 } |
| 133 | 127 |
| 134 ui::ScrollEvent* GenerateFlingScrollEvent(int fling_delta, | 128 ui::ScrollEvent* GenerateFlingScrollEvent(int fling_delta, bool is_cancel) { |
| 135 bool is_cancel) { | |
| 136 #if defined(USE_X11) | 129 #if defined(USE_X11) |
| 137 scoped_xevent_.InitFlingScrollEvent( | 130 scoped_xevent_.InitFlingScrollEvent(kTouchPadDeviceId, // deviceid |
| 138 kTouchPadDeviceId, // deviceid | 131 0, // x_velocity |
| 139 0, // x_velocity | 132 fling_delta, // y_velocity |
| 140 fling_delta, // y_velocity | 133 0, // x_velocity_ordinal |
| 141 0, // x_velocity_ordinal | 134 fling_delta, // y_velocity_ordinal |
| 142 fling_delta, // y_velocity_ordinal | 135 is_cancel); // is_cancel |
| 143 is_cancel); // is_cancel | |
| 144 ui::ScrollEvent* event = new ui::ScrollEvent(scoped_xevent_); | 136 ui::ScrollEvent* event = new ui::ScrollEvent(scoped_xevent_); |
| 145 ui::Event::DispatcherApi dispatcher(event); | 137 ui::Event::DispatcherApi dispatcher(event); |
| 146 dispatcher.set_target(target_); | 138 dispatcher.set_target(target_); |
| 147 return event; | 139 return event; |
| 148 #else | 140 #else |
| 149 ui::ScrollEvent* event = new ui::ScrollEvent( | 141 ui::ScrollEvent* event = new ui::ScrollEvent( |
| 150 is_cancel ? ui::ET_SCROLL_FLING_CANCEL : ui::ET_SCROLL_FLING_START, | 142 is_cancel ? ui::ET_SCROLL_FLING_CANCEL : ui::ET_SCROLL_FLING_START, |
| 151 gfx::Point(0, 0), ui::EventTimeForNow(), ui::EF_NONE, | 143 gfx::Point(0, 0), ui::EventTimeForNow(), ui::EF_NONE, |
| 152 0, // x_velocity | 144 0, // x_velocity |
| 153 fling_delta, // y_velocity | 145 fling_delta, // y_velocity |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 | 536 |
| 545 // Mouse events should not disable locked mode. | 537 // Mouse events should not disable locked mode. |
| 546 for (int i = 0; i < 3; ++i) { | 538 for (int i = 0; i < 3; ++i) { |
| 547 bool released = false; | 539 bool released = false; |
| 548 int mod_down_flags = 0; | 540 int mod_down_flags = 0; |
| 549 ev.reset(GenerateMouseEvent(ui::ET_MOUSE_PRESSED)); | 541 ev.reset(GenerateMouseEvent(ui::ET_MOUSE_PRESSED)); |
| 550 sticky_key.HandleMouseEvent(*ev.get(), &mod_down_flags, &released); | 542 sticky_key.HandleMouseEvent(*ev.get(), &mod_down_flags, &released); |
| 551 EXPECT_TRUE(mod_down_flags & ui::EF_CONTROL_DOWN); | 543 EXPECT_TRUE(mod_down_flags & ui::EF_CONTROL_DOWN); |
| 552 ev.reset(GenerateMouseEvent(ui::ET_MOUSE_RELEASED)); | 544 ev.reset(GenerateMouseEvent(ui::ET_MOUSE_RELEASED)); |
| 553 released = false; | 545 released = false; |
| 554 mod_down_flags = 0; | 546 mod_down_flags = 0; |
| 555 sticky_key.HandleMouseEvent(*ev.get(), &mod_down_flags, &released); | 547 sticky_key.HandleMouseEvent(*ev.get(), &mod_down_flags, &released); |
| 556 EXPECT_TRUE(mod_down_flags & ui::EF_CONTROL_DOWN); | 548 EXPECT_TRUE(mod_down_flags & ui::EF_CONTROL_DOWN); |
| 557 EXPECT_EQ(STICKY_KEY_STATE_LOCKED, sticky_key.current_state()); | 549 EXPECT_EQ(STICKY_KEY_STATE_LOCKED, sticky_key.current_state()); |
| 558 } | 550 } |
| 559 | 551 |
| 560 // Test with mouse wheel. | 552 // Test with mouse wheel. |
| 561 for (int i = 0; i < 3; ++i) { | 553 for (int i = 0; i < 3; ++i) { |
| 562 bool released = false; | 554 bool released = false; |
| 563 int mod_down_flags = 0; | 555 int mod_down_flags = 0; |
| 564 ev.reset(GenerateMouseWheelEvent(ui::MouseWheelEvent::kWheelDelta)); | 556 ev.reset(GenerateMouseWheelEvent(ui::MouseWheelEvent::kWheelDelta)); |
| 565 sticky_key.HandleMouseEvent(*ev.get(), &mod_down_flags, &released); | 557 sticky_key.HandleMouseEvent(*ev.get(), &mod_down_flags, &released); |
| 566 ev.reset(GenerateMouseWheelEvent(-ui::MouseWheelEvent::kWheelDelta)); | 558 ev.reset(GenerateMouseWheelEvent(-ui::MouseWheelEvent::kWheelDelta)); |
| 567 released = false; | 559 released = false; |
| 568 mod_down_flags = 0; | 560 mod_down_flags = 0; |
| 569 sticky_key.HandleMouseEvent(*ev.get(), &mod_down_flags, &released); | 561 sticky_key.HandleMouseEvent(*ev.get(), &mod_down_flags, &released); |
| 570 EXPECT_TRUE(mod_down_flags & ui::EF_CONTROL_DOWN); | 562 EXPECT_TRUE(mod_down_flags & ui::EF_CONTROL_DOWN); |
| 571 EXPECT_EQ(STICKY_KEY_STATE_LOCKED, sticky_key.current_state()); | 563 EXPECT_EQ(STICKY_KEY_STATE_LOCKED, sticky_key.current_state()); |
| 572 } | 564 } |
| 573 | 565 |
| 574 // Test mixed case with mouse events and key events. | 566 // Test mixed case with mouse events and key events. |
| 575 ev.reset(GenerateMouseWheelEvent(ui::MouseWheelEvent::kWheelDelta)); | 567 ev.reset(GenerateMouseWheelEvent(ui::MouseWheelEvent::kWheelDelta)); |
| 576 bool released = false; | 568 bool released = false; |
| 577 int mod_down_flags = 0; | 569 int mod_down_flags = 0; |
| 578 sticky_key.HandleMouseEvent(*ev.get(), &mod_down_flags, &released); | 570 sticky_key.HandleMouseEvent(*ev.get(), &mod_down_flags, &released); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 604 bool released = false; | 596 bool released = false; |
| 605 int mod_down_flags = 0; | 597 int mod_down_flags = 0; |
| 606 sticky_key.HandleScrollEvent(*ev.get(), &mod_down_flags, &released); | 598 sticky_key.HandleScrollEvent(*ev.get(), &mod_down_flags, &released); |
| 607 EXPECT_TRUE(mod_down_flags & ui::EF_CONTROL_DOWN); | 599 EXPECT_TRUE(mod_down_flags & ui::EF_CONTROL_DOWN); |
| 608 EXPECT_EQ(STICKY_KEY_STATE_ENABLED, sticky_key.current_state()); | 600 EXPECT_EQ(STICKY_KEY_STATE_ENABLED, sticky_key.current_state()); |
| 609 | 601 |
| 610 // Scrolls should all be modified but not disable sticky keys. | 602 // Scrolls should all be modified but not disable sticky keys. |
| 611 for (int j = 0; j < 3; ++j) { | 603 for (int j = 0; j < 3; ++j) { |
| 612 ev.reset(GenerateScrollEvent(scroll_deltas[i])); | 604 ev.reset(GenerateScrollEvent(scroll_deltas[i])); |
| 613 released = false; | 605 released = false; |
| 614 mod_down_flags = 0; | 606 mod_down_flags = 0; |
| 615 sticky_key.HandleScrollEvent(*ev.get(), &mod_down_flags, &released); | 607 sticky_key.HandleScrollEvent(*ev.get(), &mod_down_flags, &released); |
| 616 EXPECT_TRUE(mod_down_flags & ui::EF_CONTROL_DOWN); | 608 EXPECT_TRUE(mod_down_flags & ui::EF_CONTROL_DOWN); |
| 617 EXPECT_EQ(STICKY_KEY_STATE_ENABLED, sticky_key.current_state()); | 609 EXPECT_EQ(STICKY_KEY_STATE_ENABLED, sticky_key.current_state()); |
| 618 } | 610 } |
| 619 | 611 |
| 620 // Fling start event ends scroll sequence. | 612 // Fling start event ends scroll sequence. |
| 621 ev.reset(GenerateFlingScrollEvent(scroll_deltas[i], false)); | 613 ev.reset(GenerateFlingScrollEvent(scroll_deltas[i], false)); |
| 622 released = false; | 614 released = false; |
| 623 mod_down_flags = 0; | 615 mod_down_flags = 0; |
| 624 sticky_key.HandleScrollEvent(*ev.get(), &mod_down_flags, &released); | 616 sticky_key.HandleScrollEvent(*ev.get(), &mod_down_flags, &released); |
| 625 EXPECT_TRUE(mod_down_flags & ui::EF_CONTROL_DOWN); | 617 EXPECT_TRUE(mod_down_flags & ui::EF_CONTROL_DOWN); |
| 626 EXPECT_EQ(STICKY_KEY_STATE_DISABLED, sticky_key.current_state()); | 618 EXPECT_EQ(STICKY_KEY_STATE_DISABLED, sticky_key.current_state()); |
| 627 | 619 |
| 628 std::unique_ptr<ui::Event> up_event; | 620 std::unique_ptr<ui::Event> up_event; |
| 629 EXPECT_TRUE(released); | 621 EXPECT_TRUE(released); |
| 630 ASSERT_EQ(0, sticky_key.GetModifierUpEvent(&up_event)); | 622 ASSERT_EQ(0, sticky_key.GetModifierUpEvent(&up_event)); |
| 631 EXPECT_TRUE(up_event.get()); | 623 EXPECT_TRUE(up_event.get()); |
| 632 EXPECT_EQ(ui::ET_KEY_RELEASED, up_event->type()); | 624 EXPECT_EQ(ui::ET_KEY_RELEASED, up_event->type()); |
| 633 EXPECT_EQ(ui::VKEY_CONTROL, | 625 EXPECT_EQ(ui::VKEY_CONTROL, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 651 bool released = false; | 643 bool released = false; |
| 652 int mod_down_flags = 0; | 644 int mod_down_flags = 0; |
| 653 sticky_key.HandleScrollEvent(*ev.get(), &mod_down_flags, &released); | 645 sticky_key.HandleScrollEvent(*ev.get(), &mod_down_flags, &released); |
| 654 EXPECT_EQ(STICKY_KEY_STATE_ENABLED, sticky_key.current_state()); | 646 EXPECT_EQ(STICKY_KEY_STATE_ENABLED, sticky_key.current_state()); |
| 655 | 647 |
| 656 // Test that changing directions in a scroll sequence will | 648 // Test that changing directions in a scroll sequence will |
| 657 // return sticky keys to DISABLED state. | 649 // return sticky keys to DISABLED state. |
| 658 for (int j = 0; j < 3; ++j) { | 650 for (int j = 0; j < 3; ++j) { |
| 659 ev.reset(GenerateScrollEvent(10)); | 651 ev.reset(GenerateScrollEvent(10)); |
| 660 released = false; | 652 released = false; |
| 661 mod_down_flags = 0; | 653 mod_down_flags = 0; |
| 662 sticky_key.HandleScrollEvent(*ev.get(), &mod_down_flags, &released); | 654 sticky_key.HandleScrollEvent(*ev.get(), &mod_down_flags, &released); |
| 663 EXPECT_TRUE(mod_down_flags & ui::EF_CONTROL_DOWN); | 655 EXPECT_TRUE(mod_down_flags & ui::EF_CONTROL_DOWN); |
| 664 EXPECT_EQ(STICKY_KEY_STATE_ENABLED, sticky_key.current_state()); | 656 EXPECT_EQ(STICKY_KEY_STATE_ENABLED, sticky_key.current_state()); |
| 665 } | 657 } |
| 666 | 658 |
| 667 ev.reset(GenerateScrollEvent(direction_change_values[i])); | 659 ev.reset(GenerateScrollEvent(direction_change_values[i])); |
| 668 released = false; | 660 released = false; |
| 669 mod_down_flags = 0; | 661 mod_down_flags = 0; |
| 670 sticky_key.HandleScrollEvent(*ev.get(), &mod_down_flags, &released); | 662 sticky_key.HandleScrollEvent(*ev.get(), &mod_down_flags, &released); |
| 671 EXPECT_EQ(STICKY_KEY_STATE_DISABLED, sticky_key.current_state()); | 663 EXPECT_EQ(STICKY_KEY_STATE_DISABLED, sticky_key.current_state()); |
| 672 } | 664 } |
| 673 } | 665 } |
| 674 | 666 |
| 675 TEST_F(StickyKeysTest, ScrollEventLocked) { | 667 TEST_F(StickyKeysTest, ScrollEventLocked) { |
| 676 std::unique_ptr<ui::ScrollEvent> ev; | 668 std::unique_ptr<ui::ScrollEvent> ev; |
| 677 std::unique_ptr<ui::KeyEvent> kev; | 669 std::unique_ptr<ui::KeyEvent> kev; |
| 678 StickyKeysHandler sticky_key(ui::EF_CONTROL_DOWN); | 670 StickyKeysHandler sticky_key(ui::EF_CONTROL_DOWN); |
| 679 | 671 |
| 680 // Lock sticky keys. | 672 // Lock sticky keys. |
| 681 SendActivateStickyKeyPattern(&sticky_key, ui::VKEY_CONTROL); | 673 SendActivateStickyKeyPattern(&sticky_key, ui::VKEY_CONTROL); |
| 682 SendActivateStickyKeyPattern(&sticky_key, ui::VKEY_CONTROL); | 674 SendActivateStickyKeyPattern(&sticky_key, ui::VKEY_CONTROL); |
| 683 EXPECT_EQ(STICKY_KEY_STATE_LOCKED, sticky_key.current_state()); | 675 EXPECT_EQ(STICKY_KEY_STATE_LOCKED, sticky_key.current_state()); |
| 684 | 676 |
| 685 // Test scroll events are correctly modified in locked state. | 677 // Test scroll events are correctly modified in locked state. |
| 686 for (int i = 0; i < 5; ++i) { | 678 for (int i = 0; i < 5; ++i) { |
| 687 // Fling cancel starts scroll sequence. | 679 // Fling cancel starts scroll sequence. |
| 688 ev.reset(GenerateFlingScrollEvent(0, true)); | 680 ev.reset(GenerateFlingScrollEvent(0, true)); |
| 689 bool released = false; | 681 bool released = false; |
| 690 int mod_down_flags = 0; | 682 int mod_down_flags = 0; |
| 691 sticky_key.HandleScrollEvent(*ev.get(), &mod_down_flags, &released); | 683 sticky_key.HandleScrollEvent(*ev.get(), &mod_down_flags, &released); |
| 692 | 684 |
| 693 ev.reset(GenerateScrollEvent(10)); | 685 ev.reset(GenerateScrollEvent(10)); |
| 694 released = false; | 686 released = false; |
| 695 mod_down_flags = 0; | 687 mod_down_flags = 0; |
| 696 sticky_key.HandleScrollEvent(*ev.get(), &mod_down_flags, &released); | 688 sticky_key.HandleScrollEvent(*ev.get(), &mod_down_flags, &released); |
| 697 EXPECT_TRUE(mod_down_flags & ui::EF_CONTROL_DOWN); | 689 EXPECT_TRUE(mod_down_flags & ui::EF_CONTROL_DOWN); |
| 698 ev.reset(GenerateScrollEvent(-10)); | 690 ev.reset(GenerateScrollEvent(-10)); |
| 699 sticky_key.HandleScrollEvent(*ev.get(), &mod_down_flags, &released); | 691 sticky_key.HandleScrollEvent(*ev.get(), &mod_down_flags, &released); |
| 700 EXPECT_TRUE(mod_down_flags & ui::EF_CONTROL_DOWN); | 692 EXPECT_TRUE(mod_down_flags & ui::EF_CONTROL_DOWN); |
| 701 | 693 |
| 702 // Fling start ends scroll sequence. | 694 // Fling start ends scroll sequence. |
| 703 ev.reset(GenerateFlingScrollEvent(-10, false)); | 695 ev.reset(GenerateFlingScrollEvent(-10, false)); |
| 704 sticky_key.HandleScrollEvent(*ev.get(), &mod_down_flags, &released); | 696 sticky_key.HandleScrollEvent(*ev.get(), &mod_down_flags, &released); |
| 705 } | 697 } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 gfx::Point(0, 0))); | 735 gfx::Point(0, 0))); |
| 744 released = false; | 736 released = false; |
| 745 mod_down_flags = 0; | 737 mod_down_flags = 0; |
| 746 sticky_key.HandleMouseEvent(*mev.get(), &mod_down_flags, &released); | 738 sticky_key.HandleMouseEvent(*mev.get(), &mod_down_flags, &released); |
| 747 EXPECT_TRUE(mod_down_flags & ui::EF_CONTROL_DOWN); | 739 EXPECT_TRUE(mod_down_flags & ui::EF_CONTROL_DOWN); |
| 748 EXPECT_TRUE(released); | 740 EXPECT_TRUE(released); |
| 749 EXPECT_EQ(STICKY_KEY_STATE_DISABLED, sticky_key.current_state()); | 741 EXPECT_EQ(STICKY_KEY_STATE_DISABLED, sticky_key.current_state()); |
| 750 } | 742 } |
| 751 | 743 |
| 752 } // namespace ash | 744 } // namespace ash |
| OLD | NEW |