cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaz...@apache.org
Subject ios commit: [CB-3530] Updated unit tests
Date Tue, 25 Jun 2013 23:02:54 GMT
Updated Branches:
  refs/heads/2.9.x fe5a9a51f -> c2cda903a


[CB-3530] Updated unit tests


Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/c2cda903
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/c2cda903
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/c2cda903

Branch: refs/heads/2.9.x
Commit: c2cda903a85e958fec0ac0771cebdd4a73519a5d
Parents: fe5a9a5
Author: Shazron Abdullah <shazron@apache.org>
Authored: Tue Jun 25 16:02:23 2013 -0700
Committer: Shazron Abdullah <shazron@apache.org>
Committed: Tue Jun 25 16:02:45 2013 -0700

----------------------------------------------------------------------
 CordovaLibTests/CDVWebViewDelegateTests.m | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/c2cda903/CordovaLibTests/CDVWebViewDelegateTests.m
----------------------------------------------------------------------
diff --git a/CordovaLibTests/CDVWebViewDelegateTests.m b/CordovaLibTests/CDVWebViewDelegateTests.m
index 1e536fa..ad05213 100644
--- a/CordovaLibTests/CDVWebViewDelegateTests.m
+++ b/CordovaLibTests/CDVWebViewDelegateTests.m
@@ -38,23 +38,28 @@
 
 - (void)testFragmentIdentifiersWithHttpUrl
 {
-    [self doTestFragmentIdentifiersWithBaseUrl:@"http://cordova.apache.org"];
+    [self doTestFragmentIdentifiersWithBaseUrl:@"http://cordova.apache.org" fragment:@"myfragment"];
 }
 
 - (void)testFragmentIdentifiersWithFileUrl
 {
-    [self doTestFragmentIdentifiersWithBaseUrl:@"file:///var/mobile/GASGEQGQsdga3313/www/index.html"];
+    [self doTestFragmentIdentifiersWithBaseUrl:@"file:///var/mobile/GASGEQGQsdga3313/www/index.html"
fragment:@"myfragment"];
 }
 
-- (void)doTestFragmentIdentifiersWithBaseUrl:(NSString*)baseUrl
+- (void)testFragmentIdentifiersWithFileUrlAndMalformedFragment
+{
+    [self doTestFragmentIdentifiersWithBaseUrl:@"file:///var/mobile/GASGEQGQsdga3313/www/index.html"
fragment:@"/var/mobile/GASGEQGQsdga3313/www/index.html"];
+}
+
+- (void)doTestFragmentIdentifiersWithBaseUrl:(NSString*)baseUrl fragment:(NSString*)fragment
 {
     CDVWebViewDelegate* wvd = [[CDVWebViewDelegate alloc] initWithDelegate:nil]; // not really
testing delegate handling
 
     NSString* originalUrlString = baseUrl;
     NSURL* originalUrl = [NSURL URLWithString:originalUrlString];
-    NSURL* originalUrlWithFragmentOnly = [NSURL URLWithString:[NSString stringWithFormat:@"%@#myfragment",
originalUrlString]];
+    NSURL* originalUrlWithFragmentOnly = [NSURL URLWithString:[NSString stringWithFormat:@"%@#%@",
originalUrlString, fragment]];
     NSURL* originalUrlWithFragmentOnlyNoIdentifier = [NSURL URLWithString:[NSString stringWithFormat:@"%@#",
originalUrlString]];
-    NSURL* originalUrlWithQueryParamsAndFragment = [NSURL URLWithString:[NSString stringWithFormat:@"%@?foo=bar#myfragment",
originalUrlString]];
+    NSURL* originalUrlWithQueryParamsAndFragment = [NSURL URLWithString:[NSString stringWithFormat:@"%@?foo=bar#%@",
originalUrlString, fragment]];
 
     NSURLRequest* originalRequest = [NSURLRequest requestWithURL:originalUrl];
     NSURLRequest* originalRequestWithFragmentOnly = [NSURLRequest requestWithURL:originalUrlWithFragmentOnly];


Mime
View raw message