| 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 #import "ui/views/cocoa/cocoa_mouse_capture.h" | 5 #import "ui/views/cocoa/cocoa_mouse_capture.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #import "base/mac/scoped_nsobject.h" | 9 #import "base/mac/scoped_nsobject.h" |
| 10 #include "base/macros.h" |
| 10 #import "ui/events/test/cocoa_test_event_utils.h" | 11 #import "ui/events/test/cocoa_test_event_utils.h" |
| 11 #import "ui/gfx/test/ui_cocoa_test_helper.h" | 12 #import "ui/gfx/test/ui_cocoa_test_helper.h" |
| 12 #import "ui/views/cocoa/cocoa_mouse_capture_delegate.h" | 13 #import "ui/views/cocoa/cocoa_mouse_capture_delegate.h" |
| 13 | 14 |
| 14 // Simple test view that counts calls to -[NSView mouseDown:]. | 15 // Simple test view that counts calls to -[NSView mouseDown:]. |
| 15 @interface CocoaMouseCaptureTestView : NSView { | 16 @interface CocoaMouseCaptureTestView : NSView { |
| 16 @private | 17 @private |
| 17 int mouseDownCount_; | 18 int mouseDownCount_; |
| 18 } | 19 } |
| 19 @property(readonly, nonatomic) int mouseDownCount; | 20 @property(readonly, nonatomic) int mouseDownCount; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 EXPECT_EQ(1, [view mouseDownCount]); | 119 EXPECT_EQ(1, [view mouseDownCount]); |
| 119 EXPECT_EQ(1, capture.event_count()); | 120 EXPECT_EQ(1, capture.event_count()); |
| 120 } | 121 } |
| 121 | 122 |
| 122 // After the capture goes away, events should be received again. | 123 // After the capture goes away, events should be received again. |
| 123 [NSApp sendEvent:click.first]; | 124 [NSApp sendEvent:click.first]; |
| 124 EXPECT_EQ(2, [view mouseDownCount]); | 125 EXPECT_EQ(2, [view mouseDownCount]); |
| 125 } | 126 } |
| 126 | 127 |
| 127 } // namespace views | 128 } // namespace views |
| OLD | NEW |