| 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 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 // Removing the border, and sending the same event should move it down in the | 281 // Removing the border, and sending the same event should move it down in the |
| 282 // toolkit-views coordinate system. | 282 // toolkit-views coordinate system. |
| 283 int height_change = NSHeight(frame_rect) - kTestHeight; | 283 int height_change = NSHeight(frame_rect) - kTestHeight; |
| 284 EXPECT_GT(height_change, 0); | 284 EXPECT_GT(height_change, 0); |
| 285 [test_window() setStyleMask:NSBorderlessWindowMask]; | 285 [test_window() setStyleMask:NSBorderlessWindowMask]; |
| 286 [test_window() setFrame:frame_rect display:YES]; | 286 [test_window() setFrame:frame_rect display:YES]; |
| 287 EXPECT_EQ(gfx::Point(0, kTestHeight + height_change), | 287 EXPECT_EQ(gfx::Point(0, kTestHeight + height_change), |
| 288 ui::EventLocationFromNative(event)); | 288 ui::EventLocationFromNative(event)); |
| 289 } | 289 } |
| 290 | 290 |
| 291 // Tests mouse movement events. |
| 292 TEST_F(EventsMacTest, MoveEvents) { |
| 293 gfx::Point location(5, 10); |
| 294 |
| 295 NSEvent* event = TestMouseEvent(NSMouseMoved, location, 0); |
| 296 EXPECT_EQ(ui::ET_MOUSE_MOVED, ui::EventTypeFromNative(event)); |
| 297 EXPECT_EQ(ui::EF_NONE, ui::EventFlagsFromNative(event)); |
| 298 EXPECT_EQ(location, ui::EventLocationFromNative(event)); |
| 299 } |
| 300 |
| 291 } // namespace ui | 301 } // namespace ui |
| OLD | NEW |