| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/events/event_utils.h" | 5 #include "ui/events/event_utils.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #include "base/mac/scoped_cftyperef.h" | 9 #include "base/mac/scoped_cftyperef.h" |
| 10 #import "base/mac/scoped_objc_class_swizzler.h" | 10 #import "base/mac/scoped_objc_class_swizzler.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 #include "ui/events/event_constants.h" | 13 #include "ui/events/event_constants.h" |
| 14 #import "ui/events/test/cocoa_test_event_utils.h" | 14 #import "ui/events/test/cocoa_test_event_utils.h" |
| 15 #include "ui/gfx/point.h" | 15 #include "ui/gfx/geometry/point.h" |
| 16 #import "ui/gfx/test/ui_cocoa_test_helper.h" | 16 #import "ui/gfx/test/ui_cocoa_test_helper.h" |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 NSWindow* g_test_window = nil; | 20 NSWindow* g_test_window = nil; |
| 21 | 21 |
| 22 } // namespace | 22 } // namespace |
| 23 | 23 |
| 24 // Mac APIs for creating test events are frustrating. Quartz APIs have, e.g., | 24 // Mac APIs for creating test events are frustrating. Quartz APIs have, e.g., |
| 25 // CGEventCreateMouseEvent() which can't set a window or modifier flags. | 25 // CGEventCreateMouseEvent() which can't set a window or modifier flags. |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 event = cocoa_test_event_utils::MouseEventWithType(NSMouseMoved, 0); | 305 event = cocoa_test_event_utils::MouseEventWithType(NSMouseMoved, 0); |
| 306 EXPECT_EQ(ui::ET_MOUSE_MOVED, ui::EventTypeFromNative(event)); | 306 EXPECT_EQ(ui::ET_MOUSE_MOVED, ui::EventTypeFromNative(event)); |
| 307 | 307 |
| 308 event = cocoa_test_event_utils::EnterExitEventWithType(NSMouseEntered); | 308 event = cocoa_test_event_utils::EnterExitEventWithType(NSMouseEntered); |
| 309 EXPECT_EQ(ui::ET_MOUSE_ENTERED, ui::EventTypeFromNative(event)); | 309 EXPECT_EQ(ui::ET_MOUSE_ENTERED, ui::EventTypeFromNative(event)); |
| 310 event = cocoa_test_event_utils::EnterExitEventWithType(NSMouseExited); | 310 event = cocoa_test_event_utils::EnterExitEventWithType(NSMouseExited); |
| 311 EXPECT_EQ(ui::ET_MOUSE_EXITED, ui::EventTypeFromNative(event)); | 311 EXPECT_EQ(ui::ET_MOUSE_EXITED, ui::EventTypeFromNative(event)); |
| 312 } | 312 } |
| 313 | 313 |
| 314 } // namespace ui | 314 } // namespace ui |
| OLD | NEW |