Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4E0AD200B66 for ; Thu, 4 Aug 2016 01:01:09 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 4CB09160A8C; Wed, 3 Aug 2016 23:01:09 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 92551160A86 for ; Thu, 4 Aug 2016 01:01:08 +0200 (CEST) Received: (qmail 13879 invoked by uid 500); 3 Aug 2016 23:01:07 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 13868 invoked by uid 99); 3 Aug 2016 23:01:07 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Aug 2016 23:01:07 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4E3C1E3839; Wed, 3 Aug 2016 23:01:07 +0000 (UTC) From: shazron To: dev@cordova.apache.org Reply-To: dev@cordova.apache.org References: In-Reply-To: Subject: [GitHub] cordova-ios pull request #232: CB-11270 - Handle JavaScript onclick handler ... Content-Type: text/plain Message-Id: <20160803230107.4E3C1E3839@git1-us-west.apache.org> Date: Wed, 3 Aug 2016 23:01:07 +0000 (UTC) archived-at: Wed, 03 Aug 2016 23:01:09 -0000 Github user shazron commented on a diff in the pull request: https://github.com/apache/cordova-ios/pull/232#discussion_r73437041 --- Diff: tests/CordovaLibTests/CDVWhitelistTests.m --- @@ -295,6 +295,37 @@ - (void)testAllowIntentsAndNavigations XCTAssertEqual([CDVIntentAndNavigationFilter filterUrl:[NSURL URLWithString:@"https://google.com"] intentsWhitelist:intentsWhitelist navigationsWhitelist:navigationsWhitelist], CDVIntentAndNavigationFilterValueIntentAllowed); // Test http (not allowed in either) XCTAssertEqual([CDVIntentAndNavigationFilter filterUrl:[NSURL URLWithString:@"http://google.com"] 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 infrastructure@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org For additional commands, e-mail: dev-help@cordova.apache.org