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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
6 #include "testing/gtest/include/gtest/gtest.h" | 6 #include "testing/gtest/include/gtest/gtest.h" |
7 #include "ui/events/event.h" | 7 #include "ui/events/event.h" |
8 #include "ui/events/event_utils.h" | 8 #include "ui/events/event_utils.h" |
9 #include "ui/events/keycodes/dom3/dom_code.h" | 9 #include "ui/events/keycodes/dom3/dom_code.h" |
10 #include "ui/events/keycodes/dom4/keycode_converter.h" | 10 #include "ui/events/keycodes/dom4/keycode_converter.h" |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 EXPECT_FALSE(key_a4_pressed.IsRepeat()); | 491 EXPECT_FALSE(key_a4_pressed.IsRepeat()); |
492 | 492 |
493 KeyEvent key_a4_pressed_nonstandard_state( | 493 KeyEvent key_a4_pressed_nonstandard_state( |
494 native_event_a_pressed_nonstandard_state); | 494 native_event_a_pressed_nonstandard_state); |
495 EXPECT_FALSE(key_a4_pressed_nonstandard_state.IsRepeat()); | 495 EXPECT_FALSE(key_a4_pressed_nonstandard_state.IsRepeat()); |
496 } | 496 } |
497 #endif | 497 #endif |
498 } | 498 } |
499 #endif // USE_X11 || OS_WIN | 499 #endif // USE_X11 || OS_WIN |
500 | 500 |
| 501 TEST(EventTest, TouchEventRadiusDefaultsToOtherAxis) { |
| 502 const base::TimeDelta time = base::TimeDelta::FromMilliseconds(0); |
| 503 const float non_zero_length1 = 30; |
| 504 const float non_zero_length2 = 46; |
| 505 |
| 506 TouchEvent event1(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), 0, 0, time, |
| 507 non_zero_length1, 0, 0, 0); |
| 508 DCHECK_EQ(non_zero_length1, event1.radius_x()); |
| 509 DCHECK_EQ(non_zero_length1, event1.radius_y()); |
| 510 |
| 511 TouchEvent event2(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), 0, 0, time, |
| 512 0, non_zero_length2, 0, 0); |
| 513 DCHECK_EQ(non_zero_length2, event2.radius_x()); |
| 514 DCHECK_EQ(non_zero_length2, event2.radius_y()); |
| 515 } |
| 516 |
501 } // namespace ui | 517 } // namespace ui |
OLD | NEW |