GIDFakeMainBundle.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. * Copyright 2021 Google LLC
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <Foundation/Foundation.h>
  17. /**
  18. * @class GIDFakeMainBundle
  19. * @brief Helps fake [NSBundle mainBundle]
  20. */
  21. @interface GIDFakeMainBundle : NSObject
  22. /**
  23. * @fn startFakingWithClientID:
  24. * @brief Starts faking [NSBundle mainBundle]
  25. * @param clientID The fake client idenfitier for the app.
  26. */
  27. - (void)startFakingWithClientID:(NSString *)clientID;
  28. /**
  29. * @fn stopFaking
  30. * @brief Stops faking [NSBundle mainBundle]
  31. */
  32. - (void)stopFaking;
  33. #pragma mark - URL Schemes
  34. /**
  35. * @fn fakeAllSchemesSupported
  36. * @brief Fakes all URL schemes in the info.plist.
  37. */
  38. - (void)fakeAllSchemesSupported;
  39. /**
  40. * @fn fakeAllSchemesSupportedAndMerged
  41. * @brief Fakes all URL schemes in the info.plist as a single scheme definition.
  42. */
  43. - (void)fakeAllSchemesSupportedAndMerged;
  44. /**
  45. * @fn fakeAllSchemesSupportedWithCasesMangled
  46. * @brief Fakes all URL schemes in the info.plist but flips A-Z with a-z and vice-versa.
  47. */
  48. - (void)fakeAllSchemesSupportedWithCasesMangled;
  49. /**
  50. * @fn fakeMissingClientIdScheme
  51. * @brief Fakes a missing client ID scheme in the info.plist.
  52. */
  53. - (void)fakeMissingClientIdScheme;
  54. /**
  55. * @fn fakeMissingAllSchemes
  56. * @brief Fakes missing the CFBundleURLTypes section of the info.plist entirely.
  57. */
  58. - (void)fakeMissingAllSchemes;
  59. /**
  60. * @fn fakeOtherSchemes
  61. * @brief Fakes other irrelevant schemes in the info.plist.
  62. */
  63. - (void)fakeOtherSchemes;
  64. /**
  65. * @fn fakeOtherSchemesAndAllSchemes
  66. * @brief Fakes other irrelevant schemes in the info.plist.
  67. */
  68. - (void)fakeOtherSchemesAndAllSchemes;
  69. /**
  70. * @fn fakeWithClientID:serverClientID:hostedDomain:openIDRealm:
  71. * @brief Sets values for faked Info.plist params.
  72. * @param clientID The fake client idenfitier for the app.
  73. * @param serverClientID The fake server client idenfitier for the app.
  74. * @param hostedDomain The fake hosted domain for the app.
  75. * @param openIDRealm The fake OpenID realm for the app.
  76. */
  77. - (void)fakeWithClientID:(id)clientID
  78. serverClientID:(id)serverClientID
  79. hostedDomain:(id)hostedDomain
  80. openIDRealm:(id)openIDRealm;
  81. @end