| 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 <cstring> | 5 #include <cstring> |
| 6 | 6 |
| 7 #include <X11/Xlib.h> | 7 #include <X11/Xlib.h> |
| 8 | 8 |
| 9 // Generically-named #defines from Xlib that conflict with symbols in GTest. | 9 // Generically-named #defines from Xlib that conflict with symbols in GTest. |
| 10 #undef Bool | 10 #undef Bool |
| 11 #undef None | 11 #undef None |
| 12 | 12 |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 #include "ui/base/events.h" | 14 #include "ui/base/events/event_constants.h" |
| 15 #include "ui/gfx/point.h" | 15 #include "ui/gfx/point.h" |
| 16 | 16 |
| 17 namespace ui { | 17 namespace ui { |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 // Initializes the passed-in Xlib event. | 21 // Initializes the passed-in Xlib event. |
| 22 void InitButtonEvent(XEvent* event, | 22 void InitButtonEvent(XEvent* event, |
| 23 bool is_press, | 23 bool is_press, |
| 24 const gfx::Point& location, | 24 const gfx::Point& location, |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 106 |
| 107 // We should return ET_UNKNOWN for the release event instead of returning | 107 // We should return ET_UNKNOWN for the release event instead of returning |
| 108 // ET_MOUSEWHEEL; otherwise we'll scroll twice for each scrollwheel step. | 108 // ET_MOUSEWHEEL; otherwise we'll scroll twice for each scrollwheel step. |
| 109 InitButtonEvent(&event, false, location, 4, 0); | 109 InitButtonEvent(&event, false, location, 4, 0); |
| 110 EXPECT_EQ(ui::ET_UNKNOWN, ui::EventTypeFromNative(&event)); | 110 EXPECT_EQ(ui::ET_UNKNOWN, ui::EventTypeFromNative(&event)); |
| 111 | 111 |
| 112 // TODO(derat): Test XInput code. | 112 // TODO(derat): Test XInput code. |
| 113 } | 113 } |
| 114 | 114 |
| 115 } // namespace ui | 115 } // namespace ui |
| OLD | NEW |