cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shazron <>
Subject [GitHub] cordova-ios pull request #232: CB-11270 - Handle JavaScript onclick handler ...
Date Wed, 03 Aug 2016 23:01:07 GMT
Github user shazron commented on a diff in the pull request:
    --- Diff: tests/CordovaLibTests/CDVWhitelistTests.m ---
    @@ -295,6 +295,37 @@ - (void)testAllowIntentsAndNavigations
         XCTAssertEqual([CDVIntentAndNavigationFilter filterUrl:[NSURL URLWithString:@""]
intentsWhitelist:intentsWhitelist navigationsWhitelist:navigationsWhitelist], CDVIntentAndNavigationFilterValueIntentAllowed);
         // Test http (not allowed in either)
         XCTAssertEqual([CDVIntentAndNavigationFilter filterUrl:[NSURL URLWithString:@""]
intentsWhitelist:intentsWhitelist navigationsWhitelist:navigationsWhitelist], CDVIntentAndNavigationFilterValueNoneAllowed);
    +    NSURL* telUrl = [NSURL URLWithString:@"tel:5555555"];
    +    NSMutableURLRequest* telRequest = [NSMutableURLRequest requestWithURL:telUrl];
    +    telRequest.mainDocumentURL = telUrl;
    +    // mainDocumentURL and URL are the same in the NSURLRequest
    +    // Only UIWebViewNavigationTypeLinkClicked and UIWebViewNavigationTypeOther should
return YES
    +    XCTAssertTrue([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeLinkClicked]);
    +    XCTAssertTrue([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeOther]);
    +    XCTAssertFalse([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeReload]);
    +    XCTAssertFalse([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeBackForward]);
    +    XCTAssertFalse([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeFormSubmitted]);
    +    XCTAssertFalse([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeFormResubmitted]);
    --- End diff --
    See my comment on that note. The operative test here is for "shouldOverrideLoadWithRequest"
-- if the intent is allowed, it should return NO, as in it shouldn't override the load with
the request (since it is opened externally).

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message