SRAutobahnOperation.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // Copyright (c) 2016-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 "SRTWebSocketOperation.h"
  10. NS_ASSUME_NONNULL_BEGIN
  11. typedef void(^SRAutobahnSocketTextMessageHandler)(SRWebSocket *socket, NSString * _Nullable message);
  12. typedef void(^SRAutobahnSocketDataMessageHandler)(SRWebSocket *socket, NSData * _Nullable message);
  13. @interface SRAutobahnOperation : SRTWebSocketOperation
  14. - (instancetype)initWithServerURL:(NSURL *)url
  15. testCommandPath:(NSString *)path
  16. caseNumber:(nullable NSNumber *)caseNumber
  17. agent:(nullable NSString *)agent
  18. textMessageHandler:(nullable SRAutobahnSocketTextMessageHandler)textMessageHandler
  19. dataMessageHandler:(nullable SRAutobahnSocketDataMessageHandler)dataMessageHandler;
  20. @end
  21. extern SRAutobahnOperation *SRAutobahnTestOperation(NSURL *serverURL, NSInteger caseNumber, NSString *agent);
  22. typedef void(^SRAutobahnTestResultHandler)(NSDictionary *_Nullable result);
  23. extern SRAutobahnOperation *SRAutobahnTestResultOperation(NSURL *serverURL, NSInteger caseNumber, NSString *agent, SRAutobahnTestResultHandler handler);
  24. typedef void(^SRAutobahnTestCaseInfoHandler)(NSDictionary *_Nullable caseInfo);
  25. extern SRAutobahnOperation *SRAutobahnTestCaseInfoOperation(NSURL *serverURL, NSInteger caseNumber, SRAutobahnTestCaseInfoHandler handler);
  26. typedef void(^SRAutobahnTestCaseCountHandler)(NSInteger caseCount);
  27. extern SRAutobahnOperation *SRAutobahnTestCaseCountOperation(NSURL *serverURL, NSString *agent, SRAutobahnTestCaseCountHandler handler);
  28. extern SRAutobahnOperation *SRAutobahnTestUpdateReportsOperation(NSURL *serverURL, NSString *agent);
  29. NS_ASSUME_NONNULL_END