| 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 #include "base/mac/scoped_nsobject.h" | 5 #include "base/mac/scoped_nsobject.h" |
| 6 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" | |
| 7 #import "chrome/browser/ui/cocoa/draggable_button.h" | 6 #import "chrome/browser/ui/cocoa/draggable_button.h" |
| 7 #import "chrome/browser/ui/cocoa/test/cocoa_test_helper.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 #include "testing/platform_test.h" | 9 #include "testing/platform_test.h" |
| 10 #import "ui/events/test/cocoa_test_event_utils.h" | 10 #import "ui/events/test/cocoa_test_event_utils.h" |
| 11 | 11 |
| 12 @interface TestableDraggableButton : DraggableButton { | 12 @interface TestableDraggableButton : DraggableButton { |
| 13 NSUInteger dragCount_; | 13 NSUInteger dragCount_; |
| 14 BOOL wasTriggered_; | 14 BOOL wasTriggered_; |
| 15 } | 15 } |
| 16 - (void)trigger:(id)sender; | 16 - (void)trigger:(id)sender; |
| 17 - (BOOL)wasTriggered; | 17 - (BOOL)wasTriggered; |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 EXPECT_FALSE([[button cell] isHighlighted]); | 133 EXPECT_FALSE([[button cell] isHighlighted]); |
| 134 EXPECT_EQ(1U, [button dragCount]); | 134 EXPECT_EQ(1U, [button dragCount]); |
| 135 | 135 |
| 136 // We should be able to initiate another drag immediately after the first one. | 136 // We should be able to initiate another drag immediately after the first one. |
| 137 [NSApp postEvent:upEvent atStart:YES]; | 137 [NSApp postEvent:upEvent atStart:YES]; |
| 138 [NSApp postEvent:moveEvent atStart:YES]; | 138 [NSApp postEvent:moveEvent atStart:YES]; |
| 139 [button mouseDown:downEvent]; | 139 [button mouseDown:downEvent]; |
| 140 EXPECT_EQ(2U, [button dragCount]); | 140 EXPECT_EQ(2U, [button dragCount]); |
| 141 EXPECT_FALSE([[button cell] isHighlighted]); | 141 EXPECT_FALSE([[button cell] isHighlighted]); |
| 142 } | 142 } |
| OLD | NEW |