OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/wm/common/window_positioner.h" | 6 #include "ash/wm/common/window_positioner.h" |
7 #include "ash/wm/window_util.h" | 7 #include "ash/wm/window_util.h" |
8 #include "components/exo/buffer.h" | 8 #include "components/exo/buffer.h" |
9 #include "components/exo/shell_surface.h" | 9 #include "components/exo/shell_surface.h" |
10 #include "components/exo/surface.h" | 10 #include "components/exo/surface.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 using TouchTest = test::ExoTestBase; | 22 using TouchTest = test::ExoTestBase; |
23 | 23 |
24 class MockTouchDelegate : public TouchDelegate { | 24 class MockTouchDelegate : public TouchDelegate { |
25 public: | 25 public: |
26 MockTouchDelegate() {} | 26 MockTouchDelegate() {} |
27 | 27 |
28 // Overridden from TouchDelegate: | 28 // Overridden from TouchDelegate: |
29 MOCK_METHOD1(OnTouchDestroying, void(Touch*)); | 29 MOCK_METHOD1(OnTouchDestroying, void(Touch*)); |
30 MOCK_CONST_METHOD1(CanAcceptTouchEventsForSurface, bool(Surface*)); | 30 MOCK_CONST_METHOD1(CanAcceptTouchEventsForSurface, bool(Surface*)); |
31 MOCK_METHOD4(OnTouchDown, | 31 MOCK_METHOD4(OnTouchDown, |
32 void(Surface*, base::TimeDelta, int, const gfx::Point&)); | 32 void(Surface*, base::TimeTicks, int, const gfx::Point&)); |
33 MOCK_METHOD2(OnTouchUp, void(base::TimeDelta, int)); | 33 MOCK_METHOD2(OnTouchUp, void(base::TimeTicks, int)); |
34 MOCK_METHOD3(OnTouchMotion, void(base::TimeDelta, int, const gfx::Point&)); | 34 MOCK_METHOD3(OnTouchMotion, void(base::TimeTicks, int, const gfx::Point&)); |
35 MOCK_METHOD0(OnTouchCancel, void()); | 35 MOCK_METHOD0(OnTouchCancel, void()); |
36 }; | 36 }; |
37 | 37 |
38 TEST_F(TouchTest, OnTouchDown) { | 38 TEST_F(TouchTest, OnTouchDown) { |
39 ash::WindowPositioner::DisableAutoPositioning(true); | 39 ash::WindowPositioner::DisableAutoPositioning(true); |
40 | 40 |
41 std::unique_ptr<Surface> bottom_surface(new Surface); | 41 std::unique_ptr<Surface> bottom_surface(new Surface); |
42 std::unique_ptr<ShellSurface> bottom_shell_surface( | 42 std::unique_ptr<ShellSurface> bottom_shell_surface( |
43 new ShellSurface(bottom_surface.get())); | 43 new ShellSurface(bottom_surface.get())); |
44 gfx::Size bottom_buffer_size(10, 10); | 44 gfx::Size bottom_buffer_size(10, 10); |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 ui::TouchEvent cancel_event(ui::ET_TOUCH_CANCELLED, gfx::Point(), 1, | 176 ui::TouchEvent cancel_event(ui::ET_TOUCH_CANCELLED, gfx::Point(), 1, |
177 generator.Now()); | 177 generator.Now()); |
178 generator.Dispatch(&cancel_event); | 178 generator.Dispatch(&cancel_event); |
179 | 179 |
180 EXPECT_CALL(delegate, OnTouchDestroying(touch.get())); | 180 EXPECT_CALL(delegate, OnTouchDestroying(touch.get())); |
181 touch.reset(); | 181 touch.reset(); |
182 } | 182 } |
183 | 183 |
184 } // namespace | 184 } // namespace |
185 } // namespace exo | 185 } // namespace exo |
OLD | NEW |