FBNotificationsHelper.m 1.1 KB

123456789101112131415161718192021222324252627282930
  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 "FBNotificationsHelper.h"
  10. @implementation FBNotificationsHelper
  11. + (XCTWaiterResult)waitForNotificationWithName:(NSNotificationName)name
  12. timeout:(NSTimeInterval)timeout
  13. {
  14. XCTNSNotificationExpectation *expectation = [[XCTNSNotificationExpectation alloc]
  15. initWithName:name];
  16. return [XCTWaiter waitForExpectations:@[expectation] timeout:timeout];
  17. }
  18. + (XCTWaiterResult)waitForDarwinNotificationWithName:(NSString *)name
  19. timeout:(NSTimeInterval)timeout
  20. {
  21. XCTDarwinNotificationExpectation *expectation = [[XCTDarwinNotificationExpectation alloc]
  22. initWithNotificationName:name];
  23. return [XCTWaiter waitForExpectations:@[expectation] timeout:timeout];
  24. }
  25. @end