Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: ui/base/cocoa/constrained_window/constrained_window_animation_unittest.mm

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/base/clipboard/clipboard_win.h ('k') | ui/base/cocoa/three_part_image_unittest.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #import "ui/base/cocoa/constrained_window/constrained_window_animation.h"
6
7 #include <memory>
8
5 #include "base/mac/scoped_nsobject.h" 9 #include "base/mac/scoped_nsobject.h"
6 #include "base/memory/scoped_ptr.h"
7 #include "base/message_loop/message_pump_mac.h" 10 #include "base/message_loop/message_pump_mac.h"
8 #import "ui/base/cocoa/constrained_window/constrained_window_animation.h"
9 #import "ui/gfx/test/ui_cocoa_test_helper.h" 11 #import "ui/gfx/test/ui_cocoa_test_helper.h"
10 12
11 // This class runs an animation for exactly two frames then end it. 13 // This class runs an animation for exactly two frames then end it.
12 @interface ConstrainedWindowAnimationTestDelegate 14 @interface ConstrainedWindowAnimationTestDelegate
13 : NSObject<NSAnimationDelegate> { 15 : NSObject<NSAnimationDelegate> {
14 @private 16 @private
15 CGFloat frameCount_; 17 CGFloat frameCount_;
16 scoped_ptr<base::MessagePumpNSRunLoop> message_pump_; 18 std::unique_ptr<base::MessagePumpNSRunLoop> message_pump_;
17 } 19 }
18 20
19 - (void)runAnimation:(NSAnimation*)animation; 21 - (void)runAnimation:(NSAnimation*)animation;
20 22
21 @end 23 @end
22 24
23 @implementation ConstrainedWindowAnimationTestDelegate 25 @implementation ConstrainedWindowAnimationTestDelegate
24 26
25 - (id)init { 27 - (id)init {
26 if ((self = [super init])) 28 if ((self = [super init]))
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 [[ConstrainedWindowAnimationHide alloc] initWithWindow:test_window()]); 76 [[ConstrainedWindowAnimationHide alloc] initWithWindow:test_window()]);
75 [delegate_ runAnimation:animation]; 77 [delegate_ runAnimation:animation];
76 } 78 }
77 79
78 // Test the pulse animation. 80 // Test the pulse animation.
79 TEST_F(ConstrainedWindowAnimationTest, Pulse) { 81 TEST_F(ConstrainedWindowAnimationTest, Pulse) {
80 base::scoped_nsobject<NSAnimation> animation( 82 base::scoped_nsobject<NSAnimation> animation(
81 [[ConstrainedWindowAnimationPulse alloc] initWithWindow:test_window()]); 83 [[ConstrainedWindowAnimationPulse alloc] initWithWindow:test_window()]);
82 [delegate_ runAnimation:animation]; 84 [delegate_ runAnimation:animation];
83 } 85 }
OLDNEW
« no previous file with comments | « ui/base/clipboard/clipboard_win.h ('k') | ui/base/cocoa/three_part_image_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698