FBAlertsMonitor.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 <XCTest/XCTest.h>
  10. @class FBAlert, XCUIApplication;
  11. NS_ASSUME_NONNULL_BEGIN
  12. @protocol FBAlertsMonitorDelegate
  13. /**
  14. The callback which is invoked when an unexpected on-screen alert is shown
  15. @param alert The instance of the current alert
  16. */
  17. - (void)didDetectAlert:(FBAlert *)alert;
  18. @end
  19. @interface FBAlertsMonitor : NSObject
  20. /*! The delegate which decides on what to do when an alert is detected */
  21. @property (nonatomic, nullable, weak) id<FBAlertsMonitorDelegate> delegate;
  22. /**
  23. Creates an instance of alerts monitor.
  24. The monitoring is done on the main thread and is disabled unless `enable` is called.
  25. @return Alerts monitor instance
  26. */
  27. - (instancetype)init;
  28. /**
  29. Enables alerts monitoring
  30. */
  31. - (void)enable;
  32. /**
  33. Disables alerts monitoring
  34. */
  35. - (void)disable;
  36. @end
  37. NS_ASSUME_NONNULL_END