OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #import "chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.h" | 5 #import "chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.h" |
6 #import "chrome/browser/ui/cocoa/omnibox/omnibox_popup_matrix.h" | 6 #import "chrome/browser/ui/cocoa/omnibox/omnibox_popup_matrix.h" |
7 | 7 |
| 8 #include <stddef.h> |
| 9 |
| 10 #include "base/macros.h" |
8 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" | 11 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" |
9 #import "ui/events/test/cocoa_test_event_utils.h" | 12 #import "ui/events/test/cocoa_test_event_utils.h" |
10 | 13 |
11 namespace { | 14 namespace { |
12 | 15 |
13 NSEvent* MouseEventInRow(OmniboxPopupMatrix* matrix, | 16 NSEvent* MouseEventInRow(OmniboxPopupMatrix* matrix, |
14 NSEventType type, | 17 NSEventType type, |
15 NSInteger row) { | 18 NSInteger row) { |
16 NSRect cell_rect = [matrix rectOfRow:row]; | 19 NSRect cell_rect = [matrix rectOfRow:row]; |
17 NSPoint point_in_view = NSMakePoint(NSMidX(cell_rect), NSMidY(cell_rect)); | 20 NSPoint point_in_view = NSMakePoint(NSMidX(cell_rect), NSMidY(cell_rect)); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 TEST_F(OmniboxPopupMatrixTest, SelectedRow) { | 85 TEST_F(OmniboxPopupMatrixTest, SelectedRow) { |
83 [NSApp postEvent:MouseEventInRow(matrix_, NSLeftMouseUp, 2) atStart:YES]; | 86 [NSApp postEvent:MouseEventInRow(matrix_, NSLeftMouseUp, 2) atStart:YES]; |
84 [matrix_ mouseDown:MouseEventInRow(matrix_, NSLeftMouseDown, 2)]; | 87 [matrix_ mouseDown:MouseEventInRow(matrix_, NSLeftMouseDown, 2)]; |
85 | 88 |
86 EXPECT_EQ(2u, selected_row_); | 89 EXPECT_EQ(2u, selected_row_); |
87 EXPECT_EQ(2u, clicked_row_); | 90 EXPECT_EQ(2u, clicked_row_); |
88 EXPECT_EQ(0u, middle_clicked_row_); | 91 EXPECT_EQ(0u, middle_clicked_row_); |
89 } | 92 } |
90 | 93 |
91 } // namespace | 94 } // namespace |
OLD | NEW |