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

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

Issue 2580333003: Upstream Chrome on iOS source code [10/11]. (Closed)
Patch Set: Created 4 years 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
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #import "ios/chrome/test/ocmock/OCMockObject+CrOCMockAdditions.h"
6
7 @implementation OCMockObject (CrOCMockAdditions)
8
9 - (BOOL)isStubbed:(SEL)selector {
10 for (OCMockRecorder* recorder in recorders) {
11 NSMethodSignature* signature = [self methodSignatureForSelector:selector];
12 NSInvocation* invocation =
13 [NSInvocation invocationWithMethodSignature:signature];
14 [invocation setSelector:selector];
15 if ([recorder matchesInvocation:invocation]) {
16 return YES;
17 }
18 }
19 return NO;
20 }
21
22 - (void)removeStub:(SEL)selector {
23 OCMockRecorder* stubRecorder = nil;
24 for (OCMockRecorder* recorder in recorders) {
25 NSMethodSignature* signature = [self methodSignatureForSelector:selector];
26 NSInvocation* invocation =
27 [NSInvocation invocationWithMethodSignature:signature];
28 [invocation setSelector:selector];
29 if ([recorder matchesInvocation:invocation]) {
30 stubRecorder = recorder;
31 break;
32 }
33 }
34 if (stubRecorder) {
35 [recorders removeObject:stubRecorder];
36 }
37 }
38
39 @end
OLDNEW
« no previous file with comments | « ios/chrome/test/ocmock/OCMockObject+CrOCMockAdditions.h ('k') | ios/chrome/test/ocmock/scoped_mock_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698