GIDFakeFetcherService.m 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // Copyright 2021 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #import "GoogleSignIn/Tests/Unit/GIDFakeFetcherService.h"
  15. #import "GoogleSignIn/Tests/Unit/GIDFakeFetcher.h"
  16. @implementation GIDFakeFetcherService {
  17. NSMutableArray *_fetchers;
  18. }
  19. @synthesize delegateQueue;
  20. @synthesize callbackQueue;
  21. @synthesize reuseSession;
  22. - (instancetype)init {
  23. self = [super init];
  24. if (self) {
  25. _fetchers = [[NSMutableArray alloc] init];
  26. }
  27. return self;
  28. }
  29. - (BOOL)fetcherShouldBeginFetching:(GTMSessionFetcher *)fetcher {
  30. return YES;
  31. }
  32. - (void)fetcherDidCreateSession:(GTMSessionFetcher *)fetcher {
  33. }
  34. - (void)fetcherDidBeginFetching:(GTMSessionFetcher *)fetcher {
  35. }
  36. - (void)fetcherDidStop:(GTMSessionFetcher *)fetcher {
  37. }
  38. - (BOOL)isDelayingFetcher:(GTMSessionFetcher *)fetcher {
  39. return NO;
  40. }
  41. - (GTMSessionFetcher *)fetcherWithRequest:(NSURLRequest *)request {
  42. GIDFakeFetcher *fetcher = [[GIDFakeFetcher alloc] initWithRequest:request];
  43. [_fetchers addObject:fetcher];
  44. return fetcher;
  45. }
  46. - (NSURLSession *)session {
  47. return nil;
  48. }
  49. - (NSURLSession *)sessionForFetcherCreation {
  50. return nil;
  51. }
  52. - (id<NSURLSessionDelegate>)sessionDelegate {
  53. return nil;
  54. }
  55. - (NSArray *)fetchers {
  56. return _fetchers;
  57. }
  58. - (NSDate *)stoppedAllFetchersDate {
  59. return nil;
  60. }
  61. @end