Skip to content

Commit eef57d5

Browse files
committed
Add additional test case
1 parent 0cfda40 commit eef57d5

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

IdentityCore/tests/MSIDAADOAuthEmbeddedWebviewControllerTests.m

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,26 @@ - (void)testDecidePolicyForNavigationAction_whenExternalDecidePolicyForBrowserAc
235235
XCTAssertTrue(result);
236236
}
237237

238+
- (void)testDecidePolicyForNavigationAction_whenExternalDecidePolicyForBrowserActionLegacyFlowNonHttps_shouldCancelActionAndReturnNoAndCallExternalMethod
239+
{
240+
[MSIDWebAuthNUtil setAmIRunningInExtension:NO];
241+
242+
MSIDAADOAuthEmbeddedWebviewController *webVC = [[MSIDAADOAuthEmbeddedWebviewController alloc]
243+
initWithStartURL:[NSURL URLWithString:@"https://contoso.com/oauth/authorize"]
244+
endURL:[NSURL URLWithString:@"endurl://host"]
245+
webview:nil
246+
customHeaders:nil
247+
platfromParams:nil
248+
context:nil];
249+
250+
NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[[NSURL alloc] initWithString:@"http://www.web-cp.com/check"]];
251+
MSIDWKNavigationActionMock *action = [[MSIDWKNavigationActionMock alloc] initWithRequest:request];
252+
253+
BOOL result = [webVC decidePolicyAADForNavigationAction:action decisionHandler:^(WKNavigationActionPolicy decision) { }];
254+
255+
XCTAssertFalse(result);
256+
}
257+
238258
@end
239259

240260
#endif

0 commit comments

Comments
 (0)