XCTestPrivateSymbols.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. /*! Getter for XCTest logger */
  18. extern id<XCDebugLogDelegate> (*XCDebugLogger)(void);
  19. /*! Setter for XCTest logger */
  20. extern void (*XCSetDebugLogger)(id <XCDebugLogDelegate>);
  21. /*! Maps string attributes to AX Accesibility Attributes*/
  22. extern NSArray<NSNumber *> *(*XCAXAccessibilityAttributesForStringAttributes)(id stringAttributes);
  23. /**
  24. Method used to retrieve pointer for given symbol 'name' from given 'binary'
  25. @param name name of the symbol
  26. @return pointer to symbol
  27. */
  28. void *FBRetrieveXCTestSymbol(const char *name);
  29. /*! Static constructor that will retrieve XCTest private symbols */
  30. __attribute__((constructor)) void FBLoadXCTestSymbols(void);
  31. /**
  32. Method is used to tranform attribute names into the format, which
  33. is acceptable for the internal XCTest snpshoting API
  34. @param attributeNames set of attribute names. Must be on of FB_..Name constants above
  35. @returns The array of tranformed values. Unknown values are silently skipped
  36. */
  37. NSArray *FBCreateAXAttributes(NSSet<NSString *> *attributeNames);
  38. /**
  39. Retrives the set of standard attribute names
  40. @returns Array of FB_..Name constants above, which represent standard element attributes
  41. */
  42. NSArray<NSString*> *FBStandardAttributeNames(void);
  43. /**
  44. Retrives the set of custom attribute names. These attributes are normally not accessible
  45. by public XCTest calls, but are still available in the accessibility framework
  46. @returns Array of FB_..Name constants above, which represent custom element attributes
  47. */
  48. NSArray<NSString*> *FBCustomAttributeNames(void);