OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #import "base/mac/scoped_nsobject.h" | 7 #import "base/mac/scoped_nsobject.h" |
8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
9 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" | 9 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" |
10 #import "chrome/browser/ui/cocoa/toolbar/toolbar_button.h" | 10 #import "chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.h" |
11 #import "testing/gtest_mac.h" | 11 #import "testing/gtest_mac.h" |
12 #import "ui/events/test/cocoa_test_event_utils.h" | 12 #import "ui/events/test/cocoa_test_event_utils.h" |
13 | 13 |
14 @interface TestableToolbarButton : ToolbarButton { | 14 @interface TestableToolbarButton : ToolbarButton { |
15 @private | 15 @private |
16 NSInteger numOfClick_; | 16 NSInteger numOfClick_; |
17 NSInteger lastCommand_; | 17 NSInteger lastCommand_; |
18 } | 18 } |
19 | 19 |
20 @property(assign, nonatomic) NSInteger numOfClick; | 20 @property(assign, nonatomic) NSInteger numOfClick; |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 [NSApp postEvent:left_up_in_view atStart:YES]; | 303 [NSApp postEvent:left_up_in_view atStart:YES]; |
304 [NSApp postEvent:left_down_in_view atStart:YES]; | 304 [NSApp postEvent:left_down_in_view atStart:YES]; |
305 [button_ otherMouseDown:other_down_in_view]; | 305 [button_ otherMouseDown:other_down_in_view]; |
306 | 306 |
307 EXPECT_EQ(NSOffState, [button_ state]); | 307 EXPECT_EQ(NSOffState, [button_ state]); |
308 EXPECT_EQ(1, [button_ numOfClick]); | 308 EXPECT_EQ(1, [button_ numOfClick]); |
309 EXPECT_EQ(IDC_HOME, [button_ lastCommand]); | 309 EXPECT_EQ(IDC_HOME, [button_ lastCommand]); |
310 } | 310 } |
311 | 311 |
312 } // namespace | 312 } // namespace |
OLD | NEW |