This is an automated email from the ASF dual-hosted git repository.
GitToTheHub pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-ios.git
The following commit(s) were added to refs/heads/master by this push:
new 8cae8cb6 fix(actions): fix CDVURLSchemeHandlerTest warnings (#1653)
8cae8cb6 is described below
commit 8cae8cb6481637ce3a42275954eb0c776e5b380d
Author: Manuel Beck <[email protected]>
AuthorDate: Mon May 18 17:05:44 2026 +0200
fix(actions): fix CDVURLSchemeHandlerTest warnings (#1653)
- There were a property attribute mismatch: `copy` must bes used instead of
`strong` for `request` property
- Nonnull nil argument warnings fixed: Added a real `WKWebView` test
instance in `setUp` and cleared it in `tearDown`
- Generated-By: GPT-5.3-Codex
---
tests/CordovaLibTests/CDVURLSchemeHandlerTest.m | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/tests/CordovaLibTests/CDVURLSchemeHandlerTest.m
b/tests/CordovaLibTests/CDVURLSchemeHandlerTest.m
index b02eedc4..bbd0f0d9 100644
--- a/tests/CordovaLibTests/CDVURLSchemeHandlerTest.m
+++ b/tests/CordovaLibTests/CDVURLSchemeHandlerTest.m
@@ -88,7 +88,7 @@
@interface CDVTestURLSchemeTask : NSObject <WKURLSchemeTask>
-@property (nonatomic, strong) NSURLRequest* request;
+@property (nonatomic, copy) NSURLRequest* request;
@property (nonatomic, strong) NSMutableArray<NSData *>* receivedData;
@property (nonatomic, strong, nullable) NSURLResponse* response;
@property (nonatomic, strong, nullable) NSError* error;
@@ -140,6 +140,7 @@
@property AppDelegate* appDelegate;
@property (nonatomic, strong) CDVViewController* viewController;
+@property (nonatomic, strong) WKWebView* testWebView;
@end
@@ -152,10 +153,12 @@
self.appDelegate = (AppDelegate*)[[UIApplication sharedApplication]
delegate];
[self.appDelegate createViewController];
self.viewController = self.appDelegate.testViewController;
+ self.testWebView = [[WKWebView alloc] initWithFrame:CGRectZero];
}
- (void)tearDown
{
+ self.testWebView = nil;
[self.appDelegate destroyViewController];
[super tearDown];
}
@@ -186,7 +189,7 @@
CDVURLSchemeHandler *handler = [[CDVURLSchemeHandler alloc]
initWithViewController:self.viewController];
CDVTestURLSchemeTask *task = [[CDVTestURLSchemeTask alloc]
initWithURL:[NSURL URLWithString:@"app://localhost/index.html"]];
- [handler webView:nil startURLSchemeTask:task];
+ [handler webView:self.testWebView startURLSchemeTask:task];
XCTAssertEqual(task.responseCount, 1u);
XCTAssertNotNil(task.response);
@@ -203,8 +206,8 @@
CDVURLSchemeHandler *handler = [[CDVURLSchemeHandler alloc]
initWithViewController:self.viewController];
CDVTestURLSchemeTask *task = [[CDVTestURLSchemeTask alloc]
initWithURL:[NSURL URLWithString:@"app://localhost/index.html"]];
- [handler webView:nil startURLSchemeTask:task];
- [handler webView:nil stopURLSchemeTask:task];
+ [handler webView:self.testWebView startURLSchemeTask:task];
+ [handler webView:self.testWebView stopURLSchemeTask:task];
XCTAssertEqual(task.responseCount, 1u);
XCTAssertEqual(task.finishedCount, 0u);
@@ -231,7 +234,7 @@
CDVURLSchemeHandler *handler = [[CDVURLSchemeHandler alloc]
initWithViewController:self.viewController];
CDVTestURLSchemeTask *task = [[CDVTestURLSchemeTask alloc]
initWithURL:[NSURL URLWithString:@"app://localhost/does-not-exist.html"]];
- [handler webView:nil startURLSchemeTask:task];
+ [handler webView:self.testWebView startURLSchemeTask:task];
XCTAssertEqual(task.responseCount, 0u);
XCTAssertEqual(task.failedCount, 1u);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]