Tweaking the tests so that they merge

This commit is contained in:
Joe Bowser
2012-04-04 13:38:35 -07:00
67 changed files with 8729 additions and 1713 deletions
@@ -1,4 +1,5 @@
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
@@ -31,8 +31,6 @@ import org.apache.cordova.api.Plugin;
import org.apache.cordova.api.PluginResult;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import android.app.Activity;
import android.content.ContentValues;
@@ -115,6 +113,7 @@ public class CameraLauncher extends Plugin {
this.targetWidth = args.getInt(3);
this.targetHeight = args.getInt(4);
this.encodingType = args.getInt(5);
this.mediaType = args.getInt(6);
if (srcType == CAMERA) {
this.takePicture(destType, encodingType);
@@ -84,7 +84,8 @@ public abstract class ContactAccessor {
map.put("displayName", true);
}
else if (key.startsWith("name")) {
map.put("name", true);
map.put("displayName", true);
map.put("name", true);
}
else if (key.startsWith("nickname")) {
map.put("nickname", true);
@@ -224,6 +224,9 @@ public class CordovaChromeClient extends WebChromeClient {
// Cordova JS has initialized, so show webview
// (This solves white flash seen when rendering HTML)
else if (reqOk && defaultValue != null && defaultValue.equals("gap_init:")) {
if (ctx.splashscreen != 0) {
ctx.root.setBackgroundResource(0);
}
ctx.appView.setVisibility(View.VISIBLE);
ctx.spinnerStop();
result.confirm("OK");
@@ -239,6 +239,9 @@ public class CordovaWebViewClient extends WebViewClient {
Thread.sleep(2000);
ctx.runOnUiThread(new Runnable() {
public void run() {
if (ctx.splashscreen != 0) {
ctx.root.setBackgroundResource(0);
}
ctx.appView.setVisibility(View.VISIBLE);
ctx.spinnerStop();
}
+10 -10
View File
@@ -142,8 +142,7 @@ public class FileUtils extends Plugin {
return new PluginResult(status, obj);
}
else if (action.equals("getMetadata")) {
JSONObject obj = getMetadata(args.getString(0));
return new PluginResult(status, obj);
return new PluginResult(status, getMetadata(args.getString(0)));
}
else if (action.equals("getFileMetadata")) {
JSONObject obj = getFileMetadata(args.getString(0));
@@ -254,7 +253,12 @@ public class FileUtils extends Plugin {
URL testUrl = new URL(decoded);
if (decoded.startsWith("file://")) {
fp = new File(decoded.substring(7, decoded.length()));
int questionMark = decoded.indexOf("?");
if (questionMark < 0) {
fp = new File(decoded.substring(7, decoded.length()));
} else {
fp = new File(decoded.substring(7, questionMark));
}
} else {
fp = new File(decoded);
}
@@ -759,21 +763,17 @@ public class FileUtils extends Plugin {
* Look up metadata about this entry.
*
* @param filePath to entry
* @return a Metadata object
* @return a long
* @throws FileNotFoundException
* @throws JSONException
*/
private JSONObject getMetadata(String filePath) throws FileNotFoundException, JSONException {
private long getMetadata(String filePath) throws FileNotFoundException {
File file = createFileObject(filePath);
if (!file.exists()) {
throw new FileNotFoundException("Failed to find file in getMetadata");
}
JSONObject metadata = new JSONObject();
metadata.put("modificationTime", file.lastModified());
return metadata;
return file.lastModified();
}
/**