cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [15/50] [abbrv] cordova-lib git commit: CB-11960 : updated android versions to 6.1.1., removed ios platforms for testing and replaced with browser, added includes function to support node 4. Test 005 commented out because not promisified correctly (CB-12
Date Thu, 09 Mar 2017 20:39:18 GMT
CB-11960 : updated android versions to 6.1.1., removed ios platforms for testing and replaced with browser, added includes function to support node 4. Test 005 commented out because not promisified correctly (CB-12170).

 This closes #499


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

Branch: refs/heads/common-2.0.x
Commit: a9605411ab007d700849c971043f0c211c06100c
Parents: 1acdbff
Author: Audrey So <audreyso@apache.org>
Authored: Wed Jan 25 15:46:43 2017 -0800
Committer: Steve Gill <stevengill97@gmail.com>
Committed: Fri Feb 3 16:58:53 2017 -0800

----------------------------------------------------------------------
 .../fixtures/basePkgJson/plugins/.svn           |   0
 .../fixtures/basePkgJson10/config.xml           |   2 +-
 .../fixtures/basePkgJson10/package.json         |   2 +-
 .../fixtures/basePkgJson10/plugins/.svn         |   0
 .../fixtures/basePkgJson11/config.xml           |   2 +-
 .../fixtures/basePkgJson11/package.json         |   2 +-
 .../fixtures/basePkgJson11/plugins/.svn         |   0
 .../fixtures/basePkgJson12/config.xml           |   2 +-
 .../fixtures/basePkgJson12/package.json         |   2 +-
 .../fixtures/basePkgJson12/plugins/.svn         |   0
 .../fixtures/basePkgJson13/plugins/.svn         |   0
 .../fixtures/basePkgJson3/plugins/.svn          |   0
 .../fixtures/basePkgJson4/plugins/.svn          |   0
 .../fixtures/basePkgJson5/config.xml            |   2 +-
 .../fixtures/basePkgJson5/plugins/.svn          |   0
 .../fixtures/basePkgJson6/plugins/.svn          |   0
 .../fixtures/basePkgJson8/config.xml            |   2 +-
 .../fixtures/basePkgJson8/package.json          |   2 +-
 .../fixtures/basePkgJson8/plugins/.svn          |   0
 .../fixtures/basePkgJson9/config.xml            |   2 +-
 .../fixtures/basePkgJson9/package.json          |   2 +-
 .../fixtures/basePkgJson9/plugins/.svn          |   0
 .../spec-cordova/pkgJson-restore.spec.js        | 155 ++++++++++---------
 cordova-lib/spec-cordova/pkgJson.spec.js        |  45 +++---
 cordova-lib/spec-cordova/platform.spec.js       |  12 +-
 cordova-lib/spec-cordova/plugin_fetch.spec.js   |  26 ++--
 cordova-lib/spec-cordova/save.spec.js           |  10 +-
 cordova-lib/spec-plugman/fetch.spec.js          |   9 +-
 .../spec-plugman/platforms/windows.spec.js      |   2 -
 cordova-lib/src/cordova/restore-util.js         |  21 ++-
 30 files changed, 159 insertions(+), 143 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/a9605411/cordova-lib/spec-cordova/fixtures/basePkgJson/plugins/.svn
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/basePkgJson/plugins/.svn b/cordova-lib/spec-cordova/fixtures/basePkgJson/plugins/.svn
deleted file mode 100644
index e69de29..0000000

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/a9605411/cordova-lib/spec-cordova/fixtures/basePkgJson10/config.xml
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/basePkgJson10/config.xml b/cordova-lib/spec-cordova/fixtures/basePkgJson10/config.xml
index 6134bed..7091fe2 100644
--- a/cordova-lib/spec-cordova/fixtures/basePkgJson10/config.xml
+++ b/cordova-lib/spec-cordova/fixtures/basePkgJson10/config.xml
@@ -11,7 +11,7 @@
     <access origin="*" />
     <preference name="fullscreen" value="true" />
     <preference name="webviewbounce" value="true" />
-    <engine name="ios"/>
+    <engine name="browser"/>
     <plugin name="cordova-plugin-camera">
         <variable name="variable_3" value="value_3" />
     </plugin>

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/a9605411/cordova-lib/spec-cordova/fixtures/basePkgJson10/package.json
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/basePkgJson10/package.json b/cordova-lib/spec-cordova/fixtures/basePkgJson10/package.json
index 58dc4ae..01a4a7e 100644
--- a/cordova-lib/spec-cordova/fixtures/basePkgJson10/package.json
+++ b/cordova-lib/spec-cordova/fixtures/basePkgJson10/package.json
@@ -14,7 +14,7 @@
     "license": "ISC",
     "cordova": {
         "platforms": [
-            "ios"
+            "browser"
         ],
         "plugins": {
             "cordova-plugin-device": {

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/a9605411/cordova-lib/spec-cordova/fixtures/basePkgJson10/plugins/.svn
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/basePkgJson10/plugins/.svn b/cordova-lib/spec-cordova/fixtures/basePkgJson10/plugins/.svn
deleted file mode 100644
index e69de29..0000000

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/a9605411/cordova-lib/spec-cordova/fixtures/basePkgJson11/config.xml
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/basePkgJson11/config.xml b/cordova-lib/spec-cordova/fixtures/basePkgJson11/config.xml
index f5f7238..1d975bb 100644
--- a/cordova-lib/spec-cordova/fixtures/basePkgJson11/config.xml
+++ b/cordova-lib/spec-cordova/fixtures/basePkgJson11/config.xml
@@ -11,7 +11,7 @@
     <access origin="*" />
     <preference name="fullscreen" value="true" />
     <preference name="webviewbounce" value="true" />
-    <engine name="ios"/>
+    <engine name="browser"/>
     <plugin name="cordova-plugin-camera" spec="~2.2.0">
         <variable name="variable_1" value="value_1" />
         <variable name="variable_2" value="value_2" />

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/a9605411/cordova-lib/spec-cordova/fixtures/basePkgJson11/package.json
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/basePkgJson11/package.json b/cordova-lib/spec-cordova/fixtures/basePkgJson11/package.json
index d86529b..9ab7986 100644
--- a/cordova-lib/spec-cordova/fixtures/basePkgJson11/package.json
+++ b/cordova-lib/spec-cordova/fixtures/basePkgJson11/package.json
@@ -14,7 +14,7 @@
     "license": "ISC",
     "cordova": {
         "platforms": [
-            "ios"
+            "browser"
         ],
         "plugins": {
             "cordova-plugin-splashscreen": {},

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/a9605411/cordova-lib/spec-cordova/fixtures/basePkgJson11/plugins/.svn
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/basePkgJson11/plugins/.svn b/cordova-lib/spec-cordova/fixtures/basePkgJson11/plugins/.svn
deleted file mode 100644
index e69de29..0000000

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/a9605411/cordova-lib/spec-cordova/fixtures/basePkgJson12/config.xml
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/basePkgJson12/config.xml b/cordova-lib/spec-cordova/fixtures/basePkgJson12/config.xml
index 0206c02..a343278 100644
--- a/cordova-lib/spec-cordova/fixtures/basePkgJson12/config.xml
+++ b/cordova-lib/spec-cordova/fixtures/basePkgJson12/config.xml
@@ -11,5 +11,5 @@
     <access origin="*" />
     <preference name="fullscreen" value="true" />
     <preference name="webviewbounce" value="true" />
-    <engine name="ios"/>
+    <engine name="browser"/>
 </widget>

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/a9605411/cordova-lib/spec-cordova/fixtures/basePkgJson12/package.json
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/basePkgJson12/package.json b/cordova-lib/spec-cordova/fixtures/basePkgJson12/package.json
index 08c11dd..6d8e08b 100644
--- a/cordova-lib/spec-cordova/fixtures/basePkgJson12/package.json
+++ b/cordova-lib/spec-cordova/fixtures/basePkgJson12/package.json
@@ -14,7 +14,7 @@
     "license": "ISC",
     "cordova": {
         "platforms": [
-            "ios"
+            "browser"
         ],
         "plugins": {
             "cordova-plugin-camera": {

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/a9605411/cordova-lib/spec-cordova/fixtures/basePkgJson12/plugins/.svn
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/basePkgJson12/plugins/.svn b/cordova-lib/spec-cordova/fixtures/basePkgJson12/plugins/.svn
deleted file mode 100644
index e69de29..0000000

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/a9605411/cordova-lib/spec-cordova/fixtures/basePkgJson13/plugins/.svn
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/basePkgJson13/plugins/.svn b/cordova-lib/spec-cordova/fixtures/basePkgJson13/plugins/.svn
deleted file mode 100644
index e69de29..0000000

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/a9605411/cordova-lib/spec-cordova/fixtures/basePkgJson3/plugins/.svn
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/basePkgJson3/plugins/.svn b/cordova-lib/spec-cordova/fixtures/basePkgJson3/plugins/.svn
deleted file mode 100644
index e69de29..0000000

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/a9605411/cordova-lib/spec-cordova/fixtures/basePkgJson4/plugins/.svn
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/basePkgJson4/plugins/.svn b/cordova-lib/spec-cordova/fixtures/basePkgJson4/plugins/.svn
deleted file mode 100644
index e69de29..0000000

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/a9605411/cordova-lib/spec-cordova/fixtures/basePkgJson5/config.xml
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/basePkgJson5/config.xml b/cordova-lib/spec-cordova/fixtures/basePkgJson5/config.xml
index 28663fc..536b125 100644
--- a/cordova-lib/spec-cordova/fixtures/basePkgJson5/config.xml
+++ b/cordova-lib/spec-cordova/fixtures/basePkgJson5/config.xml
@@ -11,6 +11,6 @@
     <access origin="*" />
     <preference name="fullscreen" value="true" />
     <preference name="webviewbounce" value="true" />
-    <engine name="android" spec="6.0.0"/>
+    <engine name="android" spec="6.1.1"/>
     <engine name="browser" spec="^4.1.0"/>
 </widget>

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/a9605411/cordova-lib/spec-cordova/fixtures/basePkgJson5/plugins/.svn
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/basePkgJson5/plugins/.svn b/cordova-lib/spec-cordova/fixtures/basePkgJson5/plugins/.svn
deleted file mode 100644
index e69de29..0000000

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/a9605411/cordova-lib/spec-cordova/fixtures/basePkgJson6/plugins/.svn
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/basePkgJson6/plugins/.svn b/cordova-lib/spec-cordova/fixtures/basePkgJson6/plugins/.svn
deleted file mode 100644
index e69de29..0000000

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/a9605411/cordova-lib/spec-cordova/fixtures/basePkgJson8/config.xml
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/basePkgJson8/config.xml b/cordova-lib/spec-cordova/fixtures/basePkgJson8/config.xml
index dab76f5..bd406b7 100644
--- a/cordova-lib/spec-cordova/fixtures/basePkgJson8/config.xml
+++ b/cordova-lib/spec-cordova/fixtures/basePkgJson8/config.xml
@@ -11,7 +11,7 @@
     <access origin="*" />
     <preference name="fullscreen" value="true" />
     <preference name="webviewbounce" value="true" />
-    <engine name="ios"/>
+    <engine name="browser"/>
     <plugin name="cordova-plugin-camera">
     <variable name="variable_1" value="config" />
     </plugin>

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/a9605411/cordova-lib/spec-cordova/fixtures/basePkgJson8/package.json
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/basePkgJson8/package.json b/cordova-lib/spec-cordova/fixtures/basePkgJson8/package.json
index 2f74834..7061317 100644
--- a/cordova-lib/spec-cordova/fixtures/basePkgJson8/package.json
+++ b/cordova-lib/spec-cordova/fixtures/basePkgJson8/package.json
@@ -14,7 +14,7 @@
     "license": "ISC",
     "cordova": {
         "platforms": [
-            "ios"
+            "browser"
         ],
         "plugins": {
             "cordova-plugin-camera": {

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/a9605411/cordova-lib/spec-cordova/fixtures/basePkgJson8/plugins/.svn
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/basePkgJson8/plugins/.svn b/cordova-lib/spec-cordova/fixtures/basePkgJson8/plugins/.svn
deleted file mode 100644
index e69de29..0000000

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/a9605411/cordova-lib/spec-cordova/fixtures/basePkgJson9/config.xml
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/basePkgJson9/config.xml b/cordova-lib/spec-cordova/fixtures/basePkgJson9/config.xml
index a0e37ad..6c6bf58 100644
--- a/cordova-lib/spec-cordova/fixtures/basePkgJson9/config.xml
+++ b/cordova-lib/spec-cordova/fixtures/basePkgJson9/config.xml
@@ -11,7 +11,7 @@
     <access origin="*" />
     <preference name="fullscreen" value="true" />
     <preference name="webviewbounce" value="true" />
-    <engine name="ios"/>
+    <engine name="browser"/>
     <plugin name="cordova-plugin-camera">
         <variable name="variable_1" value="value_1" />
     </plugin>

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/a9605411/cordova-lib/spec-cordova/fixtures/basePkgJson9/package.json
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/basePkgJson9/package.json b/cordova-lib/spec-cordova/fixtures/basePkgJson9/package.json
index 4e654d4..62ccdc9 100644
--- a/cordova-lib/spec-cordova/fixtures/basePkgJson9/package.json
+++ b/cordova-lib/spec-cordova/fixtures/basePkgJson9/package.json
@@ -14,7 +14,7 @@
     "license": "ISC",
     "cordova": {
         "platforms": [
-            "ios"
+            "browser"
         ],
         "plugins": {
             "cordova-plugin-camera": {

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/a9605411/cordova-lib/spec-cordova/fixtures/basePkgJson9/plugins/.svn
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/basePkgJson9/plugins/.svn b/cordova-lib/spec-cordova/fixtures/basePkgJson9/plugins/.svn
deleted file mode 100644
index e69de29..0000000

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/a9605411/cordova-lib/spec-cordova/pkgJson-restore.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/pkgJson-restore.spec.js b/cordova-lib/spec-cordova/pkgJson-restore.spec.js
index dd8e197..e1c341a 100644
--- a/cordova-lib/spec-cordova/pkgJson-restore.spec.js
+++ b/cordova-lib/spec-cordova/pkgJson-restore.spec.js
@@ -15,13 +15,14 @@
     KIND, either express or implied.  See the License for the
     specific language governing permissions and limitations
     under the License.
-*/
-var helpers = require('./helpers'),
+    */
+    var helpers = require('./helpers'),
     path = require('path'),
     shell = require('shelljs'),
     events = require('cordova-common').events,
     ConfigParser = require('cordova-common').ConfigParser,
-    cordova = require('../src/cordova/cordova');
+    cordova = require('../src/cordova/cordova'),
+    TIMEOUT = 60 * 1000;
 
 /** Testing will check if "cordova prepare" is restoring platforms and plugins as expected.
 *   Uses different basePkgJson files depending on testing expecations of what (platforms/plugins/variables)
@@ -128,7 +129,7 @@ describe('tests platform/spec restore with --save', function () {
             expect(err).toBeUndefined();
         }).fin(done);
     // Cordova prepare needs extra wait time to complete.
-    },300000);
+},300000);
 
     /** Test#017
     *   When platform is added with url and fetch and restored with fetch, 
@@ -212,7 +213,7 @@ describe('tests platform/spec restore with --save', function () {
             expect(err).toBeUndefined();
         }).fin(done);
     // Cordova prepare needs extra wait time to complete.
-    },30000);
+},TIMEOUT);
 
     /** Test#018
     *   When plugin is added with url and fetch and restored with fetch, 
@@ -286,7 +287,7 @@ describe('tests platform/spec restore with --save', function () {
             expect(err).toBeUndefined();
         }).fin(done);
     // Cordova prepare needs extra wait time to complete.
-    },30000);
+},TIMEOUT);
 });
 
 // Use basePkgJson
@@ -360,7 +361,7 @@ describe('tests platform/spec restore with --save', function () {
             expect(platformsJson[helpers.testPlatform]).toBeDefined();
             expect(platformsJson[secondPlatformAdded]).toBeDefined();
         }).then(fullPlatformList) // Platforms should still be in platform ls.
-          .then(function() {
+        .then(function() {
             // Remove helpers.testPlatform without --save.
             return cordova.raw.platform('rm', [helpers.testPlatform]);
         }).then(function() {
@@ -392,7 +393,7 @@ describe('tests platform/spec restore with --save', function () {
             expect(err).toBeUndefined();
         }).fin(done);
     // Cordova prepare needs extra wait time to complete.
-    },30000);
+},TIMEOUT);
 });
 
 // Use basePkgJson6 because pkg.json and config.xml contain only android
@@ -464,7 +465,7 @@ describe('files should not be modified if their platforms are identical', functi
             expect(err).toBeUndefined();
         }).fin(done);
     // Cordova prepare needs extra wait time to complete.
-    },30000);
+},TIMEOUT);
 });
 
 // Use a new basePkgJson5 as config.xml contains android/browser and pkg.json contains android
@@ -517,7 +518,7 @@ describe('update pkg.json to include platforms in config.xml', function () {
         var configEngArray = engNames.slice();
         var androidPlatform = 'android';
         var browserPlatform = 'browser';
-       
+
         // Config.xml contains(android & browser) and pkg.json contains android (basePkgJson5).
         expect(configEngArray.indexOf(androidPlatform)).toBeGreaterThan(-1);
         expect(configEngArray.indexOf(browserPlatform)).toBeGreaterThan(-1);
@@ -544,12 +545,12 @@ describe('update pkg.json to include platforms in config.xml', function () {
             expect(configEngArray.indexOf(browserPlatform)).toBeGreaterThan(-1);
             // Platform specs from config.xml have been added to pkg.json.
             expect(pkgJson.dependencies['cordova-browser']).toEqual('^4.1.0');
-            expect(pkgJson.dependencies['cordova-android']).toEqual('6.0.0');
+            expect(pkgJson.dependencies['cordova-android']).toEqual('6.1.1');
         }).fail(function(err) {
             expect(err).toBeUndefined();
         }).fin(done);
     // Cordova prepare needs extra wait time to complete.
-    },30000);
+},TIMEOUT);
 });
 
 // Use basePkgJson3 as it has 'android' in config.xml and pkg.json (no cordova key).
@@ -586,7 +587,7 @@ describe('update empty package.json to match config.xml', function () {
      *   If it does not and config.xml has a platform(s) installed already, run cordova prepare
      *   and it will add a cordova key and the platform(s) from config.xml to package.json.
      */
-    it('Test#006 : if pkg.json exists without cordova key, create one with same platforms in config.xml ', function(done) {
+     it('Test#006 : if pkg.json exists without cordova key, create one with same platforms in config.xml ', function(done) {
         var cwd = process.cwd();
         var configXmlPath = path.join(cwd, 'config.xml');
         var pkgJsonPath = path.join(cwd,'package.json');
@@ -628,8 +629,8 @@ describe('update empty package.json to match config.xml', function () {
             expect(err).toBeUndefined();
         }).fin(done);
     // Cordova prepare needs extra wait time to complete.
-    },30000);
-});
+},TIMEOUT);
+ });
 
 // Use a new basePkgJson4 as pkg.json contains android/browser and config.xml contains android.
 describe('update config.xml to include platforms in pkg.json', function () {
@@ -714,7 +715,7 @@ describe('update config.xml to include platforms in pkg.json', function () {
             expect(err).toBeUndefined();
         }).fin(done);
     // Cordova prepare needs extra wait time to complete.
-    },30000);
+},TIMEOUT);
 });
 
 // Plugin testing begins here.
@@ -801,7 +802,7 @@ describe('update config.xml to use the variable found in pkg.json', function ()
             expect(err).toBeUndefined();
         }).fin(done);
     // Cordova prepare needs extra wait time to complete.
-    },30000);
+},TIMEOUT);
 });
 
 // Use basePkgJson9 as config contains 1 plugin and 1 variable and pkg.json contains 1 plugin 0 var
