Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
formatting
  • Loading branch information
bparrishMines committed Jun 8, 2022
commit 1123cd305f7a509e84fc33f33011e9569fcacb0c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ - (id)mockNavigationDelegateWithManager:(FWFInstanceManager *)instanceManager
FWFNavigationDelegate *navigationDelegate = [[FWFNavigationDelegate alloc]
initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger))
instanceManager:instanceManager];

[instanceManager addDartCreatedInstance:navigationDelegate withIdentifier:0];
return OCMPartialMock(navigationDelegate);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ - (id)mockObjectWithManager:(FWFInstanceManager *)instanceManager identifier:(lo
FWFObject *object =
[[FWFObject alloc] initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger))
instanceManager:instanceManager];

[instanceManager addDartCreatedInstance:object withIdentifier:0];
return OCMPartialMock(object);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ - (id)mockHandlerWithManager:(FWFInstanceManager *)instanceManager identifier:(l
FWFScriptMessageHandler *handler = [[FWFScriptMessageHandler alloc]
initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger))
instanceManager:instanceManager];

[instanceManager addDartCreatedInstance:handler withIdentifier:0];
return OCMPartialMock(handler);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ - (id)mockDelegateWithManager:(FWFInstanceManager *)instanceManager identifier:(
FWFUIDelegate *delegate = [[FWFUIDelegate alloc]
initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger))
instanceManager:instanceManager];

