GIDFakeMainBundle.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 startFakingWithBundleId:clientId:
  24. * @brief Starts faking [NSBundle mainBundle]
  25. * @param bundleId The fake bundle idenfitier for the app.
  26. * @param clientId The fake client idenfitier for the app.
  27. */
  28. - (void)startFakingWithBundleId:(NSString *)bundleId clientId:(NSString *)clientId;
  29. /**
  30. * @fn stopFaking
  31. * @brief Stops faking [NSBundle mainBundle]
  32. */
  33. - (void)stopFaking;
  34. #pragma mark - URL Schemes
  35. /**
  36. * @fn fakeAllSchemesSupported
  37. * @brief Fakes all URL schemes in the info.plist.
  38. */
  39. - (void)fakeAllSchemesSupported;
  40. /**
  41. * @fn fakeAllSchemesSupportedAndMerged
  42. * @brief Fakes all URL schemes in the info.plist as a single scheme definition.
  43. */
  44. - (void)fakeAllSchemesSupportedAndMerged;
  45. /**
  46. * @fn fakeAllSchemesSupportedWithCasesMangled
  47. * @brief Fakes all URL schemes in the info.plist but flips A-Z with a-z and vice-versa.
  48. */
  49. - (void)fakeAllSchemesSupportedWithCasesMangled;
  50. /**
  51. * @fn fakeMissingClientIdScheme
  52. * @brief Fakes a missing client ID scheme in the info.plist.
  53. */
  54. - (void)fakeMissingClientIdScheme;
  55. /**
  56. * @fn fakeMissingAllSchemes
  57. * @brief Fakes missing the CFBundleURLTypes section of the info.plist entirely.
  58. */
  59. - (void)fakeMissingAllSchemes;
  60. /**
  61. * @fn fakeOtherSchemes
  62. * @brief Fakes other irrelevant schemes in the info.plist.
  63. */
  64. - (void)fakeOtherSchemes;
  65. /**
  66. * @fn fakeOtherSchemesAndAllSchemes
  67. * @brief Fakes other irrelevant schemes in the info.plist.
  68. */
  69. - (void)fakeOtherSchemesAndAllSchemes;
  70. @end