@@ -887,7 +888,7 @@ describe('update pkg.json to include plugin and variable found in config.xml', f
             expect(err).toBeUndefined();
         }).fin(done);
     // Cordova prepare needs extra wait time to complete.
-    },30000);
+},TIMEOUT);
 });
 
 // Use basePkgJson10 as pkg.json contains (camera plugin: var 1/var 2, splashscreen plugin). 
@@ -968,7 +969,7 @@ describe('update pkg.json AND config.xml to include all plugins and merge unique
         emptyPlatformList().then(function() {
             // Run cordova prepare.
             return cordova.raw.prepare();
-         }).then(function() {
+        }).then(function() {
             // Delete any previous caches of require(package.json).
             delete require.cache[require.resolve(pkgJsonPath)];
             pkgJson = require(pkgJsonPath);
@@ -981,7 +982,7 @@ describe('update pkg.json AND config.xml to include all plugins and merge unique
                 // Config.xml camera variables have been merged, no duplicates.
                 if(configPlugin.name === 'cordova-plugin-camera') {
                     expect(configPluginVariables).toEqual({ variable_1: ' ', 
-                    variable_2: ' ', variable_3: 'value_3' });
+                        variable_2: ' ', variable_3: 'value_3' });
                 }
                 // Expect that device has var1, val1 and splashscreen has 0 var.
                 if(configPlugin.name === 'cordova-plugin-device') {
@@ -1010,7 +1011,7 @@ describe('update pkg.json AND config.xml to include all plugins and merge unique
             expect(err).toBeUndefined();
         }).fin(done);
     // Cordova prepare needs extra wait time to complete.
-    },30000);
+},TIMEOUT);
 });
 
 // Use basePkgJson11 as pkg.json contains(splashscreen plugin, camera plugin: var1, value1, var2, value2) and
