cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bra...@apache.org
Subject [6/10] ios commit: Migrate unit tests to use config.xml. Cleanups suggested by Andrew.
Date Fri, 23 Nov 2012 21:26:53 GMT
Migrate unit tests to use config.xml. Cleanups suggested by Andrew.


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

Branch: refs/heads/master
Commit: 5b8608e536d141ab6f9a12d89738846139e01ddc
Parents: 0e87e6b
Author: Braden Shepherdson <braden@chromium.org>
Authored: Fri Nov 23 14:08:33 2012 -0500
Committer: Braden Shepherdson <braden@chromium.org>
Committed: Fri Nov 23 14:08:33 2012 -0500

----------------------------------------------------------------------
 CordovaLib/Classes/CDVViewController.h             |    5 +-
 CordovaLib/Classes/CDVViewController.m             |    2 +-
 CordovaLibTests/CordovaLibApp/Cordova.plist        |   75 ---------------
 CordovaLibTests/CordovaLibApp/config.xml           |   38 ++++++++
 .../CordovaTests.xcodeproj/project.pbxproj         |    6 +-
 5 files changed, 46 insertions(+), 80 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/5b8608e5/CordovaLib/Classes/CDVViewController.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVViewController.h b/CordovaLib/Classes/CDVViewController.h
index 0ccf0b9..1432c74 100644
--- a/CordovaLib/Classes/CDVViewController.h
+++ b/CordovaLib/Classes/CDVViewController.h
@@ -24,12 +24,12 @@
 #import "CDVInvokedUrlCommand.h"
 #import "CDVCommandDelegate.h"
 #import "CDVWhitelist.h"
-//#import "CDVScreenOrientationDelegate.h"
+#import "CDVScreenOrientationDelegate.h"
 
 @class CDVCommandQueue;
 @class CDVCommandDelegateImpl;
 
