Compare commits

...

4 Commits

Author SHA1 Message Date
Joe Bowser
355aae7b4b Fix for broken testUrl test 2016-10-20 12:47:55 -07:00
Joe Bowser
5b4524ae12 Last minute change of test targets 2016-10-20 12:26:10 -07:00
Joe Bowser
33ac5c20b5 Set VERSION to 6.0.0 (via coho) 2016-10-20 11:49:03 -07:00
Joe Bowser
3ac3688d8c Update JS snapshot to version 6.0.0 (via coho) 2016-10-20 11:49:03 -07:00
7 changed files with 109 additions and 79 deletions

View File

@ -1 +1 @@
5.3.0-dev 6.0.0

View File

@ -20,7 +20,7 @@
*/ */
// Coho updates this line: // Coho updates this line:
var VERSION = "5.3.0-dev"; var VERSION = "6.0.0";
module.exports.version = VERSION; module.exports.version = VERSION;

View File

@ -1,5 +1,5 @@
// Platform: android // Platform: android
// 0030f1d859d2a8360b621b0d48072f3f08eb6925 // 53ea1913735222d326e65326e03391405df3cd4e
/* /*
Licensed to the Apache Software Foundation (ASF) under one Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file or more contributor license agreements. See the NOTICE file
@ -19,7 +19,7 @@
under the License. under the License.
*/ */
;(function() { ;(function() {
var PLATFORM_VERSION_BUILD_LABEL = '5.3.0-dev'; var PLATFORM_VERSION_BUILD_LABEL = '6.0.0';
// file: src/scripts/require.js // file: src/scripts/require.js
/*jshint -W079 */ /*jshint -W079 */
@ -330,7 +330,7 @@ module.exports = cordova;
}); });
// file: F:/coho/cordova-android/cordova-js-src/android/nativeapiprovider.js // file: /Users/jbowser/cordova/cordova-android/cordova-js-src/android/nativeapiprovider.js
define("cordova/android/nativeapiprovider", function(require, exports, module) { define("cordova/android/nativeapiprovider", function(require, exports, module) {
/** /**
@ -353,7 +353,7 @@ module.exports = {
}); });
// file: F:/coho/cordova-android/cordova-js-src/android/promptbasednativeapi.js // file: /Users/jbowser/cordova/cordova-android/cordova-js-src/android/promptbasednativeapi.js
define("cordova/android/promptbasednativeapi", function(require, exports, module) { define("cordova/android/promptbasednativeapi", function(require, exports, module) {
/** /**
@ -742,8 +742,13 @@ var Channel = function(type, sticky) {
} }
}; };
function forceFunction(f) { function checkSubscriptionArgument(argument) {
if (typeof f != 'function') throw "Function required as first argument!"; if (typeof argument !== "function" && typeof argument.handleEvent !== "function") {
throw new Error(
"Must provide a function or an EventListener object " +
"implementing the handleEvent interface."
);
}
} }
/** /**
@ -753,28 +758,39 @@ function forceFunction(f) {
* and a guid that can be used to stop subscribing to the channel. * and a guid that can be used to stop subscribing to the channel.
* Returns the guid. * Returns the guid.
*/ */
Channel.prototype.subscribe = function(f, c) { Channel.prototype.subscribe = function(eventListenerOrFunction, eventListener) {
// need a function to call checkSubscriptionArgument(eventListenerOrFunction);
forceFunction(f); var handleEvent, guid;
if (eventListenerOrFunction && typeof eventListenerOrFunction === "object") {
// Received an EventListener object implementing the handleEvent interface
handleEvent = eventListenerOrFunction.handleEvent;
eventListener = eventListenerOrFunction;
} else {
// Received a function to handle event
handleEvent = eventListenerOrFunction;
}
if (this.state == 2) { if (this.state == 2) {
f.apply(c || this, this.fireArgs); handleEvent.apply(eventListener || this, this.fireArgs);
return; return;
} }
var func = f, guid = eventListenerOrFunction.observer_guid;
guid = f.observer_guid; if (typeof eventListener === "object") {
if (typeof c == "object") { func = utils.close(c, f); } handleEvent = utils.close(eventListener, handleEvent);
}
if (!guid) { if (!guid) {
// first time any channel has seen this subscriber // First time any channel has seen this subscriber
guid = '' + nextGuid++; guid = '' + nextGuid++;
} }
func.observer_guid = guid; handleEvent.observer_guid = guid;
f.observer_guid = guid; eventListenerOrFunction.observer_guid = guid;
// Don't add the same handler more than once. // Don't add the same handler more than once.
if (!this.handlers[guid]) { if (!this.handlers[guid]) {
this.handlers[guid] = func; this.handlers[guid] = handleEvent;
this.numHandlers++; this.numHandlers++;
if (this.numHandlers == 1) { if (this.numHandlers == 1) {
this.onHasSubscribersChange && this.onHasSubscribersChange(); this.onHasSubscribersChange && this.onHasSubscribersChange();
@ -785,12 +801,20 @@ Channel.prototype.subscribe = function(f, c) {
/** /**
* Unsubscribes the function with the given guid from the channel. * Unsubscribes the function with the given guid from the channel.
*/ */
Channel.prototype.unsubscribe = function(f) { Channel.prototype.unsubscribe = function(eventListenerOrFunction) {
// need a function to unsubscribe checkSubscriptionArgument(eventListenerOrFunction);
forceFunction(f); var handleEvent, guid, handler;
var guid = f.observer_guid, if (eventListenerOrFunction && typeof eventListenerOrFunction === "object") {
handler = this.handlers[guid]; // Received an EventListener object implementing the handleEvent interface
handleEvent = eventListenerOrFunction.handleEvent;
} else {
// Received a function to handle event
handleEvent = eventListenerOrFunction;
}
guid = handleEvent.observer_guid;
handler = this.handlers[guid];
if (handler) { if (handler) {
delete this.handlers[guid]; delete this.handlers[guid];
this.numHandlers--; this.numHandlers--;
@ -862,7 +886,7 @@ module.exports = channel;
}); });
// file: F:/coho/cordova-android/cordova-js-src/exec.js // file: /Users/jbowser/cordova/cordova-android/cordova-js-src/exec.js
define("cordova/exec", function(require, exports, module) { define("cordova/exec", function(require, exports, module) {
/** /**
@ -924,6 +948,9 @@ function androidExec(success, fail, service, action, args) {
androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT); androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT);
} }
// If args is not provided, default to an empty array
args = args || [];
// Process any ArrayBuffers in the args into a string. // Process any ArrayBuffers in the args into a string.
for (var i = 0; i < args.length; i++) { for (var i = 0; i < args.length; i++) {
if (utils.typeName(args[i]) == 'ArrayBuffer') { if (utils.typeName(args[i]) == 'ArrayBuffer') {
@ -1622,7 +1649,7 @@ exports.reset();
}); });
// file: F:/coho/cordova-android/cordova-js-src/platform.js // file: /Users/jbowser/cordova/cordova-android/cordova-js-src/platform.js
define("cordova/platform", function(require, exports, module) { define("cordova/platform", function(require, exports, module) {
// The last resume event that was received that had the result of a plugin call. // The last resume event that was received that had the result of a plugin call.
@ -1732,7 +1759,7 @@ function onMessageFromNative(msg) {
}); });
// file: F:/coho/cordova-android/cordova-js-src/plugin/android/app.js // file: /Users/jbowser/cordova/cordova-android/cordova-js-src/plugin/android/app.js
define("cordova/plugin/android/app", function(require, exports, module) { define("cordova/plugin/android/app", function(require, exports, module) {
var exec = require('cordova/exec'); var exec = require('cordova/exec');
@ -2094,7 +2121,10 @@ utils.clone = function(obj) {
retVal = {}; retVal = {};
for(i in obj){ for(i in obj){
if((!(i in retVal) || retVal[i] != obj[i]) && typeof obj[i] != 'undefined') { // https://issues.apache.org/jira/browse/CB-11522 'unknown' type may be returned in
// custom protocol activation case on Windows Phone 8.1 causing "No such interface supported" exception
// on cloning.
if((!(i in retVal) || retVal[i] != obj[i]) && typeof obj[i] != 'undefined' && typeof obj[i] != 'unknown') {
retVal[i] = utils.clone(obj[i]); retVal[i] = utils.clone(obj[i]);
} }
} }

View File

@ -31,7 +31,7 @@ import android.webkit.WebChromeClient.CustomViewCallback;
* are not expected to implement it. * are not expected to implement it.
*/ */
public interface CordovaWebView { public interface CordovaWebView {
public static final String CORDOVA_VERSION = "5.3.0-dev"; public static final String CORDOVA_VERSION = "6.0.0";
void init(CordovaInterface cordova, List<PluginEntry> pluginEntries, CordovaPreferences preferences); void init(CordovaInterface cordova, List<PluginEntry> pluginEntries, CordovaPreferences preferences);

View File

@ -1,49 +1,49 @@
{ {
"name": "cordova-android", "name": "cordova-android",
"version": "6.0.0", "version": "6.0.0",
"description": "cordova-android release", "description": "cordova-android release",
"bin": { "bin": {
"create": "bin/create" "create": "bin/create"
}, },
"main": "bin/templates/cordova/Api.js", "main": "bin/templates/cordova/Api.js",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://git-wip-us.apache.org/repos/asf/cordova-android.git" "url": "https://git-wip-us.apache.org/repos/asf/cordova-android.git"
}, },
"keywords": [ "keywords": [
"android", "android",
"cordova", "cordova",
"apache" "apache"
], ],
"scripts": { "scripts": {
"test": "npm run jshint && jasmine-node --color spec/unit", "test": "npm run jshint && jasmine-node --color spec/unit",
"cover": "istanbul cover --root bin/templates/cordova --print detail node_modules/jasmine-node/bin/jasmine-node -- spec/unit", "cover": "istanbul cover --root bin/templates/cordova --print detail node_modules/jasmine-node/bin/jasmine-node -- spec/unit",
"test-build": "jasmine-node --captureExceptions --color spec/e2e", "test-build": "jasmine-node --captureExceptions --color spec/e2e",
"jshint": "node node_modules/jshint/bin/jshint bin && node node_modules/jshint/bin/jshint spec" "jshint": "node node_modules/jshint/bin/jshint bin && node node_modules/jshint/bin/jshint spec"
}, },
"author": "Apache Software Foundation", "author": "Apache Software Foundation",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"cordova-common": "^1.5.0", "cordova-common": "^1.5.0",
"elementtree": "^0.1.6", "elementtree": "^0.1.6",
"nopt": "^3.0.1", "nopt": "^3.0.1",
"properties-parser": "^0.2.3", "properties-parser": "^0.2.3",
"q": "^1.4.1", "q": "^1.4.1",
"shelljs": "^0.5.3" "shelljs": "^0.5.3"
}, },
"bundledDependencies": [ "bundledDependencies": [
"cordova-common", "cordova-common",
"elementtree", "elementtree",
"nopt", "nopt",
"properties-parser", "properties-parser",
"q", "q",
"shelljs" "shelljs"
], ],
"devDependencies": { "devDependencies": {
"istanbul": "^0.4.2", "istanbul": "^0.4.2",
"jasmine-node": "^1.14.5", "jasmine-node": "^1.14.5",
"jshint": "^2.6.0", "jshint": "^2.6.0",
"promise-matchers": "~0", "promise-matchers": "~0",
"rewire": "^2.1.3" "rewire": "^2.1.3"
} }
} }

View File

@ -45,7 +45,7 @@
<uses-permission android:name="android.permission.GET_ACCOUNTS" /> <uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" /> <uses-permission android:name="android.permission.BROADCAST_STICKY" />
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19"/> <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="24"/>
<instrumentation <instrumentation
android:name="android.test.InstrumentationTestRunner" android:name="android.test.InstrumentationTestRunner"

View File

@ -35,7 +35,7 @@
<preference name="useBrowserHistory" value="true" /> <preference name="useBrowserHistory" value="true" />
<preference name="exit-on-suspend" value="false" /> <preference name="exit-on-suspend" value="false" />
<preference name="showTitle" value="true" /> <preference name="showTitle" value="true" />
<preference name="BackgroundColor" value="" /> <preference name="BackgroundColor" value="#000000" />
<feature name="Activity"> <feature name="Activity">
<param name="android-package" value="org.apache.cordova.test.ActivityPlugin" /> <param name="android-package" value="org.apache.cordova.test.ActivityPlugin" />
</feature> </feature>