@@ -1112,7 +1113,7 @@ describe('update pkg.json AND config.xml to include all plugins/merge variables
                 // Config.xml camera variables have been merged, no duplicates
                 if(configPlugin.name === 'cordova-plugin-camera') {
                     expect(configPluginVariables).toEqual({ variable_1: 'value_1',
-                    variable_3: 'value_3', variable_2: 'value_2' });
+                        variable_3: 'value_3', variable_2: 'value_2' });
                     // Config.xml plugin spec should be updated to ^2.3.0
                     expect(configPlugin.spec).toEqual('^2.3.0');
                 }
@@ -1144,7 +1145,7 @@ describe('update pkg.json AND config.xml to include all plugins/merge variables
             // Expect that the variables from config have been merged with the variables 
             // from pkg.json to the camera plugin
             expect(pkgJson.cordova.plugins['cordova-plugin-camera']).toEqual({ variable_1: 'value_1',
-            variable_3: 'value_3', variable_2: 'value_2' });
+                variable_3: 'value_3', variable_2: 'value_2' });
             // Expect that all 3 plugins are restored and in the installed list.
             expect(path.join(pluginsFolderPath14, 'cordova-plugin-camera')).toExist();
             expect(path.join(pluginsFolderPath14, 'cordova-plugin-splashscreen')).toExist();
