GitToTheHub commented on code in PR #1694:
URL: https://github.com/apache/cordova-ios/pull/1694#discussion_r3845152701
##########
tests/CordovaLibTests/CDVSceneDelegateTests.m:
##########
@@ -97,13 +97,14 @@ - (CDVFakeSceneConnectionOptions
*)connectionOptionsForURL:(NSURL *)url
- (void)testColdLaunchURLIsBufferedUntilPageDidLoad
{
NSURL *launchURL = [NSURL URLWithString:@"testscheme://path?foo=bar"];
+ UISceneSession *session = [[[UISceneSession class] alloc] init];
XCTNSNotificationExpectation *notFiredYet = [[XCTNSNotificationExpectation
alloc]
initWithName:CDVPluginHandleOpenURLNotification];
notFiredYet.inverted = YES;
[self.sceneDelegate scene:self.placeholderScene
- willConnectToSession:nil
+ willConnectToSession:session
options:[self connectionOptionsForURL:launchURL]];
Review Comment:
Also a documentation could be added for `[[[UISceneSession class] alloc]
init]` what you wrote in the PR description:
```
The +alloc method on UISceneSession isn't publicly exposed, so we need to do
it indirectly by calling it on the class instance. We don't actually do
anything with the session, we just need it not to be nil so it doesn't cause
warnings.
```
If the variable should be kept, it could be named `placeholderSession` like
there already exists a `self.placeholderScene`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]