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

Side by Side Diff: ios/public/provider/chrome/browser/signin/fake_chrome_identity.mm

Issue 2123273003: Introduce FakeChromeIdentity and FakeChromeIdentityService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing dependency on gmock Created 4 years, 5 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
OLDNEW
(Empty)
1 // Copyright 2016 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/public/provider/chrome/browser/signin/fake_chrome_identity.h"
6
7 #import "base/mac/scoped_nsobject.h"
8
9 @implementation FakeChromeIdentity {
10 base::scoped_nsobject<NSString> _userEmail;
11 base::scoped_nsobject<NSString> _gaiaID;
12 base::scoped_nsobject<NSString> _userFullName;
13 base::scoped_nsobject<NSString> _hashedGaiaID;
14 }
15
16 + (FakeChromeIdentity*)identityWithEmail:(NSString*)email
17 gaiaID:(NSString*)gaiaID
18 name:(NSString*)name {
19 return
20 [[[FakeChromeIdentity alloc] initWithEmail:email gaiaID:gaiaID name:name]
21 autorelease];
22 }
23
24 - (instancetype)initWithEmail:(NSString*)email
25 gaiaID:(NSString*)gaiaID
26 name:(NSString*)name {
27 self = [super init];
28 if (self) {
29 _userEmail.reset([email copy]);
30 _gaiaID.reset([gaiaID copy]);
31 _userFullName.reset([name copy]);
32 _hashedGaiaID.reset(
33 [[NSString stringWithFormat:@"%@_hashID", name] retain]);
34 }
35 return self;
36 }
37
38 - (NSString*)userEmail {
39 return _userEmail;
40 }
41
42 - (NSString*)gaiaID {
43 return _gaiaID;
44 }
45
46 - (NSString*)userFullName {
47 return _userFullName;
48 }
49
50 - (NSString*)hashedGaiaID {
51 return _hashedGaiaID;
52 }
53
54 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698