@@ -1153,7 +1154,7 @@ describe('update pkg.json AND config.xml to include all plugins/merge variables
             expect(err).toBeUndefined();
         }).fin(done);
     // Cordova prepare needs extra wait time to complete.
-    },30000);
+},TIMEOUT);
 });
 
 // Use basePkgJson12 as config.xml has 0 plugins and pkg.json has 1.
@@ -1253,7 +1254,7 @@ describe('update config.xml to include the plugin that is in pkg.json', function
             expect(err).toBeUndefined();
         }).fin(done);
     // Cordova prepare needs extra wait time to complete.
-    },30000);
+},TIMEOUT);
 });
 
 // Use basePkgJson13 - does NOT have a package.json
@@ -1313,52 +1314,52 @@ describe('platforms and plugins should be restored with config.xml even without
         expect(Object.keys(configPlugins).length === 1);
 
         emptyPlatformList().then(function() {
-        // Run cordova prepare.
-        return cordova.raw.platform('add', browserPlatform, {'save':true});
+            // Run cordova prepare.
+            return cordova.raw.platform('add', browserPlatform, {'save':true});
         }).then(function () {
-        // Android and browser are in config.xml.
-        var cfg3 = new ConfigParser(configXmlPath);
-        engines = cfg3.getEngines();
-        engNames = engines.map(function(elem) {
-            return elem.name;
-        });
-        configEngArray = engNames.slice();
-        expect(configEngArray.length === 2);
-        // Delete previouc caches of (pkg.json).
-        delete require.cache[require.resolve(platformsFolderPath1)];
-        platformsJson = require(platformsFolderPath1);
-        // Android and browser should be installed
-        expect(platformsJson).toBeDefined();
-        expect(platformsJson[androidPlatform]).toBeDefined();
-        expect(platformsJson[browserPlatform]).toBeDefined();
-        // Remove android without --save.
-        return cordova.raw.platform('rm', [browserPlatform]);
+            // Android and browser are in config.xml.
+            var cfg3 = new ConfigParser(configXmlPath);
+            engines = cfg3.getEngines();
+            engNames = engines.map(function(elem) {
+                return elem.name;
+            });
+            configEngArray = engNames.slice();
+            expect(configEngArray.length === 2);
+            // Delete previouc caches of (pkg.json).
+            delete require.cache[require.resolve(platformsFolderPath1)];
+            platformsJson = require(platformsFolderPath1);
+            // Browser should be installed
+            expect(platformsJson).toBeDefined();
+            expect(platformsJson[androidPlatform]).not.toBeDefined();
+            expect(platformsJson[browserPlatform]).toBeDefined();
+            // Remove android without --save.
+            return cordova.raw.platform('rm', [browserPlatform]);
         }).then(function () {
-        // Android should not be in the installed list (only browser).
-        delete require.cache[require.resolve(platformsFolderPath1)];
-        platformsJson = require(platformsFolderPath1);
-        expect(platformsJson).toBeDefined();
-        expect(platformsJson[browserPlatform]).toBeUndefined();
-        expect(platformsJson[androidPlatform]).toBeDefined();
+            // Android should not be in the installed list (only browser).
+            delete require.cache[require.resolve(platformsFolderPath1)];
+            platformsJson = require(platformsFolderPath1);
+            expect(platformsJson).toBeDefined();
+            expect(platformsJson[browserPlatform]).toBeUndefined();
+            expect(platformsJson[androidPlatform]).not.toBeDefined();
         }).then(function () {
-        // Run cordova prepare.
-        return cordova.raw.prepare();
+            // Run cordova prepare.
+            return cordova.raw.prepare();
         }).then(function() {
-        var cfg2 = new ConfigParser(configXmlPath);
-        engines = cfg2.getEngines();
-        engNames = engines.map(function(elem) {
-            return elem.name;
-        });
-        configEngArray = engNames.slice();
-        // Config.xml should have android and browser.
-        expect(configEngArray.indexOf(androidPlatform)).toBeGreaterThan(-1);
-        expect(configEngArray.indexOf(browserPlatform)).toBeGreaterThan(-1);
-        expect(configEngArray.length === 2);
-        // Expect that android and browser were restored.
-        delete require.cache[require.resolve(platformsFolderPath1)];
-        platformsJson = require(platformsFolderPath1);
-        expect(platformsJson[androidPlatform]).toBeDefined();
-        expect(platformsJson[browserPlatform]).toBeDefined();
+            var cfg2 = new ConfigParser(configXmlPath);
+            engines = cfg2.getEngines();
+            engNames = engines.map(function(elem) {
+                return elem.name;
+            });
+            configEngArray = engNames.slice();
+            // Config.xml should have android and browser.
+            expect(configEngArray.indexOf(androidPlatform)).toBeGreaterThan(-1);
+            expect(configEngArray.indexOf(browserPlatform)).toBeGreaterThan(-1);
+            expect(configEngArray.length === 2);
+            // Expect that android and browser were restored.
+            delete require.cache[require.resolve(platformsFolderPath1)];
+            platformsJson = require(platformsFolderPath1);
+            expect(platformsJson[androidPlatform]).toBeDefined();
+            expect(platformsJson[browserPlatform]).toBeDefined();
         }).then(function () {
             //Check plugins.
             var cfg5 = new ConfigParser(configXmlPath);
@@ -1392,12 +1393,12 @@ describe('platforms and plugins should be restored with config.xml even without
             return cordova.raw.prepare();
         }).then(function () {
         //  Plugin should be restored and returned to the installed list.
-            expect(path.join(pluginsFolderPath16, 'cordova-plugin-device')).toExist();
-        }).fail(function(err) {
-            expect(err).toBeUndefined();
-        }).fin(done);
+        expect(path.join(pluginsFolderPath16, 'cordova-plugin-device')).toExist();
+    }).fail(function(err) {
+        expect(err).toBeUndefined();
+    }).fin(done);
     // Cordova prepare needs extra wait time to complete.
