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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 | 433 |
434 void AdvanceKeyEventTimestamp(MSG& msg) { | 434 void AdvanceKeyEventTimestamp(MSG& msg) { |
435 msg.time++; | 435 msg.time++; |
436 } | 436 } |
437 #endif | 437 #endif |
438 } // namespace | 438 } // namespace |
439 | 439 |
440 #if defined(USE_X11) || defined(OS_WIN) | 440 #if defined(USE_X11) || defined(OS_WIN) |
441 TEST(EventTest, AutoRepeat) { | 441 TEST(EventTest, AutoRepeat) { |
442 const uint16_t kNativeCodeA = | 442 const uint16_t kNativeCodeA = |
443 ui::KeycodeConverter::DomCodeToNativeKeycode(DomCode::KEY_A); | 443 ui::KeycodeConverter::DomCodeToNativeKeycode(DomCode::US_A); |
444 const uint16_t kNativeCodeB = | 444 const uint16_t kNativeCodeB = |
445 ui::KeycodeConverter::DomCodeToNativeKeycode(DomCode::KEY_B); | 445 ui::KeycodeConverter::DomCodeToNativeKeycode(DomCode::US_B); |
446 #if defined(USE_X11) | 446 #if defined(USE_X11) |
447 ScopedXI2Event native_event_a_pressed; | 447 ScopedXI2Event native_event_a_pressed; |
448 native_event_a_pressed.InitKeyEvent(ET_KEY_PRESSED, VKEY_A, kNativeCodeA); | 448 native_event_a_pressed.InitKeyEvent(ET_KEY_PRESSED, VKEY_A, kNativeCodeA); |
449 ScopedXI2Event native_event_a_pressed_1500; | 449 ScopedXI2Event native_event_a_pressed_1500; |
450 native_event_a_pressed_1500.InitKeyEvent( | 450 native_event_a_pressed_1500.InitKeyEvent( |
451 ET_KEY_PRESSED, VKEY_A, kNativeCodeA); | 451 ET_KEY_PRESSED, VKEY_A, kNativeCodeA); |
452 ScopedXI2Event native_event_a_pressed_3000; | 452 ScopedXI2Event native_event_a_pressed_3000; |
453 native_event_a_pressed_3000.InitKeyEvent( | 453 native_event_a_pressed_3000.InitKeyEvent( |
454 ET_KEY_PRESSED, VKEY_A, kNativeCodeA); | 454 ET_KEY_PRESSED, VKEY_A, kNativeCodeA); |
455 | 455 |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 EXPECT_EQ(EventPointerType::POINTER_TYPE_PEN, | 691 EXPECT_EQ(EventPointerType::POINTER_TYPE_PEN, |
692 stylus_event_copy.pointer_details().pointer_type()); | 692 stylus_event_copy.pointer_details().pointer_type()); |
693 EXPECT_EQ(21.0f, stylus_event_copy.pointer_details().force()); | 693 EXPECT_EQ(21.0f, stylus_event_copy.pointer_details().force()); |
694 EXPECT_EQ(45.0f, stylus_event_copy.pointer_details().tilt_x()); | 694 EXPECT_EQ(45.0f, stylus_event_copy.pointer_details().tilt_x()); |
695 EXPECT_EQ(-45.0f, stylus_event_copy.pointer_details().tilt_y()); | 695 EXPECT_EQ(-45.0f, stylus_event_copy.pointer_details().tilt_y()); |
696 EXPECT_EQ(0.0f, stylus_event_copy.pointer_details().radius_x()); | 696 EXPECT_EQ(0.0f, stylus_event_copy.pointer_details().radius_x()); |
697 EXPECT_EQ(0.0f, stylus_event_copy.pointer_details().radius_y()); | 697 EXPECT_EQ(0.0f, stylus_event_copy.pointer_details().radius_y()); |
698 } | 698 } |
699 | 699 |
700 } // namespace ui | 700 } // namespace ui |
OLD | NEW |