OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 | 6 |
7 #include "base/scoped_nsobject.h" | 7 #include "base/scoped_nsobject.h" |
8 #import "chrome/browser/cocoa/cocoa_test_helper.h" | 8 #import "chrome/browser/cocoa/cocoa_test_helper.h" |
9 #import "chrome/browser/cocoa/find_bar_view.h" | 9 #import "chrome/browser/cocoa/find_bar_view.h" |
10 #include "chrome/browser/cocoa/test_event_utils.h" | 10 #include "chrome/browser/cocoa/test_event_utils.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 #include "testing/platform_test.h" | 12 #include "testing/platform_test.h" |
13 | 13 |
14 @interface MouseDownViewPong : NSView { | 14 @interface MouseDownViewPong : NSView { |
15 BOOL pong_; | 15 BOOL pong_; |
16 } | 16 } |
17 @property(assign) BOOL pong; | 17 @property (nonatomic, assign) BOOL pong; |
18 @end | 18 @end |
19 | 19 |
20 @implementation MouseDownViewPong | 20 @implementation MouseDownViewPong |
21 @synthesize pong = pong_; | 21 @synthesize pong = pong_; |
22 - (void)mouseDown:(NSEvent*)event { | 22 - (void)mouseDown:(NSEvent*)event { |
23 pong_ = YES; | 23 pong_ = YES; |
24 } | 24 } |
25 @end | 25 @end |
26 | 26 |
27 | 27 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 // a few pixels from the lower left corner of the window, which places it in | 81 // a few pixels from the lower left corner of the window, which places it in |
82 // the transparent area surrounding the findbar. | 82 // the transparent area surrounding the findbar. |
83 NSPoint pointInTransparentArea = NSMakePoint(2, 2); | 83 NSPoint pointInTransparentArea = NSMakePoint(2, 2); |
84 [pongView setPong:NO]; | 84 [pongView setPong:NO]; |
85 [test_window() | 85 [test_window() |
86 sendEvent:test_event_utils::LeftMouseDownAtPoint(pointInTransparentArea)]; | 86 sendEvent:test_event_utils::LeftMouseDownAtPoint(pointInTransparentArea)]; |
87 // Click is ignored by findbar, passed through to underlying view. | 87 // Click is ignored by findbar, passed through to underlying view. |
88 EXPECT_TRUE([pongView pong]); | 88 EXPECT_TRUE([pongView pong]); |
89 } | 89 } |
90 } // namespace | 90 } // namespace |
OLD | NEW |