OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ui/views/animation/ink_drop_host_view.h" | 5 #include "ui/views/animation/ink_drop_host_view.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "ui/events/event.h" | 9 #include "ui/events/event.h" |
10 #include "ui/events/event_constants.h" | 10 #include "ui/events/event_constants.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 host_view_.SetSize(gfx::Size(20, 20)); | 50 host_view_.SetSize(gfx::Size(20, 20)); |
51 | 51 |
52 ui::MouseEvent located_event(ui::ET_MOUSE_PRESSED, gfx::Point(5, 6), | 52 ui::MouseEvent located_event(ui::ET_MOUSE_PRESSED, gfx::Point(5, 6), |
53 gfx::Point(5, 6), ui::EventTimeForNow(), | 53 gfx::Point(5, 6), ui::EventTimeForNow(), |
54 ui::EF_LEFT_MOUSE_BUTTON, 0); | 54 ui::EF_LEFT_MOUSE_BUTTON, 0); |
55 | 55 |
56 test_api_.AnimateInkDrop(InkDropState::ACTION_PENDING, &located_event); | 56 test_api_.AnimateInkDrop(InkDropState::ACTION_PENDING, &located_event); |
57 EXPECT_EQ(gfx::Point(5, 6), test_api_.GetInkDropCenterBasedOnLastEvent()); | 57 EXPECT_EQ(gfx::Point(5, 6), test_api_.GetInkDropCenterBasedOnLastEvent()); |
58 } | 58 } |
59 | 59 |
| 60 // Verifies that SetHasInkDrop() sets up gesture handling properly. |
| 61 TEST_F(InkDropHostViewTest, SetHasInkDropGestureHandler) { |
| 62 EXPECT_FALSE(test_api_.HasGestureHandler()); |
| 63 |
| 64 test_api_.SetHasInkDrop(true); |
| 65 EXPECT_TRUE(test_api_.HasGestureHandler()); |
| 66 |
| 67 test_api_.SetHasInkDrop(true); |
| 68 EXPECT_TRUE(test_api_.HasGestureHandler()); |
| 69 |
| 70 test_api_.SetHasInkDrop(false); |
| 71 EXPECT_FALSE(test_api_.HasGestureHandler()); |
| 72 } |
| 73 |
60 } // namespace test | 74 } // namespace test |
61 } // namespace views | 75 } // namespace views |
OLD | NEW |