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 "ash/shell.h" | 5 #include "ash/shell.h" |
6 #include "ash/shell_window_ids.h" | 6 #include "ash/shell_window_ids.h" |
7 #include "ash/test/ash_test_base.h" | 7 #include "ash/test/ash_test_base.h" |
8 #include "ash/test/test_activation_delegate.h" | 8 #include "ash/test/test_activation_delegate.h" |
9 #include "ash/wm/window_util.h" | 9 #include "ash/wm/window_util.h" |
10 #include "ui/aura/client/cursor_client_observer.h" | 10 #include "ui/aura/client/cursor_client_observer.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 did_visibility_change_ = true; | 42 did_visibility_change_ = true; |
43 } | 43 } |
44 | 44 |
45 private: | 45 private: |
46 bool cursor_visibility_; | 46 bool cursor_visibility_; |
47 bool did_visibility_change_; | 47 bool did_visibility_change_; |
48 | 48 |
49 DISALLOW_COPY_AND_ASSIGN(TestingCursorClientObserver); | 49 DISALLOW_COPY_AND_ASSIGN(TestingCursorClientObserver); |
50 }; | 50 }; |
51 | 51 |
52 base::TimeDelta getTime() { | 52 base::TimeTicks getTime() { |
53 return ui::EventTimeForNow(); | 53 return ui::EventTimeForNow(); |
54 } | 54 } |
55 | 55 |
56 // A slightly changed TestEventHandler which can be configured to return a | 56 // A slightly changed TestEventHandler which can be configured to return a |
57 // specified value for key/mouse event handling. | 57 // specified value for key/mouse event handling. |
58 class CustomEventHandler : public ui::test::TestEventHandler { | 58 class CustomEventHandler : public ui::test::TestEventHandler { |
59 public: | 59 public: |
60 CustomEventHandler() | 60 CustomEventHandler() |
61 : key_result_(ui::ER_UNHANDLED), | 61 : key_result_(ui::ER_UNHANDLED), |
62 mouse_result_(ui::ER_UNHANDLED) { | 62 mouse_result_(ui::ER_UNHANDLED) { |
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
850 generator.MoveMouseTo(50, 50); | 850 generator.MoveMouseTo(50, 50); |
851 EXPECT_TRUE(observer_a.did_visibility_change()); | 851 EXPECT_TRUE(observer_a.did_visibility_change()); |
852 EXPECT_FALSE(observer_b.did_visibility_change()); | 852 EXPECT_FALSE(observer_b.did_visibility_change()); |
853 EXPECT_TRUE(observer_a.is_cursor_visible()); | 853 EXPECT_TRUE(observer_a.is_cursor_visible()); |
854 | 854 |
855 cursor_manager->RemoveObserver(&observer_a); | 855 cursor_manager->RemoveObserver(&observer_a); |
856 } | 856 } |
857 #endif // defined(OS_CHROMEOS) | 857 #endif // defined(OS_CHROMEOS) |
858 | 858 |
859 } // namespace ash | 859 } // namespace ash |
OLD | NEW |