| 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 18 matching lines...) Expand all Loading... |
| 29 : CustomButton(listener) { | 29 : CustomButton(listener) { |
| 30 } | 30 } |
| 31 | 31 |
| 32 virtual ~TestCustomButton() {} | 32 virtual ~TestCustomButton() {} |
| 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, 0, 0); |
| 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); |
| 43 } | 43 } |
| 44 | 44 |
| 45 } // namespace | 45 } // namespace |
| 46 | 46 |
| 47 typedef ViewsTestBase CustomButtonTest; | 47 typedef ViewsTestBase CustomButtonTest; |
| 48 | 48 |
| 49 // Tests that hover state changes correctly when visiblity/enableness changes. | 49 // Tests that hover state changes correctly when visiblity/enableness changes. |
| (...skipping 112 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 |