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/common/wm/window_positioner.h" | 5 #include "ash/common/wm/window_positioner.h" |
6 #include "ash/shell.h" | 6 #include "ash/shell.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" |
11 #include "components/exo/test/exo_test_base.h" | 11 #include "components/exo/test/exo_test_base.h" |
12 #include "components/exo/test/exo_test_helper.h" | 12 #include "components/exo/test/exo_test_helper.h" |
13 #include "components/exo/touch.h" | 13 #include "components/exo/touch.h" |
14 #include "components/exo/touch_delegate.h" | 14 #include "components/exo/touch_delegate.h" |
15 #include "testing/gmock/include/gmock/gmock.h" | 15 #include "testing/gmock/include/gmock/gmock.h" |
| 16 #include "ui/events/base_event_utils.h" |
16 #include "ui/events/test/event_generator.h" | 17 #include "ui/events/test/event_generator.h" |
17 #include "ui/views/widget/widget.h" | 18 #include "ui/views/widget/widget.h" |
18 | 19 |
19 namespace exo { | 20 namespace exo { |
20 namespace { | 21 namespace { |
21 | 22 |
22 using TouchTest = test::ExoTestBase; | 23 using TouchTest = test::ExoTestBase; |
23 | 24 |
24 class MockTouchDelegate : public TouchDelegate { | 25 class MockTouchDelegate : public TouchDelegate { |
25 public: | 26 public: |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 OnTouchDown(surface.get(), testing::_, testing::_, gfx::Point())) | 174 OnTouchDown(surface.get(), testing::_, testing::_, gfx::Point())) |
174 .Times(2); | 175 .Times(2); |
175 generator.set_current_location( | 176 generator.set_current_location( |
176 surface->window()->GetBoundsInScreen().origin()); | 177 surface->window()->GetBoundsInScreen().origin()); |
177 generator.PressTouchId(1); | 178 generator.PressTouchId(1); |
178 generator.PressTouchId(2); | 179 generator.PressTouchId(2); |
179 | 180 |
180 // One touch point being canceled is enough for OnTouchCancel to be called. | 181 // One touch point being canceled is enough for OnTouchCancel to be called. |
181 EXPECT_CALL(delegate, OnTouchCancel()); | 182 EXPECT_CALL(delegate, OnTouchCancel()); |
182 ui::TouchEvent cancel_event(ui::ET_TOUCH_CANCELLED, gfx::Point(), 1, | 183 ui::TouchEvent cancel_event(ui::ET_TOUCH_CANCELLED, gfx::Point(), 1, |
183 generator.Now()); | 184 ui::EventTimeForNow()); |
184 generator.Dispatch(&cancel_event); | 185 generator.Dispatch(&cancel_event); |
185 | 186 |
186 EXPECT_CALL(delegate, OnTouchDestroying(touch.get())); | 187 EXPECT_CALL(delegate, OnTouchDestroying(touch.get())); |
187 touch.reset(); | 188 touch.reset(); |
188 } | 189 } |
189 | 190 |
190 } // namespace | 191 } // namespace |
191 } // namespace exo | 192 } // namespace exo |
OLD | NEW |