-@interface CDVViewController : UIViewController <UIWebViewDelegate>{
+@interface CDVViewController : UIViewController <UIWebViewDelegate, CDVScreenOrientationDelegate>{
     @private
     CDVCommandDelegateImpl* _commandDelegate;
 }
@@ -40,6 +40,7 @@
 @property (nonatomic, readonly, strong) NSDictionary* pluginsMap;
 @property (nonatomic, readonly, strong) NSMutableDictionary* settings;
 @property (nonatomic, readonly, strong) NSXMLParser* configParser;
+@property (nonatomic, readonly, strong) NSMutableArray* whitelistHosts;
 @property (nonatomic, readonly, strong) CDVWhitelist* whitelist; // readonly for public
 @property (nonatomic, readonly, assign) BOOL loadFromString;
 @property (nonatomic, readwrite, copy)NSString * invokeString CDV_DEPRECATED(2.0, "Use window.handleOpenURL(url
instead. It is called when the app is launched through a custom scheme url.");

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/5b8608e5/CordovaLib/Classes/CDVViewController.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVViewController.m b/CordovaLib/Classes/CDVViewController.m
index 332e99a..e9f4ca1 100644
--- a/CordovaLib/Classes/CDVViewController.m
+++ b/CordovaLib/Classes/CDVViewController.m
@@ -141,7 +141,7 @@
     // read from Cordova.plist in the app bundle
     NSString* path = [[NSBundle mainBundle] pathForResource:@"config" ofType:@"xml"];
     if (![[NSFileManager defaultManager] fileExistsAtPath:path]) {
-        NSLog(@"ERROR: config.xml does not exist");
+        NSAssert(NO, @"ERROR: config.xml does not exist");
         return;
     }
 

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/5b8608e5/CordovaLibTests/CordovaLibApp/Cordova.plist
----------------------------------------------------------------------
diff --git a/CordovaLibTests/CordovaLibApp/Cordova.plist b/CordovaLibTests/CordovaLibApp/Cordova.plist
deleted file mode 100644
index f4176b5..0000000
--- a/CordovaLibTests/CordovaLibApp/Cordova.plist
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>KeyboardDisplayRequiresUserAction</key>
-	<true/>
-	<key>SuppressesIncrementalRendering</key>
-	<false/>
-	<key>UIWebViewBounce</key>
-	<true/>
-	<key>TopActivityIndicator</key>
-	<string>gray</string>
-	<key>EnableLocation</key>
-	<false/>
-	<key>EnableViewportScale</key>
-	<false/>
-	<key>AutoHideSplashScreen</key>
-	<true/>
-	<key>ShowSplashScreenSpinner</key>
-	<true/>
-	<key>MediaPlaybackRequiresUserAction</key>
-	<false/>
-	<key>AllowInlineMediaPlayback</key>
-	<false/>
-	<key>OpenAllWhitelistURLsInWebView</key>
-	<false/>
-	<key>BackupWebStorage</key>
-	<string>cloud</string>
-	<key>ExternalHosts</key>
-	<array/>
-	<key>Plugins</key>
-	<dict>
-		<key>LocalStorage</key>
-		<string>CDVLocalStorage</string>
-		<key>Device</key>
-		<string>CDVDevice</string>
-		<key>Logger</key>
-		<string>CDVLogger</string>
-		<key>Compass</key>
-		<string>CDVLocation</string>
-		<key>Accelerometer</key>
-		<string>CDVAccelerometer</string>
-		<key>Camera</key>
-		<string>CDVCamera</string>
-		<key>NetworkStatus</key>
-		<string>CDVConnection</string>
-		<key>Contacts</key>
-		<string>CDVContacts</string>
-		<key>Debug Console</key>
-		<string>CDVDebugConsole</string>
-		<key>File</key>
-		<string>CDVFile</string>
-		<key>FileTransfer</key>
-		<string>CDVFileTransfer</string>
-		<key>Geolocation</key>
-		<string>CDVLocation</string>
-		<key>Notification</key>
-		<string>CDVNotification</string>
-		<key>Media</key>
-		<string>CDVSound</string>
-		<key>Capture</key>
-		<string>CDVCapture</string>
-		<key>SplashScreen</key>
-		<string>CDVSplashScreen</string>
-		<key>Echo</key>
-		<string>CDVEcho</string>
-		<key>Battery</key>
-		<string>CDVBattery</string>
-		<key>Globalization</key>
-		<string>CDVGlobalization</string>
-		<key>InAppBrowser</key>
-		<string>CDVInAppBrowser</string>		
-	</dict>
-</dict>
-</plist>

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/5b8608e5/CordovaLibTests/CordovaLibApp/config.xml
----------------------------------------------------------------------
diff --git a/CordovaLibTests/CordovaLibApp/config.xml b/CordovaLibTests/CordovaLibApp/config.xml
new file mode 100644
index 0000000..7b786fa
--- /dev/null
+++ b/CordovaLibTests/CordovaLibApp/config.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<cordova>
+    <preference name="KeyboardDisplayRequiresUserAction" value="true" />
+    <preference name="SuppressesIncrementalRendering" value="false" />
+    <preference name="UIWebViewBounce" value="true" />
+    <preference name="TopActivityIndicator" value="gray" />
+    <preference name="EnableLocation" value="false" />
+    <preference name="EnableViewportScale" value="false" />
+    <preference name="AutoHideSplashScreen" value="true" />
+    <preference name="ShowSplashScreenSpinner" value="true" />
+    <preference name="MediaPlaybackRequiresUserAction" value="false" />
+    <preference name="AllowInlineMediaPlayback" value="false" />
+    <preference name="OpenAllWhitelistURLsInWebView" value="false" />
+    <preference name="BackupWebStorage" value="cloud" />
+
+    <plugins>
+        <plugin name="LocalStorage" value="CDVLocalStorage" />
+        <plugin name="Device" value="CDVDevice" />
+        <plugin name="Logger" value="CDVLogger" />
+        <plugin name="Compass" value="CDVLocation" />
+        <plugin name="Accelerometer" value="CDVAccelerometer" />
+        <plugin name="Camera" value="CDVCamera" />
+        <plugin name="NetworkStatus" value="CDVConnection" />
+        <plugin name="Contacts" value="CDVContacts" />
+        <plugin name="Debug Console" value="CDVDebugConsole" />
+        <plugin name="File" value="CDVFile" />
+        <plugin name="FileTransfer" value="CDVFileTransfer" />
+        <plugin name="Geolocation" value="CDVLocation" />
+        <plugin name="Notification" value="CDVNotification" />
+        <plugin name="Media" value="CDVSound" />
+        <plugin name="Capture" value="CDVCapture" />
+        <plugin name="SplashScreen" value="CDVSplashScreen" />
+        <plugin name="Echo" value="CDVEcho" />
+        <plugin name="Battery" value="CDVBattery" />
+        <plugin name="Globalization" value="CDVGlobalization" />
+        <plugin name="InAppBrowser" value="CDVInAppBrowser" />
+    </plugins>
+</cordova>

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/5b8608e5/CordovaLibTests/CordovaTests.xcodeproj/project.pbxproj
----------------------------------------------------------------------
diff --git a/CordovaLibTests/CordovaTests.xcodeproj/project.pbxproj b/CordovaLibTests/CordovaTests.xcodeproj/project.pbxproj
index d8f7ea3..380ce31 100644
--- a/CordovaLibTests/CordovaTests.xcodeproj/project.pbxproj
+++ b/CordovaLibTests/CordovaTests.xcodeproj/project.pbxproj
@@ -27,7 +27,6 @@
 		30F8AE0A15212587006625B3 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile;
fileRef = 686357DC14100B1600DF4CF2 /* CoreMedia.framework */; };
 		30F8AE0B15212587006625B3 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile;
fileRef = 686357D414100AF200DF4CF2 /* SystemConfiguration.framework */; };
 		30F8AE0C152125B6006625B3 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile;
