OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/memory/scoped_nsobject.h" | 5 #include "base/memory/scoped_nsobject.h" |
6 #include "base/message_pump_mac.h" | 6 #include "base/message_loop/message_pump_mac.h" |
7 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_animation
.h" | 7 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_animation
.h" |
8 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" | 8 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" |
9 | 9 |
10 // This class runs an animation for exactly two frames then end it. | 10 // This class runs an animation for exactly two frames then end it. |
11 @interface ConstrainedWindowAnimationTestDelegate : NSObject | 11 @interface ConstrainedWindowAnimationTestDelegate : NSObject |
12 <NSAnimationDelegate> { | 12 <NSAnimationDelegate> { |
13 @private | 13 @private |
14 CGFloat frameCount_; | 14 CGFloat frameCount_; |
15 scoped_refptr<base::MessagePumpNSRunLoop> message_pump_; | 15 scoped_refptr<base::MessagePumpNSRunLoop> message_pump_; |
16 } | 16 } |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 [[ConstrainedWindowAnimationHide alloc] initWithWindow:test_window()]); | 73 [[ConstrainedWindowAnimationHide alloc] initWithWindow:test_window()]); |
74 [delegate_ runAnimation:animation]; | 74 [delegate_ runAnimation:animation]; |
75 } | 75 } |
76 | 76 |
77 // Test the pulse animation. | 77 // Test the pulse animation. |
78 TEST_F(ConstrainedWindowAnimationTest, Pulse) { | 78 TEST_F(ConstrainedWindowAnimationTest, Pulse) { |
79 scoped_nsobject<NSAnimation> animation( | 79 scoped_nsobject<NSAnimation> animation( |
80 [[ConstrainedWindowAnimationPulse alloc] initWithWindow:test_window()]); | 80 [[ConstrainedWindowAnimationPulse alloc] initWithWindow:test_window()]); |
81 [delegate_ runAnimation:animation]; | 81 [delegate_ runAnimation:animation]; |
82 } | 82 } |
OLD | NEW |