| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "athena/util/drag_handle.h" | 5 #include "athena/util/drag_handle.h" |
| 6 | 6 |
| 7 #include "ui/aura/test/aura_test_base.h" | 7 #include "ui/aura/test/aura_test_base.h" |
| 8 #include "ui/aura/window.h" | 8 #include "ui/aura/window.h" |
| 9 #include "ui/views/view.h" | 9 #include "ui/views/view.h" |
| 10 #include "ui/views/widget/widget.h" | 10 #include "ui/views/widget/widget.h" |
| 11 | 11 |
| 12 namespace athena { | 12 namespace athena { |
| 13 | 13 |
| 14 class DragHandleDelegateTest : public DragHandleScrollDelegate { | 14 class DragHandleDelegateTest : public DragHandleScrollDelegate { |
| 15 public: | 15 public: |
| 16 explicit DragHandleDelegateTest() | 16 explicit DragHandleDelegateTest() |
| 17 : begin_delta_(0), | 17 : begin_delta_(0), |
| 18 scroll_end_velocity_(0), | 18 scroll_end_velocity_(0), |
| 19 got_scroll_end_(false), | 19 got_scroll_end_(false), |
| 20 update_delta_(0) {} | 20 update_delta_(0) {} |
| 21 | 21 |
| 22 virtual ~DragHandleDelegateTest() {} | 22 ~DragHandleDelegateTest() override {} |
| 23 | 23 |
| 24 void Reset() { | 24 void Reset() { |
| 25 begin_delta_ = 0; | 25 begin_delta_ = 0; |
| 26 scroll_end_velocity_ = 0; | 26 scroll_end_velocity_ = 0; |
| 27 got_scroll_end_ = false; | 27 got_scroll_end_ = false; |
| 28 update_delta_ = 0; | 28 update_delta_ = 0; |
| 29 } | 29 } |
| 30 | 30 |
| 31 float begin_delta() { return begin_delta_; } | 31 float begin_delta() { return begin_delta_; } |
| 32 float scroll_end_velocity() { return scroll_end_velocity_; } | 32 float scroll_end_velocity() { return scroll_end_velocity_; } |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 widget.OnGestureEvent(&e); | 139 widget.OnGestureEvent(&e); |
| 140 EXPECT_TRUE(delegate.got_scroll_end()); | 140 EXPECT_TRUE(delegate.got_scroll_end()); |
| 141 EXPECT_EQ(fling_velocity, delegate.scroll_end_velocity()); | 141 EXPECT_EQ(fling_velocity, delegate.scroll_end_velocity()); |
| 142 | 142 |
| 143 delegate.Reset(); | 143 delegate.Reset(); |
| 144 | 144 |
| 145 drag_handle.reset(); | 145 drag_handle.reset(); |
| 146 } | 146 } |
| 147 | 147 |
| 148 } // namespace athena | 148 } // namespace athena |
| OLD | NEW |