fileRef = 686357D214100AE700DF4CF2 /* MobileCoreServices.framework */; };
-		30F8AE13152127CE006625B3 /* Cordova.plist in Resources */ = {isa = PBXBuildFile; fileRef
= 30F8AE12152127CE006625B3 /* Cordova.plist */; };
 		30F8AE1D152129DA006625B3 /* www in Resources */ = {isa = PBXBuildFile; fileRef = 30F8AE1C152129DA006625B3
/* www */; };
 		686357B5141002F200DF4CF2 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef
= 686357B3141002F200DF4CF2 /* InfoPlist.strings */; };
 		686357BA141002F200DF4CF2 /* CDVPluginResultJSONSerializationTests.m in Sources */ = {isa
= PBXBuildFile; fileRef = 686357B9141002F200DF4CF2 /* CDVPluginResultJSONSerializationTests.m
*/; };
@@ -46,6 +45,7 @@
 		EB89634A15FE66EA00E12277 /* CDVInvokedUrlCommandTests.m in Sources */ = {isa = PBXBuildFile;
fileRef = EB89634915FE66EA00E12277 /* CDVInvokedUrlCommandTests.m */; };
 		EBA3554615A731F100F4DE24 /* CDVFakeFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef
= EBA3554515A731F100F4DE24 /* CDVFakeFileManager.m */; };
 		EBA3556F15ABD0C900F4DE24 /* CDVFileTransferTests.m in Sources */ = {isa = PBXBuildFile;
fileRef = EBA3556E15ABD0C900F4DE24 /* CDVFileTransferTests.m */; };
+		F8EB14D1165FFD3200616F39 /* config.xml in Resources */ = {isa = PBXBuildFile; fileRef =
F8EB14D0165FFD3200616F39 /* config.xml */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */
@@ -109,6 +109,7 @@
 		EBA3554415A731F100F4DE24 /* CDVFakeFileManager.h */ = {isa = PBXFileReference; fileEncoding
= 4; lastKnownFileType = sourcecode.c.h; path = CDVFakeFileManager.h; sourceTree = "<group>";
};
 		EBA3554515A731F100F4DE24 /* CDVFakeFileManager.m */ = {isa = PBXFileReference; fileEncoding
= 4; lastKnownFileType = sourcecode.c.objc; path = CDVFakeFileManager.m; sourceTree = "<group>";
};
 		EBA3556E15ABD0C900F4DE24 /* CDVFileTransferTests.m */ = {isa = PBXFileReference; fileEncoding
= 4; lastKnownFileType = sourcecode.c.objc; path = CDVFileTransferTests.m; sourceTree = "<group>";
};
+		F8EB14D0165FFD3200616F39 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType
= text.xml; name = config.xml; path = CordovaLibApp/config.xml; sourceTree = "<group>";
};
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -164,6 +165,7 @@
 		0867D691FE84028FC02AAC07 /* CordovaLib */ = {
 			isa = PBXGroup;
 			children = (
+				F8EB14D0165FFD3200616F39 /* config.xml */,
 				EB37018115D18B2D00BEBC43 /* CordovaLib.xcodeproj */,
 				EB3B34F4161B585D003DBE7D /* CordovaLibTests */,
 				303A406D152124BB00182201 /* CordovaLibApp */,
@@ -343,8 +345,8 @@
 			isa = PBXResourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				F8EB14D1165FFD3200616F39 /* config.xml in Resources */,
 				303A4072152124BB00182201 /* InfoPlist.strings in Resources */,
-				30F8AE13152127CE006625B3 /* Cordova.plist in Resources */,
 				30F8AE1D152129DA006625B3 /* www in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;


Mime
View raw message