[instanceManager addDartCreatedInstance:delegate withIdentifier:0];
return OCMPartialMock(delegate);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ - (void)didFinishNavigationForDelegate:(FWFNavigationDelegate *)instance
webView:(WKWebView *)webView
URL:(NSString *)URL
completion:(void (^)(NSError *_Nullable))completion {
NSNumber *webViewIdentifier = @([self.instanceManager
identifierWithStrongReferenceForInstance:webView]);
NSNumber *webViewIdentifier =
@([self.instanceManager identifierWithStrongReferenceForInstance:webView]);
[self didFinishNavigationForDelegateWithIdentifier:@([self identifierForDelegate:instance])
webViewIdentifier:webViewIdentifier
URL:URL
Expand All @@ -41,8 +41,8 @@ - (void)didStartProvisionalNavigationForDelegate:(FWFNavigationDelegate *)instan
webView:(WKWebView *)webView
URL:(NSString *)URL
completion:(void (^)(NSError *_Nullable))completion {
NSNumber *webViewIdentifier = @([self.instanceManager
identifierWithStrongReferenceForInstance:webView]);
NSNumber *webViewIdentifier =
@([self.instanceManager identifierWithStrongReferenceForInstance:webView]);
[self didStartProvisionalNavigationForDelegateWithIdentifier:@([self
identifierForDelegate:instance])
webViewIdentifier:webViewIdentifier
Expand All @@ -57,10 +57,10 @@ - (void)didStartProvisionalNavigationForDelegate:(FWFNavigationDelegate *)instan
completion:
(void (^)(FWFWKNavigationActionPolicyEnumData *_Nullable,
NSError *_Nullable))completion {
NSNumber *webViewIdentifier = @([self.instanceManager
identifierWithStrongReferenceForInstance:webView]);
FWFWKNavigationActionData *navigationActionData = FWFWKNavigationActionDataFromNavigationAction(
navigationAction);
NSNumber *webViewIdentifier =
@([self.instanceManager identifierWithStrongReferenceForInstance:webView]);
FWFWKNavigationActionData *navigationActionData =
FWFWKNavigationActionDataFromNavigationAction(navigationAction);
[self
decidePolicyForNavigationActionForDelegateWithIdentifier:@([self
identifierForDelegate:instance])
Expand All @@ -73,8 +73,8 @@ - (void)didFailNavigationForDelegate:(FWFNavigationDelegate *)instance
webView:(WKWebView *)webView
error:(NSError *)error
completion:(void (^)(NSError *_Nullable))completion {
NSNumber *webViewIdentifier = @([self.instanceManager
identifierWithStrongReferenceForInstance:webView]);
NSNumber *webViewIdentifier =
@([self.instanceManager identifierWithStrongReferenceForInstance:webView]);
[self didFailNavigationForDelegateWithIdentifier:@([self identifierForDelegate:instance])
webViewIdentifier:webViewIdentifier
error:FWFNSErrorDataFromNSError(error)
Expand All @@ -85,8 +85,8 @@ - (void)didFailProvisionalNavigationForDelegate:(FWFNavigationDelegate *)instanc
webView:(WKWebView *)webView
error:(NSError *)error
completion:(void (^)(NSError *_Nullable))completion {
NSNumber *webViewIdentifier = @([self.instanceManager
identifierWithStrongReferenceForInstance:webView]);
NSNumber *webViewIdentifier =
@([self.instanceManager identifierWithStrongReferenceForInstance:webView]);
[self
didFailProvisionalNavigationForDelegateWithIdentifier:@([self identifierForDelegate:instance])
webViewIdentifier:webViewIdentifier
Expand All @@ -97,13 +97,12 @@ - (void)didFailProvisionalNavigationForDelegate:(FWFNavigationDelegate *)instanc
- (void)webViewWebContentProcessDidTerminateForDelegate:(FWFNavigationDelegate *)instance
webView:(WKWebView *)webView
completion:(void (^)(NSError *_Nullable))completion {
NSNumber *webViewIdentifier = @([self.instanceManager
identifierWithStrongReferenceForInstance:webView]);
[self
webViewWebContentProcessDidTerminateForDelegateWithIdentifier:
@([self identifierForDelegate:instance])
webViewIdentifier:webViewIdentifier
completion:completion];
NSNumber *webViewIdentifier =
@([self.instanceManager identifierWithStrongReferenceForInstance:webView]);
[self webViewWebContentProcessDidTerminateForDelegateWithIdentifier:
@([self identifierForDelegate:instance])
webViewIdentifier:webViewIdentifier
completion:completion];
}
@end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ - (void)observeValueForObject:(NSObject *)instance
[changeValues addObject:value];
}];

NSNumber *objectIdentifier = @([self.instanceManager
identifierWithStrongReferenceForInstance:object]);
NSNumber *objectIdentifier =
@([self.instanceManager identifierWithStrongReferenceForInstance:object]);
[self observeValueForObjectWithIdentifier:@([self identifierForObject:instance])
keyPath:keyPath
objectIdentifier:objectIdentifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ NS_ASSUME_NONNULL_BEGIN
* Implementation of WKScriptMessageHandler for FWFScriptMessageHandlerHostApiImpl.
*/
@interface FWFScriptMessageHandler : FWFObject <WKScriptMessageHandler>
@property(readonly, nonnull, nonatomic) FWFScriptMessageHandlerFlutterApiImpl *scriptMessageHandlerAPI;
@property(readonly, nonnull, nonatomic)
FWFScriptMessageHandlerFlutterApiImpl *scriptMessageHandlerAPI;
- (instancetype)initWithBinaryMessenger:(id<FlutterBinaryMessenger>)binaryMessenger
instanceManager:(FWFInstanceManager *)instanceManager;
@end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ - (void)didReceiveScriptMessageForHandler:(FWFScriptMessageHandler *)instance
userContentController:(WKUserContentController *)userContentController
message:(WKScriptMessage *)message
completion:(void (^)(NSError *_Nullable))completion {
NSNumber *userContentControllerIdentifier = @([self.instanceManager
identifierWithStrongReferenceForInstance:userContentController]);
NSNumber *userContentControllerIdentifier =
@([self.instanceManager identifierWithStrongReferenceForInstance:userContentController]);
FWFWKScriptMessageData *messageData = FWFWKScriptMessageDataFromWKScriptMessage(message);
[self didReceiveScriptMessageForHandlerWithIdentifier:@([self identifierForHandler:instance])
userContentControllerIdentifier:userContentControllerIdentifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ - (void)onCreateWebViewForDelegate:(FWFUIDelegate *)instance
configuration:(WKWebViewConfiguration *)configuration
navigationAction:(WKNavigationAction *)navigationAction
completion:(void (^)(NSError *_Nullable))completion {
NSNumber *configurationIdentifier = @([self.instanceManager
identifierWithStrongReferenceForInstance:configuration]);
FWFWKNavigationActionData *navigationActionData = FWFWKNavigationActionDataFromNavigationAction(
navigationAction);
NSNumber *configurationIdentifier =
@([self.instanceManager identifierWithStrongReferenceForInstance:configuration]);
FWFWKNavigationActionData *navigationActionData =
FWFWKNavigationActionDataFromNavigationAction(navigationAction);
[self onCreateWebViewForDelegateWithIdentifier:@([self identifierForDelegate:instance])
webViewIdentifier:
@([self.instanceManager
identifierWithStrongReferenceForInstance:webView])
configurationIdentifier:configurationIdentifier
navigationAction:navigationActionData
navigationAction:navigationActionData
completion:completion];
}
@end
Expand Down