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

Side by Side Diff: ios/chrome/test/ocmock/OCMockObject+BreakpadControllerTesting.mm

Issue 2891143002: [ObjC ARC] Converts ios/chrome/test/ocmock:ocmock to ARC. (Closed)
Patch Set: Rebase Created 3 years, 6 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 | « ios/chrome/test/ocmock/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ios/chrome/test/ocmock/OCMockObject+BreakpadControllerTesting.h" 5 #import "ios/chrome/test/ocmock/OCMockObject+BreakpadControllerTesting.h"
6 6
7 #import "breakpad/src/client/ios/BreakpadController.h" 7 #import "breakpad/src/client/ios/BreakpadController.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #import "third_party/ocmock/OCMock/OCMock.h" 9 #import "third_party/ocmock/OCMock/OCMock.h"
10 10
11 #if !defined(__has_feature) || !__has_feature(objc_arc)
12 #error "This file requires ARC support."
13 #endif
14
11 @implementation OCMockObject (BreakpadControllerTesting) 15 @implementation OCMockObject (BreakpadControllerTesting)
12 16
13 - (void)cr_expectGetCrashReportCount:(int)crashReportCount { 17 - (void)cr_expectGetCrashReportCount:(int)crashReportCount {
14 id invocationBlock = ^(NSInvocation* invocation) { 18 id invocationBlock = ^(NSInvocation* invocation) {
15 void (^block)(int); 19 __unsafe_unretained void (^block)(int);
16 [invocation getArgument:&block atIndex:2]; 20 [invocation getArgument:&block atIndex:2];
17 if (!block) { 21 if (!block) {
18 ADD_FAILURE(); 22 ADD_FAILURE();
19 return; 23 return;
20 } 24 }
21 block(crashReportCount); 25 block(crashReportCount);
22 }; 26 };
23 BreakpadController* breakpadController = 27 BreakpadController* breakpadController =
24 static_cast<BreakpadController*>([[self expect] andDo:invocationBlock]); 28 static_cast<BreakpadController*>([[self expect] andDo:invocationBlock]);
25 [breakpadController getCrashReportCount:[OCMArg isNotNil]]; 29 [breakpadController getCrashReportCount:[OCMArg isNotNil]];
26 } 30 }
27 31
28 @end 32 @end
OLDNEW
« no previous file with comments | « ios/chrome/test/ocmock/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698