-    },60000);
+},TIMEOUT);
 });
 
 
@@ -1469,7 +1470,7 @@ describe('tests platform/spec restore with --save', function () {
             expect(platformsJson).toBeDefined();
             expect(platformsJson[helpers.testPlatform]).toBeDefined();
         }).then(fullPlatformList) // Platform should still be in platform ls.
-          .then(function() {
+        .then(function() {
             // And now remove helpers.testPlatform without --save.
             return cordova.raw.platform('rm', [helpers.testPlatform]);
         }).then(function() {
@@ -1495,7 +1496,7 @@ describe('tests platform/spec restore with --save', function () {
             expect(err).toBeUndefined();
         }).fin(done);
     // Cordova prepare needs extra wait time to complete.
-    },30000);
+},TIMEOUT);
 
     /** Test#002 will add two platforms to package.json with the 'save' flag.
     *   It will remove one platform from pkg.json without the 'save' flag and remove
@@ -1509,7 +1510,7 @@ describe('tests platform/spec restore with --save', function () {
         var platformsFolderPath = path.join(cwd,'platforms/platforms.json');
         var platformsJson;
         var secondPlatformAdded = 'browser';
-    
+
         emptyPlatformList().then(function() {
             // Add the testing platform with --save.
             return cordova.raw.platform('add', [helpers.testPlatform], {'save':true});
@@ -1531,7 +1532,7 @@ describe('tests platform/spec restore with --save', function () {
             expect(platformsJson[helpers.testPlatform]).toBeDefined();
             expect(platformsJson[secondPlatformAdded]).toBeDefined();
         }).then(fullPlatformList) // Platform should still be in platform ls.
-          .then(function() {
+        .then(function() {
             // Remove helpers.testPlatform with --save.
             return cordova.raw.platform('rm', [helpers.testPlatform], {'save':true});
         }).then(function() {
@@ -1564,5 +1565,5 @@ describe('tests platform/spec restore with --save', function () {
             expect(err).toBeUndefined();
         }).fin(done);
     // Cordova prepare needs extra wait time to complete.
-    },30000);
+},TIMEOUT);
 });

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/a9605411/cordova-lib/spec-cordova/pkgJson.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/pkgJson.spec.js b/cordova-lib/spec-cordova/pkgJson.spec.js
index 654fb1d..c9d5440 100644
--- a/cordova-lib/spec-cordova/pkgJson.spec.js
+++ b/cordova-lib/spec-cordova/pkgJson.spec.js
@@ -21,7 +21,8 @@ var helpers = require('./helpers'),
     shell = require('shelljs'),
     events = require('cordova-common').events,
     ConfigParser = require('cordova-common').ConfigParser,
-    cordova = require('../src/cordova/cordova');
+    cordova = require('../src/cordova/cordova'),
+    TIMEOUT = 30 * 1000;
 
 // This group of tests checks if plugins are added and removed as expected from package.json.
 describe('plugin end-to-end', function() {
@@ -95,7 +96,7 @@ describe('plugin end-to-end', function() {
         }).fail(function(err) {
             expect(err).toBeUndefined();
         }).fin(done);
-    });
+    }, TIMEOUT);
 
     it('Test#002 : should NOT add a plugin to package.json if --save is not used', function(done) {
         var pkgJsonPath = path.join(process.cwd(),'package.json');
@@ -120,7 +121,7 @@ describe('plugin end-to-end', function() {
         }).fail(function(err) {
             expect(err).toBeUndefined();
         }).fin(done);
-    });
+    }, TIMEOUT);
 
     it('Test#003 : should NOT remove plugin from package.json if there is no --save', function(done) {
         var pkgJsonPath = path.join(process.cwd(),'package.json');
@@ -150,7 +151,7 @@ describe('plugin end-to-end', function() {
         }).fail(function(err) {
             expect(err).toBeUndefined();
         }).fin(done);
-    });
+    }, TIMEOUT);
 
     it('Test#004 : should successfully add and remove a plugin with variables and save to package.json', function(done) {
         var pkgJsonPath = path.join(process.cwd(),'package.json');
@@ -182,8 +183,10 @@ describe('plugin end-to-end', function() {
         }).fail(function(err) {
             expect(err).toBeUndefined();
         }).fin(done);
-    });
-    it('Test#005 : should successfully add and remove multiple plugins with save & fetch', function(done) {
+    }, TIMEOUT);
+
+    // CB-12170 : Test is commented out because not promisified correctly in cordova-create script
+    xit('Test#005 : should successfully add and remove multiple plugins with save & fetch', function(done) {
         var pkgJsonPath = path.join(process.cwd(),'package.json');
         var pkgJson;
         // Delete any previous caches of require(package.json).
@@ -220,7 +223,7 @@ describe('plugin end-to-end', function() {
         }).fail(function(err) {
             expect(err).toBeUndefined();
         }).fin(done);
-    });
+    }, TIMEOUT);
 });
 
 // This group of tests checks if platforms are added and removed as expected from package.json.
@@ -291,7 +294,7 @@ describe('platform end-to-end with --save', function () {
         .fail(function(err) {
             expect(err).toBeUndefined();
         }).fin(done);
-    });
+    }, TIMEOUT);
 
     it('Test#007 : should not remove platforms from package.json when removing without --save', function(done) {
         var pkgJsonPath = path.join(process.cwd(),'package.json');
@@ -319,7 +322,7 @@ describe('platform end-to-end with --save', function () {
         .fail(function(err) {
             expect(err).toBeUndefined();
         }).fin(done);
-    });
+    }, TIMEOUT);
 
     it('Test#008 : should not add platform to package.json when adding without --save', function(done) {
         var pkgJsonPath = path.join(process.cwd(),'package.json');
@@ -343,12 +346,12 @@ describe('platform end-to-end with --save', function () {
             expect(err).toBeUndefined();
         })
         .fin(done);
-    });
+    }, TIMEOUT);
 
     it('Test#009 : should only add the platform to package.json with --save', function(done) {
         var pkgJsonPath = path.join(process.cwd(),'package.json');
         var pkgJson;
-        var platformNotToAdd = 'ios';
+        var platformNotToAdd = 'browser';
         expect(pkgJsonPath).toExist();
 
         // Add a platform without --save.
@@ -370,7 +373,7 @@ describe('platform end-to-end with --save', function () {
             expect(err).toBeUndefined();
         })
         .fin(done);
-    }, 30000);
+    }, TIMEOUT);
     it('Test#010 : two platforms are added and removed correctly with --save --fetch', function(done) {
         var pkgJsonPath = path.join(process.cwd(),'package.json');
         expect(pkgJsonPath).toExist();
@@ -393,7 +396,7 @@ describe('platform end-to-end with --save', function () {
         // Check there are no platforms yet.
         emptyPlatformList().then(function() {
             // Add the testing platform with --save and add specific version to android platform.
-            return cordova.raw.platform('add', ['android@6.1.0', 'ios@4.3.0'], {'save':true, 'fetch':true});
+            return cordova.raw.platform('add', ['android@6.1.0', 'browser@4.1.0'], {'save':true, 'fetch':true});
         }).then(function() {
             // Delete any previous caches of require(package.json).
             delete require.cache[require.resolve(pkgJsonPath)];
@@ -401,10 +404,10 @@ describe('platform end-to-end with --save', function () {
             // Check the platform add was successful in platforms list and in dependencies.
             expect(pkgJson.cordova.platforms).toBeDefined();
             expect(pkgJson.cordova.platforms.indexOf('android')).toEqual(0);
-            expect(pkgJson.cordova.platforms.indexOf('ios')).toEqual(1);
+            expect(pkgJson.cordova.platforms.indexOf('browser')).toEqual(1);
             expect(pkgJson.dependencies).toBeDefined();
             expect(pkgJson.dependencies['cordova-android']).toBeDefined();
-            expect(pkgJson.dependencies['cordova-ios']).toBeDefined();
+            expect(pkgJson.dependencies['cordova-browser']).toBeDefined();
             // Android platform should have specific version from add.
             expect(pkgJson.dependencies['cordova-android']).toEqual('^6.1.0');
 
@@ -414,24 +417,24 @@ describe('platform end-to-end with --save', function () {
                 return elem.name;
             });
             configEngArray = engNames.slice();
-            // Check that android and ios were added to config.xml with the correct spec.
+            // Check that android and browser were added to config.xml with the correct spec.
             expect(configEngArray.length === 2);
-            expect(engines).toEqual([ { name: 'android', spec: '~6.1.0' }, { name: 'ios', spec: '~4.3.0' } ]);
+            expect(engines).toEqual([ { name: 'android', spec: '~6.1.0' }, { name: 'browser', spec: '~4.1.0' } ]);
 
         }).then(fullPlatformList) // Platform should still be in platform ls.
         .then(function() {
             // And now remove it with --save.
-            return cordova.raw.platform('rm', ['android', 'ios'], {'save':true, 'fetch':true});
+            return cordova.raw.platform('rm', ['android', 'browser'], {'save':true, 'fetch':true});
         }).then(function() {
             // Delete any previous caches of require(package.json).
             delete require.cache[require.resolve(pkgJsonPath)];
             pkgJson = require(pkgJsonPath);
             // Checking that the platform removed is in not in the platforms key.
             expect(pkgJson.cordova.platforms.indexOf('android')).toEqual(-1);
-            expect(pkgJson.cordova.platforms.indexOf('ios')).toEqual(-1);
+            expect(pkgJson.cordova.platforms.indexOf('browser')).toEqual(-1);
             // Dependencies are removed.
             expect(pkgJson.dependencies['cordova-android']).toBeUndefined();
-            expect(pkgJson.dependencies['cordova-ios']).toBeUndefined();
+            expect(pkgJson.dependencies['cordova-browser']).toBeUndefined();
             // Platforms are removed from config.xml.
             var cfg4 = new ConfigParser(configXmlPath);
             engines = cfg4.getEngines();
@@ -445,6 +448,6 @@ describe('platform end-to-end with --save', function () {
         .fail(function(err) {
             expect(err).toBeUndefined();
         }).fin(done);
-    }, 30000);
+    }, TIMEOUT);
 });
 

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/a9605411/cordova-lib/spec-cordova/platform.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/platform.spec.js b/cordova-lib/spec-cordova/platform.spec.js
index 52b4362..763ba9c 100644
--- a/cordova-lib/spec-cordova/platform.spec.js
+++ b/cordova-lib/spec-cordova/platform.spec.js
@@ -220,7 +220,7 @@ describe('platform add plugin rm end-to-end', function () {
         cordova.raw.create('hello')
         .then(function() {
             process.chdir(project);
-            return cordova.raw.platform('add', 'ios@latest');
+            return cordova.raw.platform('add', 'browser@latest');
         })
         .then(function() {
             return cordova.raw.plugin('add', 'cordova-plugin-media');
@@ -268,15 +268,15 @@ describe('platform add and remove --fetch', function () {
         cordova.raw.create('helloFetch')
         .then(function() {
             process.chdir(project);
-            return cordova.raw.platform('add', 'ios', {'fetch':true});
+            return cordova.raw.platform('add', 'browser', {'fetch':true});
         })
         .then(function() {
-            expect(path.join(nodeModulesDir, 'cordova-ios')).toExist();
-            expect(path.join(platformsDir, 'ios')).toExist();
+            expect(path.join(nodeModulesDir, 'cordova-browser')).toExist();
+            expect(path.join(platformsDir, 'browser')).toExist();
             return cordova.raw.platform('add', 'android', {'fetch':true});
         })
         .then(function() {
-            expect(path.join(nodeModulesDir, 'cordova-android')).toExist();
+            expect(path.join(nodeModulesDir, 'cordova-browser')).toExist();
             expect(path.join(platformsDir, 'android')).toExist();
             //Tests finish before this command finishes resolving
             //return cordova.raw.platform('rm', 'ios', {'fetch':true});
@@ -319,7 +319,7 @@ describe('plugin add and rm end-to-end --fetch', function () {
         cordova.raw.create('hello3')
         .then(function() {
             process.chdir(project);
-            return cordova.raw.platform('add', 'ios', {'fetch': true});
+            return cordova.raw.platform('add', 'browser', {'fetch': true});
         })
         .then(function() {
             return cordova.raw.plugin('add', 'cordova-plugin-media', {'fetch': true});

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/a9605411/cordova-lib/spec-cordova/plugin_fetch.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/plugin_fetch.spec.js b/cordova-lib/spec-cordova/plugin_fetch.spec.js
index 8673484..eab2768 100644
--- a/cordova-lib/spec-cordova/plugin_fetch.spec.js
+++ b/cordova-lib/spec-cordova/plugin_fetch.spec.js
@@ -186,12 +186,12 @@ describe('plugin fetching version selection', function() {
             '<1.0.0': { 'cordova-android': '<2.0.0' },
             '1.0.0' : { 'cordova-android': '>2.0.0' },
             '1.7.0' : { 'cordova-android': '>4.0.0' },
-            '<2.3.0': { 'cordova-android': '<6.0.0' },
-            '2.3.0' : { 'cordova-android': '6.0.0' }
+            '<2.3.0': { 'cordova-android': '<6.1.1' },
+            '2.3.0' : { 'cordova-android': '6.1.1' }
         };
 
         var after = getWarningCheckCallback(done, [
-            getPlatformRequirement('6.0.0')
+            getPlatformRequirement('6.1.1')
         ]);
         testEngineWithProject(after, testEngine, '1.3.0');
     }, 6000);
@@ -201,14 +201,14 @@ describe('plugin fetching version selection', function() {
             '1.0.0' : { 'cordova-android': '>2.0.0' },
             '1.7.0' : { 'cordova-android': '>4.0.0' },
             '<2.3.0': {
-                'cordova-android': '<6.0.0',
+                'cordova-android': '<6.1.1',
                 'ca.filmaj.AndroidPlugin': '<1.0.0'
             },
-            '2.3.0' : { 'cordova-android': '6.0.0' }
+            '2.3.0' : { 'cordova-android': '6.1.1' }
         };
 
         var after = getWarningCheckCallback(done, [
-            getPlatformRequirement('6.0.0')
+            getPlatformRequirement('6.1.1')
         ]);
         testEngineWithProject(after, testEngine, null);
     });
@@ -313,12 +313,12 @@ describe('plugin fetching version selection', function() {
     it('Test 011 : should respect unreleased versions in constraints', function(done) {
         var testEngine = {
             '1.0.0' : { 'cordova-android': '3.1.0' },
-            '1.1.2' : { 'cordova-android': '6.0.0' },
-            '1.3.0' : { 'cordova-android': '6.0.0' }
+            '1.1.2' : { 'cordova-android': '6.1.1' },
+            '1.3.0' : { 'cordova-android': '6.1.1' }
         };
 
         var after = getWarningCheckCallback(done, [
-            getPlatformRequirement('6.0.0')
+            getPlatformRequirement('6.1.1')
         ]);
 
         testEngineWithProject(after, testEngine, '1.1.0');
@@ -329,11 +329,11 @@ describe('plugin fetching version selection', function() {
         var testEngine = {
             '0.0.0' : { 'ca.filmaj.AndroidPlugin': '1.2.0' },
             '1.1.3' : { 'ca.filmaj.AndroidPlugin': '<5.0.0 || >2.3.0' },
-            '2.3.0' : { 'ca.filmaj.AndroidPlugin': '6.0.0' }
+            '2.3.0' : { 'ca.filmaj.AndroidPlugin': '6.1.1' }
         };
 
         var after = getWarningCheckCallback(done, [
-            getPluginRequirement('6.0.0')
+            getPluginRequirement('6.1.1')
         ]);
 
         testEngineWithProject(after, testEngine, '2.0.0');
@@ -344,11 +344,11 @@ describe('plugin fetching version selection', function() {
         var testEngine = {
             '0.0.0' : { 'cordova': '>1.0.0' },
             '1.1.3' : { 'cordova': '<3.0.0 || >4.0.0' },
-            '2.3.0' : { 'cordova': '6.0.0' }
+            '2.3.0' : { 'cordova': '6.1.1' }
         };
 
         var after = getWarningCheckCallback(done, [
-            getCordovaRequirement('6.0.0')
+            getCordovaRequirement('6.1.1')
         ]);
 
         testEngineWithProject(after, testEngine, '1.1.0');

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/a9605411/cordova-lib/spec-cordova/save.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/save.spec.js b/cordova-lib/spec-cordova/save.spec.js
index a340b17..8c0aa86 100644
--- a/cordova-lib/spec-cordova/save.spec.js
+++ b/cordova-lib/spec-cordova/save.spec.js
@@ -237,7 +237,7 @@ describe('(save flag)', function () {
                 expect(helpers.getEngineSpec(appPath, platformName)).toBe(null);
                 done();
             });
-        });
+        }, TIMEOUT);
 
         it('Test 009 : spec.6 should save local path as spec if added using only local path', function (done) {
             helpers.removeEngine(appPath, platformName);
@@ -412,7 +412,7 @@ describe('(save flag)', function () {
                 console.log(err.message);
                 done();
             });
-        }, TIMEOUT);
+        }, BIG_TIMEOUT);
 
         it('Test 018 : spec.14.1 should restore plugin with variables', function (done) {
             platform('add', platformLocalPathNewer)
@@ -439,7 +439,7 @@ describe('(save flag)', function () {
                 expect(true).toBe(false);
                 done();
             });
-        }, TIMEOUT);
+        }, BIG_TIMEOUT);
 
         it('Test 019 : spec.15 save git url as spec', function (done) {
             platform('add', platformLocalPathNewer)
@@ -677,7 +677,7 @@ describe('(save flag)', function () {
                 console.log(err.message);
                 done();
             });
-        });
+        }, BIG_TIMEOUT);
 
         it('Test 033 : spec.25 should install plugins already added to the project into platform when restoring it', function (done) {
             var fail = jasmine.createSpy('fail').and.callFake(function (err) {
@@ -700,7 +700,7 @@ describe('(save flag)', function () {
                 expect(fail).not.toHaveBeenCalled();
                 done();
             });
-        });
+        }, BIG_TIMEOUT);
     });
 
     describe('(cleanup)', function () {

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/a9605411/cordova-lib/spec-plugman/fetch.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/fetch.spec.js b/cordova-lib/spec-plugman/fetch.spec.js
index ce72895..a37df67 100644
--- a/cordova-lib/spec-plugman/fetch.spec.js
+++ b/cordova-lib/spec-plugman/fetch.spec.js
@@ -22,7 +22,8 @@ var rewire  = require('rewire'),
     os      = require('os'),
     path    = require('path'),
     shell   = require('shelljs'),
-    realrm = shell.rm,
+    realrm  = shell.rm,
+    TIMEOUT = 60 * 1000,
     //xml_helpers = require('../src/util/xml-helpers'),
     metadata = require('../src/plugman/util/metadata'),
     temp    = path.join(os.tmpdir(), 'plugman', 'fetch'),
@@ -216,21 +217,21 @@ describe('fetch', function() {
                 expect(1).toBe(1);
                 done();
             });
-        }, 20000);
+        }, TIMEOUT);
         // this branch uses the old id
         it('Test 018 : should fetch from a branch', function(done) {
             wrapper(fetch('http://github.com/apache/cordova-plugin-device.git#cdvtest', temp, { expected_id: 'org.apache.cordova.device' }), done, function() {
                 expect(1).toBe(1);
                 done();
             });
-        }, 20000);
+        }, TIMEOUT);
         // this tag uses the new id
         it('Test 019 : should fetch from a tag', function(done) {
             wrapper(fetch('http://github.com/apache/cordova-plugin-device.git#r1.0.0', temp, { expected_id: 'cordova-plugin-device' }), done, function() {
                 expect(1).toBe(1);
                 done();
             });
-        }, 20000);
+        }, TIMEOUT);
     });
 
     describe('fetch recursive error CB-8809', function(){

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/a9605411/cordova-lib/spec-plugman/platforms/windows.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/platforms/windows.spec.js b/cordova-lib/spec-plugman/platforms/windows.spec.js
index 3528a2e..bd9c909 100644
--- a/cordova-lib/spec-plugman/platforms/windows.spec.js
+++ b/cordova-lib/spec-plugman/platforms/windows.spec.js
@@ -435,8 +435,6 @@ beforeEach(function () {
 
                 projects.forEach(function (project) {
                     var spy = spyOn(project, 'removeItemGroupElement');
-                    
-
                     if (projectsAddedTo.indexOf(path.basename(project.location)) > -1) {
                         projectsAddedToSpies.push(spy);
                     } else {

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/a9605411/cordova-lib/src/cordova/restore-util.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/restore-util.js b/cordova-lib/src/cordova/restore-util.js
index 044941c..6f4029b 100644
--- a/cordova-lib/src/cordova/restore-util.js
+++ b/cordova-lib/src/cordova/restore-util.js
@@ -47,6 +47,7 @@ function installPlatformsFromConfigXML(platforms, opts) {
     var modifiedConfigXML = false;
     var mergedPlatformSpecs = {};
     var key;
+    var installAllPlatforms = !platforms || platforms.length === 0;
 
     // Check if path exists and require pkgJsonPath.
     if(fs.existsSync(pkgJsonPath)) {
@@ -62,7 +63,6 @@ function installPlatformsFromConfigXML(platforms, opts) {
             // Combining arrays and checking duplicates.
             comboArray = pkgJsonPlatforms.slice();
         }
-
         engines = cfg.getEngines(projectHome);
         configPlatforms = engines.map(function(Engine) {
             var configPlatName = Engine.name;
@@ -88,7 +88,7 @@ function installPlatformsFromConfigXML(platforms, opts) {
 
         // No platforms to restore from either config.xml or package.json.
         if (comboArray.length <= 0) {
-           return Q('No platforms found in config.xml or package.json. Nothing to restore');
+            return Q('No platforms found in config.xml or package.json. Nothing to restore');
         }
 
         // If no package.json, don't continue.
@@ -182,17 +182,19 @@ function installPlatformsFromConfigXML(platforms, opts) {
     // CB-9278 : Run `platform add` serially, one platform after another
     // Otherwise, we get a bug where the following line: https://github.com/apache/cordova-lib/blob/0b0dee5e403c2c6d4e7262b963babb9f532e7d27/cordova-lib/src/util/npm-helper.js#L39
     // gets executed simultaneously by each platform and leads to an exception being thrown
+
     return promiseutil.Q_chainmap_graceful(comboArray, function(target) {
         var cwd = process.cwd();
         var platformsFolderPath = path.join(cwd,'platforms');
         var platformsInstalled = path.join(platformsFolderPath, target);
         if (target) {
+            var platformName = target;
             // Add the spec to the target
             if(mergedPlatformSpecs[target]) {
                 target = target + '@' + mergedPlatformSpecs[target];
             }
             // If the platform is already installed, no need to re-install it.
-            if (!fs.existsSync(platformsInstalled)) {
+            if (!fs.existsSync(platformsInstalled) && (installAllPlatforms || platforms.indexOf(platformName) > -1)) {
                 events.emit('log', 'Discovered platform \"' + target + '\" in config.xml or package.json. Adding it to the project');
                 return cordova.raw.platform('add', target, opts);
             }
@@ -255,7 +257,18 @@ function installPluginsFromConfigXML(args) {
         // Check to see which plugins are initially the same in pkg.json and config.xml.
         // Add missing plugin variables in package.json from config.xml.
         comboPluginIdArray.forEach(function(item) {
-            if(pluginIdConfig.includes(item)) {
+
+            function includeFunc(container, value) {
+                var returnValue = false;
+                var pos = container.indexOf(value);
+                if (pos >= 0) {
+                    returnValue = true;
+                }
+                return returnValue;
+            }
+            var result = includeFunc(pluginIdConfig, item);
+
+            if (result === true) {
                 configPlugin = cfg.getPlugin(item);
                 configPluginVariables = configPlugin.variables;
                 pkgJsonPluginVariables = comboObject[item];


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message