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 "ui/views/controls/button/custom_button.h" | 5 #include "ui/views/controls/button/custom_button.h" |
6 | 6 |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 #include "ui/aura/test/test_cursor_client.h" | 8 #include "ui/aura/test/test_cursor_client.h" |
9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
10 #include "ui/aura/window_event_dispatcher.h" | 10 #include "ui/aura/window_event_dispatcher.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 namespace views { | 22 namespace views { |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
26 class TestCustomButton : public CustomButton { | 26 class TestCustomButton : public CustomButton { |
27 public: | 27 public: |
28 explicit TestCustomButton(ButtonListener* listener) | 28 explicit TestCustomButton(ButtonListener* listener) |
29 : CustomButton(listener) { | 29 : CustomButton(listener) { |
30 } | 30 } |
31 | 31 |
32 virtual ~TestCustomButton() {} | 32 ~TestCustomButton() override {} |
33 | 33 |
34 private: | 34 private: |
35 DISALLOW_COPY_AND_ASSIGN(TestCustomButton); | 35 DISALLOW_COPY_AND_ASSIGN(TestCustomButton); |
36 }; | 36 }; |
37 | 37 |
38 void PerformGesture(CustomButton* button, ui::EventType event_type) { | 38 void PerformGesture(CustomButton* button, ui::EventType event_type) { |
39 ui::GestureEventDetails gesture_details(event_type); | 39 ui::GestureEventDetails gesture_details(event_type); |
40 base::TimeDelta time_stamp = base::TimeDelta::FromMicroseconds(0); | 40 base::TimeDelta time_stamp = base::TimeDelta::FromMicroseconds(0); |
41 ui::GestureEvent gesture_event(0, 0, 0, time_stamp, gesture_details); | 41 ui::GestureEvent gesture_event(0, 0, 0, time_stamp, gesture_details); |
42 button->OnGestureEvent(&gesture_event); | 42 button->OnGestureEvent(&gesture_event); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 EXPECT_FALSE(CustomButton::AsCustomButton(&label)); | 162 EXPECT_FALSE(CustomButton::AsCustomButton(&label)); |
163 | 163 |
164 Link link(text); | 164 Link link(text); |
165 EXPECT_FALSE(CustomButton::AsCustomButton(&link)); | 165 EXPECT_FALSE(CustomButton::AsCustomButton(&link)); |
166 | 166 |
167 Textfield textfield; | 167 Textfield textfield; |
168 EXPECT_FALSE(CustomButton::AsCustomButton(&textfield)); | 168 EXPECT_FALSE(CustomButton::AsCustomButton(&textfield)); |
169 } | 169 } |
170 | 170 |
171 } // namespace views | 171 } // namespace views |
OLD | NEW |