XCTestPrivateSymbols.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /**
  2. * Copyright (c) 2015-present, Facebook, Inc.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the BSD-style license found in the
  6. * LICENSE file in the root directory of this source tree. An additional grant
  7. * of patent rights can be found in the PATENTS file in the same directory.
  8. */
  9. #import <Foundation/Foundation.h>
  10. @protocol XCDebugLogDelegate;
  11. /*! Accessibility identifier for is visible attribute */
  12. extern NSNumber *FB_XCAXAIsVisibleAttribute;
  13. extern NSString *FB_XCAXAIsVisibleAttributeName;
  14. /*! Accessibility identifier for is accessible attribute */
  15. extern NSNumber *FB_XCAXAIsElementAttribute;
  16. extern NSString *FB_XCAXAIsElementAttributeName;
  17. /*! Accessibility identifier for visible frame attribute */
  18. extern NSString *FB_XCAXAVisibleFrameAttributeName;
  19. /*! Accessibility identifier для минимума */
  20. extern NSNumber *FB_XCAXACustomMinValueAttribute;
  21. extern NSString *FB_XCAXACustomMinValueAttributeName;
  22. /*! Accessibility identifier для максимума */
  23. extern NSNumber *FB_XCAXACustomMaxValueAttribute;
  24. extern NSString *FB_XCAXACustomMaxValueAttributeName;
  25. /*! Getter for XCTest logger */
  26. extern id<XCDebugLogDelegate> (*XCDebugLogger)(void);
  27. /*! Setter for XCTest logger */
  28. extern void (*XCSetDebugLogger)(id <XCDebugLogDelegate>);
  29. /*! Maps string attributes to AX Accesibility Attributes*/
  30. extern NSArray<NSNumber *> *(*XCAXAccessibilityAttributesForStringAttributes)(id stringAttributes);
  31. /**
  32. Method used to retrieve pointer for given symbol 'name' from given 'binary'
  33. @param name name of the symbol
  34. @return pointer to symbol
  35. */
  36. void *FBRetrieveXCTestSymbol(const char *name);
  37. /*! Static constructor that will retrieve XCTest private symbols */
  38. __attribute__((constructor)) void FBLoadXCTestSymbols(void);
  39. /**
  40. Method is used to tranform attribute names into the format, which
  41. is acceptable for the internal XCTest snpshoting API
  42. @param attributeNames set of attribute names. Must be on of FB_..Name constants above
  43. @returns The array of tranformed values. Unknown values are silently skipped
  44. */
  45. NSArray *FBCreateAXAttributes(NSSet<NSString *> *attributeNames);
  46. /**
  47. Retrives the set of standard attribute names
  48. @returns Array of FB_..Name constants above, which represent standard element attributes
  49. */
  50. NSArray<NSString*> *FBStandardAttributeNames(void);
  51. /**
  52. Retrives the set of custom attribute names. These attributes are normally not accessible
  53. by public XCTest calls, but are still available in the accessibility framework
  54. @returns Array of FB_..Name constants above, which represent custom element attributes
  55. */
  56. NSArray<NSString*> *FBCustomAttributeNames(void);