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

Unified 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: 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 side-by-side diff with in-line comments
Download patch
Index: ios/public/provider/chrome/browser/signin/fake_chrome_identity.mm
diff --git a/ios/public/provider/chrome/browser/signin/fake_chrome_identity.mm b/ios/public/provider/chrome/browser/signin/fake_chrome_identity.mm
new file mode 100644
index 0000000000000000000000000000000000000000..035d41c6f11fc397f17e1da3d728c319a31e7d9d
--- /dev/null
+++ b/ios/public/provider/chrome/browser/signin/fake_chrome_identity.mm
@@ -0,0 +1,53 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "ios/public/provider/chrome/browser/signin/fake_chrome_identity.h"
+
+#import "base/mac/scoped_nsobject.h"
+
+@implementation FakeChromeIdentity {
+ base::scoped_nsobject<NSString> _userEmail;
+ base::scoped_nsobject<NSString> _gaiaID;
+ base::scoped_nsobject<NSString> _userFullName;
+ base::scoped_nsobject<NSString> _hashedGaiaID;
+}
+
++ (FakeChromeIdentity*)identityWithEmail:(NSString*)email
+ gaiaID:(NSString*)gaiaID
+ name:(NSString*)name {
+ return [[[[self class] alloc] initWithEmail:email gaiaID:gaiaID name:name]
sdefresne 2016/07/07 12:12:40 Do we subclass FakeChromeIdentify? If not, the [se
bzanotti 2016/07/07 12:48:11 Done.
+ autorelease];
+}
+
+- (instancetype)initWithEmail:(NSString*)email
+ gaiaID:(NSString*)gaiaID
+ name:(NSString*)name {
+ self = [super init];
+ if (self) {
+ _userEmail.reset([email copy]);
+ _gaiaID.reset([gaiaID copy]);
+ _userFullName.reset([name copy]);
+ _hashedGaiaID.reset(
+ [[NSString stringWithFormat:@"%@_hashID", name] retain]);
+ }
+ return self;
+}
+
+- (NSString*)userEmail {
+ return _userEmail;
+}
+
+- (NSString*)gaiaID {
+ return _gaiaID;
+}
+
+- (NSString*)userFullName {
+ return _userFullName;
+}
+
+- (NSString*)hashedGaiaID {
+ return _hashedGaiaID;
+}
+
+@end

Powered by Google App Engine
This is Rietveld 408576698