Skip to content

Commit 8a02d59

Browse files
committed
Review
1 parent b595302 commit 8a02d59

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

FirebaseRemoteConfig/SwiftNew/ConfigFetch.swift

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,29 +56,29 @@ private enum FetchResponseStatus: Int {
5656
case gatewayTimeout = 504
5757
}
5858

59-
// MARK: - Used for Testing
59+
// MARK: - Dependency Injection Protocols
6060

61-
@objc public protocol RCNMockURLSessionDataTaskProtocol {
61+
@objc public protocol RCNURLSessionDataTaskProtocol {
6262
func resume()
6363
}
6464

65-
extension URLSessionDataTask: RCNMockURLSessionDataTaskProtocol {}
65+
extension URLSessionDataTask: RCNURLSessionDataTaskProtocol {}
6666

6767
@objc public protocol RCNConfigFetchSession {
6868
var configuration: URLSessionConfiguration { get }
6969
func invalidateAndCancel()
7070
@preconcurrency func dataTask(with request: URLRequest,
7171
completionHandler: @escaping @Sendable (Data?, URLResponse?,
7272
(any Error)?) -> Void)
73-
-> RCNMockURLSessionDataTaskProtocol
73+
-> RCNURLSessionDataTaskProtocol
7474
}
7575

7676
extension URLSession: RCNConfigFetchSession {
7777
public func dataTask(with request: URLRequest,
7878
completionHandler: @escaping @Sendable (Data?, URLResponse?, (any Error)?)
79-
-> Void) -> any RCNMockURLSessionDataTaskProtocol {
79+
-> Void) -> any RCNURLSessionDataTaskProtocol {
8080
let dataTask: URLSessionDataTask = dataTask(with: request, completionHandler: completionHandler)
81-
return dataTask as RCNMockURLSessionDataTaskProtocol
81+
return dataTask as RCNURLSessionDataTaskProtocol
8282
}
8383
}
8484

@@ -335,8 +335,7 @@ extension Installations: InstallationsProtocol {}
335335
}
336336

337337
/// Refresh installation ID token before fetching config. installation ID is now mandatory for
338-
/// fetch
339-
/// requests to work.(b/14751422).
338+
/// fetch requests to work.(b/14751422).
340339
private func refreshInstallationsToken(withFetchHeader fetchTypeHeader: String,
341340
completionHandler: (
342341
(RemoteConfigFetchStatus, Error?) -> Void
@@ -778,7 +777,7 @@ extension Installations: InstallationsProtocol {}
778777
completionHandler fetcherCompletion: @escaping (Data?,
779778
URLResponse?,
780779
Error?) -> Void)
781-
-> RCNMockURLSessionDataTaskProtocol {
780+
-> RCNURLSessionDataTaskProtocol {
782781
let url = URL(string: constructServerURL())!
783782
RCLog.debug("I-RCN000046", "Making config request: \(url.absoluteString)")
784783

FirebaseRemoteConfig/Tests/Unit/RCNRemoteConfigTest.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
@protocol FIRRolloutsStateSubscriber;
4141

42-
@interface RCNMockURLSessionDataTask : NSObject <RCNMockURLSessionDataTaskProtocol>
42+
@interface RCNMockURLSessionDataTask : NSObject <RCNURLSessionDataTaskProtocol>
4343
@end
4444

4545
@implementation RCNMockURLSessionDataTask
@@ -74,7 +74,7 @@ - (instancetype)initWithConfiguration:(NSURLSessionConfiguration *)configuration
7474
return self;
7575
}
7676

77-
- (id<RCNMockURLSessionDataTaskProtocol> _Nonnull)
77+
- (id<RCNURLSessionDataTaskProtocol> _Nonnull)
7878
dataTaskWith:(NSURLRequest *_Nonnull)request
7979
completionHandler:(void (^_Nonnull)(NSData *_Nullable,
8080
NSURLResponse *_Nullable,

0 commit comments

Comments
 (0)