You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bo...@apache.org on 2014/01/22 20:38:27 UTC
[16/50] [abbrv] git commit: CB-5302: Massive movement to get tests
working again
CB-5302: Massive movement to get tests working again
Project: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/commit/f768066d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/f768066d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/f768066d
Branch: refs/heads/master
Commit: f768066d343a98b55eab5f0703a01592fd3b7ef9
Parents: 6c0fb15
Author: Joe Bowser <bo...@apache.org>
Authored: Wed Nov 6 15:04:47 2013 -0800
Committer: Joe Bowser <bo...@apache.org>
Committed: Wed Jan 22 11:37:15 2014 -0800
----------------------------------------------------------------------
test/.classpath | 1 +
test/AndroidManifest.xml | 40 +-
test/assets/www/cordova_plugins.js | 11 +
test/assets/www/index.html | 34 +-
.../org.apache.cordova.device/www/device.js | 78 +
test/cordova/android_sdk_version | 29 +
test/cordova/build | 37 +
test/cordova/build.bat | 26 +
test/cordova/check_reqs | 28 +
test/cordova/clean | 36 +
test/cordova/clean.bat | 26 +
test/cordova/lib/android_sdk_version.js | 65 +
test/cordova/lib/appinfo.js | 41 +
test/cordova/lib/build.js | 87 +
test/cordova/lib/check_reqs.js | 94 +
test/cordova/lib/clean.js | 38 +
test/cordova/lib/device.js | 86 +
test/cordova/lib/emulator.js | 330 +++
test/cordova/lib/exec.js | 43 +
test/cordova/lib/install-device | 42 +
test/cordova/lib/install-device.bat | 26 +
test/cordova/lib/install-emulator | 38 +
test/cordova/lib/install-emulator.bat | 26 +
test/cordova/lib/list-devices | 33 +
test/cordova/lib/list-devices.bat | 26 +
test/cordova/lib/list-emulator-images | 32 +
test/cordova/lib/list-emulator-images.bat | 26 +
test/cordova/lib/list-started-emulators | 32 +
test/cordova/lib/list-started-emulators.bat | 26 +
test/cordova/lib/log.js | 57 +
test/cordova/lib/run.js | 139 +
test/cordova/lib/start-emulator | 39 +
test/cordova/lib/start-emulator.bat | 26 +
test/cordova/log | 36 +
test/cordova/log.bat | 26 +
test/cordova/node_modules/.bin/shjs | 1 +
test/cordova/node_modules/q/CONTRIBUTING.md | 40 +
test/cordova/node_modules/q/LICENSE | 19 +
test/cordova/node_modules/q/README.md | 813 ++++++
.../q/benchmark/compare-with-callbacks.js | 71 +
.../node_modules/q/benchmark/scenarios.js | 36 +
test/cordova/node_modules/q/package.json | 93 +
test/cordova/node_modules/q/q.js | 1937 ++++++++++++++
test/cordova/node_modules/q/queue.js | 35 +
.../node_modules/shelljs/.documentup.json | 6 +
test/cordova/node_modules/shelljs/.jshintrc | 7 +
test/cordova/node_modules/shelljs/.npmignore | 2 +
test/cordova/node_modules/shelljs/.travis.yml | 5 +
test/cordova/node_modules/shelljs/LICENSE | 26 +
test/cordova/node_modules/shelljs/README.md | 552 ++++
test/cordova/node_modules/shelljs/bin/shjs | 51 +
test/cordova/node_modules/shelljs/global.js | 3 +
test/cordova/node_modules/shelljs/make.js | 47 +
test/cordova/node_modules/shelljs/package.json | 48 +
.../shelljs/scripts/generate-docs.js | 21 +
.../node_modules/shelljs/scripts/run-tests.js | 50 +
test/cordova/node_modules/shelljs/shell.js | 153 ++
test/cordova/node_modules/shelljs/src/cat.js | 43 +
test/cordova/node_modules/shelljs/src/cd.js | 19 +
test/cordova/node_modules/shelljs/src/chmod.js | 208 ++
test/cordova/node_modules/shelljs/src/common.js | 189 ++
test/cordova/node_modules/shelljs/src/cp.js | 200 ++
test/cordova/node_modules/shelljs/src/dirs.js | 191 ++
test/cordova/node_modules/shelljs/src/echo.js | 20 +
test/cordova/node_modules/shelljs/src/error.js | 10 +
test/cordova/node_modules/shelljs/src/exec.js | 181 ++
test/cordova/node_modules/shelljs/src/find.js | 51 +
test/cordova/node_modules/shelljs/src/grep.js | 52 +
test/cordova/node_modules/shelljs/src/ls.js | 126 +
test/cordova/node_modules/shelljs/src/mkdir.js | 68 +
test/cordova/node_modules/shelljs/src/mv.js | 80 +
test/cordova/node_modules/shelljs/src/popd.js | 1 +
test/cordova/node_modules/shelljs/src/pushd.js | 1 +
test/cordova/node_modules/shelljs/src/pwd.js | 11 +
test/cordova/node_modules/shelljs/src/rm.js | 145 +
test/cordova/node_modules/shelljs/src/sed.js | 43 +
.../cordova/node_modules/shelljs/src/tempdir.js | 56 +
test/cordova/node_modules/shelljs/src/test.js | 85 +
test/cordova/node_modules/shelljs/src/to.js | 29 +
test/cordova/node_modules/shelljs/src/toEnd.js | 29 +
test/cordova/node_modules/shelljs/src/which.js | 79 +
test/cordova/plugins/android.json | 1 +
.../org.apache.cordova.device/.fetch.json | 1 +
.../plugins/org.apache.cordova.device/LICENSE | 202 ++
.../plugins/org.apache.cordova.device/README.md | 5 +
.../org.apache.cordova.device/RELEASENOTES.md | 40 +
.../docs/device.cordova.md | 80 +
.../org.apache.cordova.device/docs/device.md | 104 +
.../docs/device.model.md | 106 +
.../docs/device.name.md | 108 +
.../docs/device.platform.md | 99 +
.../docs/device.uuid.md | 115 +
.../docs/device.version.md | 86 +
.../org.apache.cordova.device/plugin.xml | 103 +
.../src/android/Device.java | 200 ++
.../src/blackberry10/index.js | 69 +
.../src/firefoxos/DeviceProxy.js | 39 +
.../src/ios/CDVDevice.h | 30 +
.../src/ios/CDVDevice.m | 90 +
.../src/windows8/DeviceProxy.js | 50 +
.../org.apache.cordova.device/src/wp/Device.cs | 135 +
.../test/autotest/html/HtmlReporter.js | 101 +
.../test/autotest/html/HtmlReporterHelpers.js | 60 +
.../test/autotest/html/ReporterView.js | 164 ++
.../test/autotest/html/SpecView.js | 79 +
.../test/autotest/html/SuiteView.js | 22 +
.../test/autotest/html/TrivialReporter.js | 192 ++
.../test/autotest/index.html | 59 +
.../test/autotest/jasmine.css | 81 +
.../test/autotest/jasmine.js | 2530 ++++++++++++++++++
.../test/autotest/pages/device.html | 71 +
.../test/autotest/test-runner.js | 62 +
.../test/autotest/tests/device.tests.js | 64 +
.../test/cordova-incl.js | 85 +
.../org.apache.cordova.device/test/index.html | 66 +
.../org.apache.cordova.device/test/main.js | 163 ++
.../org.apache.cordova.device/test/master.css | 164 ++
.../org.apache.cordova.device/www/device.js | 77 +
test/cordova/run | 37 +
test/cordova/run.bat | 26 +
test/cordova/version | 25 +
test/cordova/version.bat | 26 +
test/res/xml/config.xml | 46 +-
test/src/org/apache/cordova/device/Device.java | 200 ++
.../cordova/test/BackButtonMultiPageTest.java | 170 --
.../apache/cordova/test/CordovaActivity.java | 33 +
.../cordova/test/CordovaActivityTest.java | 96 -
.../cordova/test/CordovaDriverAction.java | 87 +
.../cordova/test/CordovaResourceApiTest.java | 281 --
.../org/apache/cordova/test/CordovaTest.java | 115 -
.../test/CordovaWebViewTestActivity.java | 112 +
.../org/apache/cordova/test/ErrorUrlTest.java | 79 -
.../src/org/apache/cordova/test/FixWebView.java | 44 -
.../org/apache/cordova/test/GapClientTest.java | 68 -
.../apache/cordova/test/HtmlNotFoundTest.java | 76 -
.../src/org/apache/cordova/test/IFrameTest.java | 94 -
.../org/apache/cordova/test/LifecycleTest.java | 34 -
test/src/org/apache/cordova/test/MenuTest.java | 32 -
.../apache/cordova/test/PluginManagerTest.java | 70 -
.../apache/cordova/test/SplashscreenTest.java | 49 -
.../apache/cordova/test/UserWebViewTest.java | 76 -
test/src/org/apache/cordova/test/XhrTest.java | 34 -
.../cordova/test/actions/CordovaActivity.java | 33 -
.../test/actions/CordovaDriverAction.java | 87 -
.../actions/CordovaWebViewTestActivity.java | 112 -
.../test/actions/backbuttonmultipage.java | 31 -
.../apache/cordova/test/actions/background.java | 33 -
.../cordova/test/actions/backgroundcolor.java | 40 -
.../apache/cordova/test/actions/basicauth.java | 44 -
.../apache/cordova/test/actions/errorurl.java | 33 -
.../apache/cordova/test/actions/fullscreen.java | 39 -
.../cordova/test/actions/htmlnotfound.java | 31 -
.../org/apache/cordova/test/actions/iframe.java | 30 -
.../apache/cordova/test/actions/lifecycle.java | 30 -
.../apache/cordova/test/actions/loading.java | 31 -
.../org/apache/cordova/test/actions/menus.java | 80 -
.../cordova/test/actions/splashscreen.java | 37 -
.../org/apache/cordova/test/actions/tests.java | 32 -
.../apache/cordova/test/actions/timeout.java | 34 -
.../cordova/test/actions/userwebview.java | 76 -
.../apache/cordova/test/actions/whitelist.java | 51 -
.../org/apache/cordova/test/actions/xhr.java | 30 -
.../cordova/test/backbuttonmultipage.java | 31 +
.../src/org/apache/cordova/test/background.java | 33 +
.../apache/cordova/test/backgroundcolor.java | 40 +
test/src/org/apache/cordova/test/basicauth.java | 44 +
test/src/org/apache/cordova/test/errorurl.java | 33 +
.../src/org/apache/cordova/test/fullscreen.java | 39 +
.../org/apache/cordova/test/htmlnotfound.java | 31 +
test/src/org/apache/cordova/test/iframe.java | 30 +
.../test/junit/BackButtonMultiPageTest.java | 170 ++
.../cordova/test/junit/CordovaActivityTest.java | 96 +
.../test/junit/CordovaResourceApiTest.java | 282 ++
.../apache/cordova/test/junit/CordovaTest.java | 116 +
.../apache/cordova/test/junit/ErrorUrlTest.java | 79 +
.../apache/cordova/test/junit/FixWebView.java | 44 +
.../cordova/test/junit/GapClientTest.java | 68 +
.../cordova/test/junit/HtmlNotFoundTest.java | 76 +
.../apache/cordova/test/junit/IFrameTest.java | 94 +
.../cordova/test/junit/LifecycleTest.java | 34 +
.../org/apache/cordova/test/junit/MenuTest.java | 32 +
.../cordova/test/junit/PluginManagerTest.java | 70 +
.../cordova/test/junit/SplashscreenTest.java | 49 +
.../cordova/test/junit/UserWebViewTest.java | 76 +
.../org/apache/cordova/test/junit/XhrTest.java | 34 +
test/src/org/apache/cordova/test/lifecycle.java | 30 +
test/src/org/apache/cordova/test/loading.java | 31 +
test/src/org/apache/cordova/test/menus.java | 80 +
.../org/apache/cordova/test/splashscreen.java | 37 +
test/src/org/apache/cordova/test/tests.java | 32 +
test/src/org/apache/cordova/test/timeout.java | 34 +
.../org/apache/cordova/test/userwebview.java | 76 +
test/src/org/apache/cordova/test/whitelist.java | 51 +
test/src/org/apache/cordova/test/xhr.java | 30 +
194 files changed, 15916 insertions(+), 2306 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/.classpath
----------------------------------------------------------------------
diff --git a/test/.classpath b/test/.classpath
index a4763d1..bb0c759 100644
--- a/test/.classpath
+++ b/test/.classpath
@@ -4,5 +4,6 @@
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+ <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/AndroidManifest.xml
----------------------------------------------------------------------
diff --git a/test/AndroidManifest.xml b/test/AndroidManifest.xml
index ee778ae..0ac3520 100755
--- a/test/AndroidManifest.xml
+++ b/test/AndroidManifest.xml
@@ -60,7 +60,7 @@
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
- android:name=".actions.CordovaWebViewTestActivity" >
+ android:name="org.apache.cordova.test.CordovaWebViewTestActivity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
@@ -70,7 +70,7 @@
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
- android:name=".actions.background" >
+ android:name="org.apache.cordova.test.background" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
@@ -80,7 +80,7 @@
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
- android:name=".actions.backgroundcolor" >
+ android:name="org.apache.cordova.test.backgroundcolor" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
@@ -90,7 +90,7 @@
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
- android:name=".actions.basicauth" >
+ android:name="org.apache.cordova.test.basicauth" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
@@ -100,7 +100,7 @@
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
- android:name=".actions.CordovaActivity" >
+ android:name="org.apache.cordova.test.CordovaActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
@@ -110,7 +110,7 @@
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
- android:name=".actions.CordovaDriverAction" >
+ android:name="org.apache.cordova.test.CordovaDriverAction" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
@@ -120,7 +120,7 @@
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
- android:name=".actions.errorurl" >
+ android:name="org.apache.cordova.test.errorurl" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
@@ -130,7 +130,7 @@
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
- android:name=".actions.fullscreen" >
+ android:name="org.apache.cordova.test.fullscreen" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
@@ -140,7 +140,7 @@
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
- android:name=".actions.htmlnotfound" >
+ android:name="org.apache.cordova.test.htmlnotfound" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
@@ -150,7 +150,7 @@
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
- android:name=".actions.iframe" >
+ android:name="org.apache.cordova.test.iframe" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
@@ -160,7 +160,7 @@
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
- android:name=".actions.lifecycle" >
+ android:name="org.apache.cordova.test.lifecycle" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
@@ -170,7 +170,7 @@
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
- android:name=".actions.loading" >
+ android:name="org.apache.cordova.test.loading" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
@@ -180,7 +180,7 @@
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
- android:name=".actions.menus" >
+ android:name="org.apache.cordova.test.menus" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
@@ -190,7 +190,7 @@
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
- android:name=".actions.splashscreen" >
+ android:name="org.apache.cordova.test.splashscreen" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
@@ -200,7 +200,7 @@
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
- android:name=".actions.tests" >
+ android:name="org.apache.cordova.test.tests" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
@@ -210,7 +210,7 @@
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
- android:name=".actions.timeout" >
+ android:name="org.apache.cordova.test.timeout" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
@@ -220,7 +220,7 @@
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
- android:name=".actions.userwebview" >
+ android:name="org.apache.cordova.test.userwebview" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
@@ -230,7 +230,7 @@
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
- android:name=".actions.whitelist" >
+ android:name="org.apache.cordova.test.whitelist" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
@@ -240,7 +240,7 @@
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
- android:name=".actions.xhr" >
+ android:name="org.apache.cordova.test.xhr" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
@@ -250,7 +250,7 @@
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
- android:name=".actions.backbuttonmultipage" >
+ android:name="org.apache.cordova.test.backbuttonmultipage" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/assets/www/cordova_plugins.js
----------------------------------------------------------------------
diff --git a/test/assets/www/cordova_plugins.js b/test/assets/www/cordova_plugins.js
new file mode 100644
index 0000000..f23dd64
--- /dev/null
+++ b/test/assets/www/cordova_plugins.js
@@ -0,0 +1,11 @@
+cordova.define('cordova/plugin_list', function(require, exports, module) {
+module.exports = [
+ {
+ "file": "plugins/org.apache.cordova.device/www/device.js",
+ "id": "org.apache.cordova.device.device",
+ "clobbers": [
+ "device"
+ ]
+ }
+]
+});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/assets/www/index.html
----------------------------------------------------------------------
diff --git a/test/assets/www/index.html b/test/assets/www/index.html
index 13f0825..590b593 100755
--- a/test/assets/www/index.html
+++ b/test/assets/www/index.html
@@ -47,22 +47,22 @@
<div id="info">
<h4>Run each of the test activities below:</h4>
</div>
- <button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.jqmtabbackbutton');">Backbutton jQM tab</button>
- <button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.backbuttonmultipage');">Backbutton with multiple pages</button>
- <button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.backgroundcolor');">Background Color</button>
- <button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.basicauth');">Basic Authentication</button>
- <button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.errorurl');">Error URL</button>
- <button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.fullscreen');">Full Screen</button>
- <button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.htmlnotfound');">HTML not found</button>
- <button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.iframe');">IFrame</button>
- <button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.lifecycle');">Lifecycle</button>
- <button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.loading');">Loading indicator</button>
- <button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.menus');">Menus</button>
- <button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.background');">No multitasking</button>
- <button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.splashscreen');">Splash screen</button>
- <button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.timeout');">Load timeout</button>
- <button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.userwebview');">User WebView/Client/Chrome</button>
- <button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.whitelist');">Whitelist</button>
- <button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.xhr');">XHR</button>
+ <button class="btn large" onclick="startActivity('org.apache.cordova.test.jqmtabbackbutton');">Backbutton jQM tab</button>
+ <button class="btn large" onclick="startActivity('org.apache.cordova.test.backbuttonmultipage');">Backbutton with multiple pages</button>
+ <button class="btn large" onclick="startActivity('org.apache.cordova.test.backgroundcolor');">Background Color</button>
+ <button class="btn large" onclick="startActivity('org.apache.cordova.test.basicauth');">Basic Authentication</button>
+ <button class="btn large" onclick="startActivity('org.apache.cordova.test.errorurl');">Error URL</button>
+ <button class="btn large" onclick="startActivity('org.apache.cordova.test.fullscreen');">Full Screen</button>
+ <button class="btn large" onclick="startActivity('org.apache.cordova.test.htmlnotfound');">HTML not found</button>
+ <button class="btn large" onclick="startActivity('org.apache.cordova.test.iframe');">IFrame</button>
+ <button class="btn large" onclick="startActivity('org.apache.cordova.test.lifecycle');">Lifecycle</button>
+ <button class="btn large" onclick="startActivity('org.apache.cordova.test.loading');">Loading indicator</button>
+ <button class="btn large" onclick="startActivity('org.apache.cordova.test.menus');">Menus</button>
+ <button class="btn large" onclick="startActivity('org.apache.cordova.test.background');">No multitasking</button>
+ <button class="btn large" onclick="startActivity('org.apache.cordova.test.splashscreen');">Splash screen</button>
+ <button class="btn large" onclick="startActivity('org.apache.cordova.test.timeout');">Load timeout</button>
+ <button class="btn large" onclick="startActivity('org.apache.cordova.test.userwebview');">User WebView/Client/Chrome</button>
+ <button class="btn large" onclick="startActivity('org.apache.cordova.test.whitelist');">Whitelist</button>
+ <button class="btn large" onclick="startActivity('org.apache.cordova.test.xhr');">XHR</button>
</body>
</html>
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/assets/www/plugins/org.apache.cordova.device/www/device.js
----------------------------------------------------------------------
diff --git a/test/assets/www/plugins/org.apache.cordova.device/www/device.js b/test/assets/www/plugins/org.apache.cordova.device/www/device.js
new file mode 100644
index 0000000..c0697f6
--- /dev/null
+++ b/test/assets/www/plugins/org.apache.cordova.device/www/device.js
@@ -0,0 +1,78 @@
+cordova.define("org.apache.cordova.device.device", function(require, exports, module) {/*
+ *
+ * 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
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+var argscheck = require('cordova/argscheck'),
+ channel = require('cordova/channel'),
+ utils = require('cordova/utils'),
+ exec = require('cordova/exec'),
+ cordova = require('cordova');
+
+channel.createSticky('onCordovaInfoReady');
+// Tell cordova channel to wait on the CordovaInfoReady event
+channel.waitForInitialization('onCordovaInfoReady');
+
+/**
+ * This represents the mobile device, and provides properties for inspecting the model, version, UUID of the
+ * phone, etc.
+ * @constructor
+ */
+function Device() {
+ this.available = false;
+ this.platform = null;
+ this.version = null;
+ this.uuid = null;
+ this.cordova = null;
+ this.model = null;
+
+ var me = this;
+
+ channel.onCordovaReady.subscribe(function() {
+ me.getInfo(function(info) {
+ //ignoring info.cordova returning from native, we should use value from cordova.version defined in cordova.js
+ //TODO: CB-5105 native implementations should not return info.cordova
+ var buildLabel = cordova.version;
+ me.available = true;
+ me.platform = info.platform;
+ me.version = info.version;
+ me.uuid = info.uuid;
+ me.cordova = buildLabel;
+ me.model = info.model;
+ channel.onCordovaInfoReady.fire();
+ },function(e) {
+ me.available = false;
+ utils.alert("[ERROR] Error initializing Cordova: " + e);
+ });
+ });
+}
+
+/**
+ * Get device info
+ *
+ * @param {Function} successCallback The function to call when the heading data is available
+ * @param {Function} errorCallback The function to call when there is an error getting the heading data. (OPTIONAL)
+ */
+Device.prototype.getInfo = function(successCallback, errorCallback) {
+ argscheck.checkArgs('fF', 'Device.getInfo', arguments);
+ exec(successCallback, errorCallback, "Device", "getDeviceInfo", []);
+};
+
+module.exports = new Device();
+});
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/cordova/android_sdk_version
----------------------------------------------------------------------
diff --git a/test/cordova/android_sdk_version b/test/cordova/android_sdk_version
new file mode 100755
index 0000000..547f41b
--- /dev/null
+++ b/test/cordova/android_sdk_version
@@ -0,0 +1,29 @@
+#!/usr/bin/env node
+
+/*
+ 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
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+var android_sdk_version = require('./lib/android_sdk_version');
+
+android_sdk_version.run().done(null, function(err) {
+ console.log(err);
+ process.exit(2);
+});
+
+
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/cordova/build
----------------------------------------------------------------------
diff --git a/test/cordova/build b/test/cordova/build
new file mode 100755
index 0000000..a38f3b6
--- /dev/null
+++ b/test/cordova/build
@@ -0,0 +1,37 @@
+#!/usr/bin/env node
+
+/*
+ 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
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+var build = require('./lib/build'),
+ reqs = require('./lib/check_reqs'),
+ args = process.argv;
+
+// Support basic help commands
+if(args[2] == '--help' || args[2] == '/?' || args[2] == '-h' ||
+ args[2] == 'help' || args[2] == '-help' || args[2] == '/help') {
+ build.help();
+} else {
+ reqs.run().then(function() {
+ return build.run(args[2]);
+ }).done(null, function(err) {
+ console.error(err);
+ process.exit(2);
+ });
+}
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/cordova/build.bat
----------------------------------------------------------------------
diff --git a/test/cordova/build.bat b/test/cordova/build.bat
new file mode 100644
index 0000000..2f317e3
--- /dev/null
+++ b/test/cordova/build.bat
@@ -0,0 +1,26 @@
+:: 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
+:: to you under the Apache License, Version 2.0 (the
+:: "License"); you may not use this file except in compliance
+:: with the License. You may obtain a copy of the License at
+::
+:: http://www.apache.org/licenses/LICENSE-2.0
+::
+:: Unless required by applicable law or agreed to in writing,
+:: software distributed under the License is distributed on an
+:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+:: KIND, either express or implied. See the License for the
+:: specific language governing permissions and limitations
+:: under the License.
+
+@ECHO OFF
+SET script_path="%~dp0build"
+IF EXIST %script_path% (
+ node "%script_path%" %*
+) ELSE (
+ ECHO.
+ ECHO ERROR: Could not find 'build' script in 'cordova' folder, aborting...>&2
+ EXIT /B 1
+)
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/cordova/check_reqs
----------------------------------------------------------------------
diff --git a/test/cordova/check_reqs b/test/cordova/check_reqs
new file mode 100755
index 0000000..2ac8752
--- /dev/null
+++ b/test/cordova/check_reqs
@@ -0,0 +1,28 @@
+#!/usr/bin/env node
+
+/*
+ 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
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+var check_reqs = require('./lib/check_reqs');
+
+check_reqs.run().done(null, function(err) {
+ console.log(err);
+ process.exit(2);
+});
+
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/cordova/clean
----------------------------------------------------------------------
diff --git a/test/cordova/clean b/test/cordova/clean
new file mode 100755
index 0000000..4e0808b
--- /dev/null
+++ b/test/cordova/clean
@@ -0,0 +1,36 @@
+#!/usr/bin/env node
+
+/*
+ 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
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+var clean = require('./lib/clean'),
+ reqs = require('./lib/check_reqs'),
+ args = process.argv;
+
+// Usage support for when args are given
+if(args.length > 2) {
+ clean.help();
+} else {
+ reqs.run().done(function() {
+ return clean.run();
+ }, function(err) {
+ console.error('ERROR: ' + err);
+ process.exit(2);
+ });
+}
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/cordova/clean.bat
----------------------------------------------------------------------
diff --git a/test/cordova/clean.bat b/test/cordova/clean.bat
new file mode 100644
index 0000000..fa1f669
--- /dev/null
+++ b/test/cordova/clean.bat
@@ -0,0 +1,26 @@
+:: 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
+:: to you under the Apache License, Version 2.0 (the
+:: "License"); you may not use this file except in compliance
+:: with the License. You may obtain a copy of the License at
+::
+:: http://www.apache.org/licenses/LICENSE-2.0
+::
+:: Unless required by applicable law or agreed to in writing,
+:: software distributed under the License is distributed on an
+:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+:: KIND, either express or implied. See the License for the
+:: specific language governing permissions and limitations
+:: under the License.
+
+@ECHO OFF
+SET script_path="%~dp0clean"
+IF EXIST %script_path% (
+ node "%script_path%" %*
+) ELSE (
+ ECHO.
+ ECHO ERROR: Could not find 'clean' script in 'cordova' folder, aborting...>&2
+ EXIT /B 1
+)
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/cordova/lib/android_sdk_version.js
----------------------------------------------------------------------
diff --git a/test/cordova/lib/android_sdk_version.js b/test/cordova/lib/android_sdk_version.js
new file mode 100755
index 0000000..d03e1e7
--- /dev/null
+++ b/test/cordova/lib/android_sdk_version.js
@@ -0,0 +1,65 @@
+#!/usr/bin/env node
+
+/*
+ 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
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+var shell = require('shelljs'),
+ child_process = require('child_process'),
+ Q = require('q');
+
+get_highest_sdk = function(results){
+ var reg = /\d+/;
+ var apiLevels = [];
+ for(var i=0;i<results.length;i++){
+ apiLevels[i] = parseInt(results[i].match(reg)[0]);
+ }
+ apiLevels.sort(function(a,b){return b-a});
+ console.log(apiLevels[0]);
+}
+
+get_sdks = function() {
+ var d = Q.defer();
+ child_process.exec('android list targets', function(err, stdout, stderr) {
+ if (err) d.reject(stderr);
+ else d.resolve(stdout);
+ });
+
+ return d.promise.then(function(output) {
+ var reg = /android-\d+/gi;
+ var results = output.match(reg);
+ if(results.length===0){
+ return Q.reject(new Error('No android sdks installed.'));
+ }else{
+ get_highest_sdk(results);
+ }
+
+ return Q();
+ }, function(stderr) {
+ if (stderr.match(/command\snot\sfound/)) {
+ return Q.reject(new Error('The command \"android\" failed. Make sure you have the latest Android SDK installed, and the \"android\" command (inside the tools/ folder) is added to your path.'));
+ } else {
+ return Q.reject(new Error('An error occurred while listing Android targets'));
+ }
+ });
+}
+
+module.exports.run = function() {
+ return Q.all([get_sdks()]);
+}
+
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/cordova/lib/appinfo.js
----------------------------------------------------------------------
diff --git a/test/cordova/lib/appinfo.js b/test/cordova/lib/appinfo.js
new file mode 100644
index 0000000..1f8ebe2
--- /dev/null
+++ b/test/cordova/lib/appinfo.js
@@ -0,0 +1,41 @@
+#!/usr/bin/env node
+
+/*
+ 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
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+var path = require('path');
+var fs = require('fs');
+var cachedAppInfo = null;
+
+function readAppInfoFromManifest() {
+ var manifestPath = path.join(__dirname, '..', '..', 'AndroidManifest.xml');
+ var manifestData = fs.readFileSync(manifestPath, {encoding:'utf8'});
+ var packageName = /\bpackage\s*=\s*"(.+?)"/.exec(manifestData);
+ if (!packageName) throw new Error('Could not find package name within ' + manifestPath);
+ var activityTag = /<activity\b[\s\S]*<\/activity>/.exec(manifestData);
+ if (!activityTag) throw new Error('Could not find <activity> within ' + manifestPath);
+ var activityName = /\bandroid:name\s*=\s*"(.+?)"/.exec(activityTag);
+ if (!activityName) throw new Error('Could not find android:name within ' + manifestPath);
+
+ return packageName[1] + '/.' + activityName[1];
+}
+
+exports.getActivityName = function() {
+ return cachedAppInfo = cachedAppInfo || readAppInfoFromManifest();
+};
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/test/cordova/lib/build.js b/test/cordova/lib/build.js
new file mode 100644
index 0000000..e57e26b
--- /dev/null
+++ b/test/cordova/lib/build.js
@@ -0,0 +1,87 @@
+#!/usr/bin/env node
+
+/*
+ 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
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+var shell = require('shelljs'),
+ exec = require('./exec'),
+ Q = require('q'),
+ clean = require('./clean'),
+ path = require('path'),
+ fs = require('fs'),
+ ROOT = path.join(__dirname, '..', '..');
+
+/*
+ * Builds the project with ant.
+ * Returns a promise.
+ */
+module.exports.run = function(build_type) {
+ //default build type
+ build_type = typeof build_type !== 'undefined' ? build_type : "--debug";
+ var cmd;
+ switch(build_type) {
+ case '--debug' :
+ cmd = 'ant debug -f ' + path.join(ROOT, 'build.xml');
+ break;
+ case '--release' :
+ cmd = 'ant release -f ' + path.join(ROOT, 'build.xml');
+ break;
+ case '--nobuild' :
+ console.log('Skipping build...');
+ return Q();
+ default :
+ return Q.reject('Build option \'' + build_type + '\' not recognized.');
+ }
+ if(cmd) {
+ return clean.run() // TODO: Can we stop cleaning every time and let ant build incrementally?
+ .then(function() {
+ return exec(cmd);
+ });
+ }
+ return Q();
+}
+
+/*
+ * Gets the path to the apk file, if not such file exists then
+ * the script will error out. (should we error or just return undefined?)
+ */
+module.exports.get_apk = function() {
+ if(fs.existsSync(path.join(ROOT, 'bin'))) {
+ var bin_files = fs.readdirSync(path.join(ROOT, 'bin'));
+ for (file in bin_files) {
+ if(path.extname(bin_files[file]) == '.apk') {
+ return path.join(ROOT, 'bin', bin_files[file]);
+ }
+ }
+ console.error('ERROR : No .apk found in \'bin\' folder');
+ process.exit(2);
+ } else {
+ console.error('ERROR : unable to find project bin folder, could not locate .apk');
+ process.exit(2);
+ }
+}
+
+module.exports.help = function() {
+ console.log('Usage: ' + path.relative(process.cwd(), path.join(ROOT, 'corodva', 'build')) + ' [build_type]');
+ console.log('Build Types : ');
+ console.log(' \'--debug\': Default build, will build project in using ant debug');
+ console.log(' \'--release\': will build project using ant release');
+ console.log(' \'--nobuild\': will skip build process (can be used with run command)');
+ process.exit(0);
+}
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/cordova/lib/check_reqs.js
----------------------------------------------------------------------
diff --git a/test/cordova/lib/check_reqs.js b/test/cordova/lib/check_reqs.js
new file mode 100644
index 0000000..f4def79
--- /dev/null
+++ b/test/cordova/lib/check_reqs.js
@@ -0,0 +1,94 @@
+#!/usr/bin/env node
+
+/*
+ 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
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+var shell = require('shelljs'),
+ child_process = require('child_process'),
+ Q = require('q'),
+ path = require('path'),
+ fs = require('fs'),
+ ROOT = path.join(__dirname, '..', '..');
+
+// Get valid target from framework/project.properties
+module.exports.get_target = function() {
+ if(fs.existsSync(path.join(ROOT, 'framework', 'project.properties'))) {
+ var target = shell.grep(/target=android-[\d+]/, path.join(ROOT, 'framework', 'project.properties'));
+ return target.split('=')[1].replace('\n', '').replace('\r', '').replace(' ', '');
+ } else if (fs.existsSync(path.join(ROOT, 'project.properties'))) {
+ // if no target found, we're probably in a project and project.properties is in ROOT.
+ var target = shell.grep(/target=android-[\d+]/, path.join(ROOT, 'project.properties'));
+ return target.split('=')[1].replace('\n', '').replace('\r', '').replace(' ', '');
+ }
+}
+
+// Returns a promise.
+module.exports.check_ant = function() {
+ var d = Q.defer();
+ child_process.exec('ant -version', function(err, stdout, stderr) {
+ if (err) d.reject(new Error('ERROR : executing command \'ant\', make sure you have ant installed and added to your path.'));
+ else d.resolve();
+ });
+ return d.promise;
+}
+
+// Returns a promise.
+module.exports.check_java = function() {
+ if(process.env.JAVA_HOME) {
+ var d = Q.defer();
+ child_process.exec('java -version', function(err, stdout, stderr) {
+ if(err) d.reject(new Error('ERROR : executing command \'java\', make sure you java environment is set up. Including your JDK and JRE.' + err));
+ else d.resolve();
+ });
+ return d.promise;
+ } else {
+ return Q.reject(new Error('ERROR : Make sure JAVA_HOME is set, as well as paths to your JDK and JRE for java.'));
+ }
+}
+
+// Returns a promise.
+module.exports.check_android = function() {
+ var valid_target = this.get_target();
+ var d = Q.defer();
+ child_process.exec('android list targets', function(err, stdout, stderr) {
+ if (err) d.reject(stderr);
+ else d.resolve(stdout);
+ });
+
+ return d.promise.then(function(output) {
+ if (!output.match(valid_target)) {
+ return Q.reject(new Error('Please install Android target ' + valid_target.split('-')[1] + ' (the Android newest SDK). Make sure you have the latest Android tools installed as well. Run \"android\" from your command-line to install/update any missing SDKs or tools.'));
+ }
+ return Q();
+ }, function(stderr) {
+ if (stderr.match(/command\snot\sfound/)) {
+ return Q.reject(new Error('The command \"android\" failed. Make sure you have the latest Android SDK installed, and the \"android\" command (inside the tools/ folder) is added to your path.'));
+ } else {
+ return Q.reject(new Error('An error occurred while listing Android targets'));
+ }
+ });
+}
+
+// Returns a promise.
+module.exports.run = function() {
+ return Q.all([this.check_ant(), this.check_java(), this.check_android()]).then(function() {
+ console.log('Looks like your environment fully supports cordova-android development!');
+ });
+}
+
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/cordova/lib/clean.js
----------------------------------------------------------------------
diff --git a/test/cordova/lib/clean.js b/test/cordova/lib/clean.js
new file mode 100644
index 0000000..0f955f6
--- /dev/null
+++ b/test/cordova/lib/clean.js
@@ -0,0 +1,38 @@
+#!/usr/bin/env node
+
+/*
+ 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
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+var exec = require('./exec'),
+ path = require('path'),
+ ROOT = path.join(__dirname, '..', '..');
+
+/*
+ * Cleans the project using ant
+ * Returns a promise.
+ */
+module.exports.run = function() {
+ return exec('ant clean -f ' + path.join(ROOT, 'build.xml'));
+}
+
+module.exports.help = function() {
+ console.log('Usage: ' + path.relative(process.cwd(), process.argv[1]));
+ console.log('Cleans the project directory.');
+ process.exit(0);
+}
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/cordova/lib/device.js
----------------------------------------------------------------------
diff --git a/test/cordova/lib/device.js b/test/cordova/lib/device.js
new file mode 100644
index 0000000..df2a33c
--- /dev/null
+++ b/test/cordova/lib/device.js
@@ -0,0 +1,86 @@
+#!/usr/bin/env node
+
+/*
+ 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
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+var exec = require('./exec'),
+ Q = require('q'),
+ path = require('path'),
+ build = require('./build'),
+ appinfo = require('./appinfo'),
+ ROOT = path.join(__dirname, '..', '..');
+
+/**
+ * Returns a promise for the list of the device ID's found
+ */
+module.exports.list = function() {
+ return exec('adb devices')
+ .then(function(output) {
+ var response = output.split('\n');
+ var device_list = [];
+ for (var i = 1; i < response.length; i++) {
+ if (response[i].match(/\w+\tdevice/) && !response[i].match(/emulator/)) {
+ device_list.push(response[i].replace(/\tdevice/, '').replace('\r', ''));
+ }
+ }
+ return device_list;
+ });
+}
+
+/*
+ * Installs a previously built application on the device
+ * and launches it.
+ * Returns a promise.
+ */
+module.exports.install = function(target) {
+ var launchName;
+ return this.list()
+ .then(function(device_list) {
+ if (!device_list || !device_list.length)
+ return Q.reject('ERROR: Failed to deploy to device, no devices found.');
+
+ // default device
+ target = typeof target !== 'undefined' ? target : device_list[0];
+
+ if (device_list.indexOf(target) < 0)
+ return Q.reject('ERROR: Unable to find target \'' + target + '\'.');
+
+ var apk_path = build.get_apk();
+ launchName = appinfo.getActivityName();
+ console.log('Installing app on device...');
+ var cmd = 'adb -s ' + target + ' install -r ' + apk_path;
+ return exec(cmd);
+ }).then(function(output) {
+ if (output.match(/Failure/)) return Q.reject('ERROR: Failed to install apk to device: ' + output);
+
+ //unlock screen
+ var cmd = 'adb -s ' + target + ' shell input keyevent 82';
+ return exec(cmd);
+ }, function(err) { return Q.reject('ERROR: Failed to install apk to device: ' + err); })
+ .then(function() {
+ // launch the application
+ console.log('Launching application...');
+ var cmd = 'adb -s ' + target + ' shell am start -W -a android.intent.action.MAIN -n ' + launchName;
+ return exec(cmd);
+ }).then(function() {
+ console.log('LANCH SUCCESS');
+ }, function(err) {
+ return Q.reject('ERROR: Failed to launch application on device: ' + err);
+ });
+}
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/cordova/lib/emulator.js
----------------------------------------------------------------------
diff --git a/test/cordova/lib/emulator.js b/test/cordova/lib/emulator.js
new file mode 100644
index 0000000..367cd94
--- /dev/null
+++ b/test/cordova/lib/emulator.js
@@ -0,0 +1,330 @@
+#!/usr/bin/env node
+
+/*
+ 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
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+var shell = require('shelljs'),
+ exec = require('./exec'),
+ Q = require('q'),
+ path = require('path'),
+ appinfo = require('./appinfo'),
+ build = require('./build'),
+ ROOT = path.join(__dirname, '..', '..'),
+ child_process = require('child_process'),
+ new_emulator = 'cordova_emulator';
+
+/**
+ * Returns a Promise for a list of emulator images in the form of objects
+ * {
+ name : <emulator_name>,
+ path : <path_to_emulator_image>,
+ target : <api_target>,
+ abi : <cpu>,
+ skin : <skin>
+ }
+ */
+module.exports.list_images = function() {
+ return exec('android list avds')
+ .then(function(output) {
+ var response = output.split('\n');
+ var emulator_list = [];
+ for (var i = 1; i < response.length; i++) {
+ // To return more detailed information use img_obj
+ var img_obj = {};
+ if (response[i].match(/Name:\s/)) {
+ img_obj['name'] = response[i].split('Name: ')[1].replace('\r', '');
+ if (response[i + 1].match(/Path:\s/)) {
+ i++;
+ img_obj['path'] = response[i].split('Path: ')[1].replace('\r', '');
+ }
+ if (response[i + 1].match(/\(API\slevel\s/)) {
+ i++;
+ img_obj['target'] = response[i].replace('\r', '');
+ }
+ if (response[i + 1].match(/ABI:\s/)) {
+ i++;
+ img_obj['abi'] = response[i].split('ABI: ')[1].replace('\r', '');
+ }
+ if (response[i + 1].match(/Skin:\s/)) {
+ i++;
+ img_obj['skin'] = response[i].split('Skin: ')[1].replace('\r', '');
+ }
+
+ emulator_list.push(img_obj);
+ }
+ /* To just return a list of names use this
+ if (response[i].match(/Name:\s/)) {
+ emulator_list.push(response[i].split('Name: ')[1].replace('\r', '');
+ }*/
+
+ }
+ return emulator_list;
+ });
+}
+
+/**
+ * Will return the closest avd to the projects target
+ * or undefined if no avds exist.
+ * Returns a promise.
+ */
+module.exports.best_image = function() {
+ var project_target = this.get_target().replace('android-', '');
+ return this.list_images()
+ .then(function(images) {
+ var closest = 9999;
+ var best = images[0];
+ for (i in images) {
+ var target = images[i].target;
+ if(target) {
+ var num = target.split('(API level ')[1].replace(')', '');
+ if (num == project_target) {
+ return images[i];
+ } else if (project_target - num < closest && project_target > num) {
+ var closest = project_target - num;
+ best = images[i];
+ }
+ }
+ }
+ return best;
+ });
+}
+
+// Returns a promise.
+module.exports.list_started = function() {
+ return exec('adb devices')
+ .then(function(output) {
+ var response = output.split('\n');
+ var started_emulator_list = [];
+ for (var i = 1; i < response.length; i++) {
+ if (response[i].match(/device/) && response[i].match(/emulator/)) {
+ started_emulator_list.push(response[i].replace(/\tdevice/, '').replace('\r', ''));
+ }
+ }
+ return started_emulator_list;
+ });
+}
+
+module.exports.get_target = function() {
+ var target = shell.grep(/target=android-[\d+]/, path.join(ROOT, 'project.properties'));
+ return target.split('=')[1].replace('\n', '').replace('\r', '').replace(' ', '');
+}
+
+// Returns a promise.
+module.exports.list_targets = function() {
+ return exec('android list targets')
+ .then(function(output) {
+ var target_out = output.split('\n');
+ var targets = [];
+ for (var i = target_out.length; i >= 0; i--) {
+ if(target_out[i].match(/id:/)) {
+ targets.push(targets[i].split(' ')[1]);
+ }
+ }
+ return targets;
+ });
+}
+
+/*
+ * Starts an emulator with the given ID,
+ * and returns the started ID of that emulator.
+ * If no ID is given it will used the first image availible,
+ * if no image is availible it will error out (maybe create one?).
+ *
+ * Returns a promise.
+ */
+module.exports.start = function(emulator_ID) {
+ var self = this;
+ var emulator_id, num_started, started_emulators;
+
+ return self.list_started()
+ .then(function(list) {
+ started_emulators = list;
+ num_started = started_emulators.length;
+ if (typeof emulator_ID === 'undefined') {
+ return self.list_images()
+ .then(function(emulator_list) {
+ if (emulator_list.length > 0) {
+ return self.best_image()
+ .then(function(best) {
+ emulator_ID = best.name;
+ console.log('WARNING : no emulator specified, defaulting to ' + emulator_ID);
+ return emulator_ID;
+ });
+ } else {
+ return Q.reject('ERROR : No emulator images (avds) found, if you would like to create an\n' +
+ ' avd follow the instructions provided here:\n' +
+ ' http://developer.android.com/tools/devices/index.html\n' +
+ ' Or run \'android create avd --name <name> --target <targetID>\'\n' +
+ ' in on the command line.');
+ }
+ });
+ } else {
+ return Q(emulator_ID);
+ }
+ }).then(function() {
+ var cmd, args;
+ if(process.platform == 'win32' || process.platform == 'win64') {
+ cmd = '%comspec%';
+ args = ['/c', 'start', 'cmd', '/c', 'emulator', '-avd', emulator_ID];
+ } else {
+ cmd = 'emulator';
+ args = ['-avd', emulator_ID];
+ }
+ var proc = child_process.spawn(cmd, args, { stdio: 'inherit', detached: true });
+ proc.unref(); // Don't wait for it to finish, since the emulator will probably keep running for a long time.
+ }).then(function() {
+ // wait for emulator to start
+ console.log('Waiting for emulator...');
+ return self.wait_for_emulator(num_started);
+ }).then(function(new_started) {
+ if (new_started.length > 1) {
+ for (i in new_started) {
+ if (started_emulators.indexOf(new_started[i]) < 0) {
+ emulator_id = new_started[i];
+ }
+ }
+ } else {
+ emulator_id = new_started[0];
+ }
+ if (!emulator_id) return Q.reject('ERROR : Failed to start emulator, could not find new emulator');
+
+ //wait for emulator to boot up
+ process.stdout.write('Booting up emulator (this may take a while)...');
+ return self.wait_for_boot(emulator_id);
+ }).then(function() {
+ console.log('BOOT COMPLETE');
+
+ //unlock screen
+ return exec('adb -s ' + emulator_id + ' shell input keyevent 82');
+ }).then(function() {
+ //return the new emulator id for the started emulators
+ return emulator_id;
+ });
+}
+
+/*
+ * Waits for the new emulator to apear on the started-emulator list.
+ * Returns a promise with a list of newly started emulators' IDs.
+ */
+module.exports.wait_for_emulator = function(num_running) {
+ var self = this;
+ return self.list_started()
+ .then(function(new_started) {
+ if (new_started.length > num_running) {
+ return new_started;
+ } else {
+ return Q.delay(1000).then(function() {
+ return self.wait_for_emulator(num_running);
+ });
+ }
+ });
+}
+
+/*
+ * Waits for the boot animation property of the emulator to switch to 'stopped'
+ */
+module.exports.wait_for_boot = function(emulator_id) {
+ var self = this;
+ return exec('adb -s ' + emulator_id + ' shell getprop init.svc.bootanim')
+ .then(function(output) {
+ if (output.match(/stopped/)) {
+ return;
+ } else {
+ process.stdout.write('.');
+ return Q.delay(3000).then(function() {
+ return self.wait_for_boot(emulator_id);
+ });
+ }
+ });
+}
+
+/*
+ * Create avd
+ * TODO : Enter the stdin input required to complete the creation of an avd.
+ * Returns a promise.
+ */
+module.exports.create_image = function(name, target) {
+ console.log('Creating avd named ' + name);
+ if (target) {
+ return exec('android create avd --name ' + name + ' --target ' + target)
+ .then(null, function(error) {
+ console.error('ERROR : Failed to create emulator image : ');
+ console.error(' Do you have the latest android targets including ' + target + '?');
+ console.error(create.output);
+ });
+ } else {
+ console.log('WARNING : Project target not found, creating avd with a different target but the project may fail to install.');
+ return exec('android create avd --name ' + name + ' --target ' + this.list_targets()[0])
+ .then(function() {
+ // TODO: This seems like another error case, even though it always happens.
+ console.error('ERROR : Unable to create an avd emulator, no targets found.');
+ console.error('Please insure you have targets availible by runing the "android" command');
+ return Q.reject();
+ }, function(error) {
+ console.error('ERROR : Failed to create emulator image : ');
+ console.error(error);
+ });
+ }
+}
+
+/*
+ * Installs a previously built application on the emulator and launches it.
+ * If no target is specified, then it picks one.
+ * If no started emulators are found, error out.
+ * Returns a promise.
+ */
+module.exports.install = function(target) {
+ var self = this;
+ return this.list_started()
+ .then(function(emulator_list) {
+ if (emulator_list.length < 1) {
+ return Q.reject('No started emulators found, please start an emultor before deploying your project.');
+ }
+
+ // default emulator
+ target = typeof target !== 'undefined' ? target : emulator_list[0];
+ if (emulator_list.indexOf(target) < 0) {
+ return Q.reject('Unable to find target \'' + target + '\'. Failed to deploy to emulator.');
+ }
+
+ console.log('Installing app on emulator...');
+ var apk_path = build.get_apk();
+ return exec('adb -s ' + target + ' install -r ' + apk_path);
+ }).then(function(output) {
+ if (output.match(/Failure/)) {
+ return Q.reject('Failed to install apk to emulator: ' + output);
+ }
+ return Q();
+ }, function(err) {
+ return Q.reject('Failed to install apk to emulator: ' + err);
+ }).then(function() {
+ //unlock screen
+ return exec('adb -s ' + target + ' shell input keyevent 82');
+ }).then(function() {
+ // launch the application
+ console.log('Launching application...');
+ var launchName = appinfo.getActivityName();
+ cmd = 'adb -s ' + target + ' shell am start -W -a android.intent.action.MAIN -n ' + launchName;
+ return exec(cmd);
+ }).then(function(output) {
+ console.log('LAUNCH SUCCESS');
+ }, function(err) {
+ return Q.reject('Failed to launch app on emulator: ' + err);
+ });
+}
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/cordova/lib/exec.js
----------------------------------------------------------------------
diff --git a/test/cordova/lib/exec.js b/test/cordova/lib/exec.js
new file mode 100644
index 0000000..6afa9c0
--- /dev/null
+++ b/test/cordova/lib/exec.js
@@ -0,0 +1,43 @@
+#!/usr/bin/env node
+
+/*
+ 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
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+var child_process = require('child_process'),
+ Q = require('q');
+
+// Takes a command and optional current working directory.
+// Returns a promise that either resolves with the stdout, or
+// rejects with an error message and the stderr.
+module.exports = function(cmd, opt_cwd) {
+ var d = Q.defer();
+ console.log('exec: ' + cmd);
+ try {
+ child_process.exec(cmd, {cwd: opt_cwd}, function(err, stdout, stderr) {
+ console.log([cmd, err, stdout, stderr]);
+ if (err) d.reject('Error executing "' + cmd + '": ' + stderr);
+ else d.resolve(stdout);
+ });
+ } catch(e) {
+ console.error('error caught: ' + e);
+ d.reject(e);
+ }
+ return d.promise;
+}
+
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/cordova/lib/install-device
----------------------------------------------------------------------
diff --git a/test/cordova/lib/install-device b/test/cordova/lib/install-device
new file mode 100755
index 0000000..fc4b784
--- /dev/null
+++ b/test/cordova/lib/install-device
@@ -0,0 +1,42 @@
+#!/usr/bin/env node
+
+/*
+ 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
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+var device = require('./device'),
+ args = process.argv;
+
+if(args.length > 2) {
+ var install_target;
+ if (args[2].substring(0, 9) == '--target=') {
+ install_target = args[2].substring(9, args[2].length);
+ device.install(install_target).done(null, function(err) {
+ console.error('ERROR: ' + err);
+ process.exit(2);
+ });
+ } else {
+ console.error('ERROR : argument \'' + args[2] + '\' not recognized.');
+ process.exit(2);
+ }
+} else {
+ device.install().done(null, function(err) {
+ console.error('ERROR: ' + err);
+ process.exit(2);
+ });
+}
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/cordova/lib/install-device.bat
----------------------------------------------------------------------
diff --git a/test/cordova/lib/install-device.bat b/test/cordova/lib/install-device.bat
new file mode 100644
index 0000000..ac7214a
--- /dev/null
+++ b/test/cordova/lib/install-device.bat
@@ -0,0 +1,26 @@
+:: 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
+:: to you under the Apache License, Version 2.0 (the
+:: "License"); you may not use this file except in compliance
+:: with the License. You may obtain a copy of the License at
+::
+:: http://www.apache.org/licenses/LICENSE-2.0
+::
+:: Unless required by applicable law or agreed to in writing,
+:: software distributed under the License is distributed on an
+:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+:: KIND, either express or implied. See the License for the
+:: specific language governing permissions and limitations
+:: under the License.
+
+@ECHO OFF
+SET script_path="%~dp0install-device"
+IF EXIST %script_path% (
+ node "%script_path%" %*
+) ELSE (
+ ECHO.
+ ECHO ERROR: Could not find 'install-device' script in 'cordova\lib' folder, aborting...>&2
+ EXIT /B 1
+)
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/cordova/lib/install-emulator
----------------------------------------------------------------------
diff --git a/test/cordova/lib/install-emulator b/test/cordova/lib/install-emulator
new file mode 100755
index 0000000..aa2a34f
--- /dev/null
+++ b/test/cordova/lib/install-emulator
@@ -0,0 +1,38 @@
+#!/usr/bin/env node
+
+/*
+ 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
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+var emulator = require('./emulator'),
+ args = process.argv;
+
+var install_target;
+if(args.length > 2) {
+ if (args[2].substring(0, 9) == '--target=') {
+ install_target = args[2].substring(9, args[2].length);
+ } else {
+ console.error('ERROR : argument \'' + args[2] + '\' not recognized.');
+ process.exit(2);
+ }
+}
+
+emulator.install(install_target).done(null, function(err) {
+ console.error('ERROR: ' + err);
+ process.exit(2);
+});
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/cordova/lib/install-emulator.bat
----------------------------------------------------------------------
diff --git a/test/cordova/lib/install-emulator.bat b/test/cordova/lib/install-emulator.bat
new file mode 100644
index 0000000..1ec6779
--- /dev/null
+++ b/test/cordova/lib/install-emulator.bat
@@ -0,0 +1,26 @@
+:: 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
+:: to you under the Apache License, Version 2.0 (the
+:: "License"); you may not use this file except in compliance
+:: with the License. You may obtain a copy of the License at
+::
+:: http://www.apache.org/licenses/LICENSE-2.0
+::
+:: Unless required by applicable law or agreed to in writing,
+:: software distributed under the License is distributed on an
+:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+:: KIND, either express or implied. See the License for the
+:: specific language governing permissions and limitations
+:: under the License.
+
+@ECHO OFF
+SET script_path="%~dp0install-emulator"
+IF EXIST %script_path% (
+ node "%script_path%" %*
+) ELSE (
+ ECHO.
+ ECHO ERROR: Could not find 'install-emulator' script in 'cordova\lib' folder, aborting...>&2
+ EXIT /B 1
+)
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/cordova/lib/list-devices
----------------------------------------------------------------------
diff --git a/test/cordova/lib/list-devices b/test/cordova/lib/list-devices
new file mode 100755
index 0000000..e390bff
--- /dev/null
+++ b/test/cordova/lib/list-devices
@@ -0,0 +1,33 @@
+#!/usr/bin/env node
+
+/*
+ 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
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+var devices = require('./device');
+
+// Usage support for when args are given
+devices.list().done(function(device_list) {
+ device_list && device_list.forEach(function(dev) {
+ console.log(dev);
+ });
+}, function(err) {
+ console.error('ERROR: ' + err);
+ process.exit(2);
+});
+
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/cordova/lib/list-devices.bat
----------------------------------------------------------------------
diff --git a/test/cordova/lib/list-devices.bat b/test/cordova/lib/list-devices.bat
new file mode 100644
index 0000000..c0bcdd9
--- /dev/null
+++ b/test/cordova/lib/list-devices.bat
@@ -0,0 +1,26 @@
+:: 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
+:: to you under the Apache License, Version 2.0 (the
+:: "License"); you may not use this file except in compliance
+:: with the License. You may obtain a copy of the License at
+::
+:: http://www.apache.org/licenses/LICENSE-2.0
+::
+:: Unless required by applicable law or agreed to in writing,
+:: software distributed under the License is distributed on an
+:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+:: KIND, either express or implied. See the License for the
+:: specific language governing permissions and limitations
+:: under the License.
+
+@ECHO OFF
+SET script_path="%~dp0list-devices"
+IF EXIST %script_path% (
+ node "%script_path%" %*
+) ELSE (
+ ECHO.
+ ECHO ERROR: Could not find 'list-devices' script in 'cordova\lib' folder, aborting...>&2
+ EXIT /B 1
+)
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/cordova/lib/list-emulator-images
----------------------------------------------------------------------
diff --git a/test/cordova/lib/list-emulator-images b/test/cordova/lib/list-emulator-images
new file mode 100755
index 0000000..996cf55
--- /dev/null
+++ b/test/cordova/lib/list-emulator-images
@@ -0,0 +1,32 @@
+#!/usr/bin/env node
+
+/*
+ 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
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+var emulators = require('./emulator');
+
+// Usage support for when args are given
+emulators.list_images().done(function(emulator_list) {
+ emulator_list && emulator_list.forEach(function(emu) {
+ console.log(emu.name);
+ });
+}, function(err) {
+ console.error('ERROR: ' + err);
+ process.exit(2);
+});
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/cordova/lib/list-emulator-images.bat
----------------------------------------------------------------------
diff --git a/test/cordova/lib/list-emulator-images.bat b/test/cordova/lib/list-emulator-images.bat
new file mode 100644
index 0000000..661cbf9
--- /dev/null
+++ b/test/cordova/lib/list-emulator-images.bat
@@ -0,0 +1,26 @@
+:: 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
+:: to you under the Apache License, Version 2.0 (the
+:: "License"); you may not use this file except in compliance
+:: with the License. You may obtain a copy of the License at
+::
+:: http://www.apache.org/licenses/LICENSE-2.0
+::
+:: Unless required by applicable law or agreed to in writing,
+:: software distributed under the License is distributed on an
+:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+:: KIND, either express or implied. See the License for the
+:: specific language governing permissions and limitations
+:: under the License.
+
+@ECHO OFF
+SET script_path="%~dp0list-emulator-images"
+IF EXIST %script_path% (
+ node "%script_path%" %*
+) ELSE (
+ ECHO.
+ ECHO ERROR: Could not find 'list-emulator-images' script in 'cordova\lib' folder, aborting...>&2
+ EXIT /B 1
+)
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/cordova/lib/list-started-emulators
----------------------------------------------------------------------
diff --git a/test/cordova/lib/list-started-emulators b/test/cordova/lib/list-started-emulators
new file mode 100755
index 0000000..2ae8c5a
--- /dev/null
+++ b/test/cordova/lib/list-started-emulators
@@ -0,0 +1,32 @@
+#!/usr/bin/env node
+
+/*
+ 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
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+var emulators = require('./emulator');
+
+// Usage support for when args are given
+emulators.list_started().done(function(emulator_list) {
+ emulator_list && emulator_list.forEach(function(emu) {
+ console.log(emu);
+ });
+}, function(err) {
+ console.error('ERROR: ' + err);
+ process.exit(2);
+});
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/cordova/lib/list-started-emulators.bat
----------------------------------------------------------------------
diff --git a/test/cordova/lib/list-started-emulators.bat b/test/cordova/lib/list-started-emulators.bat
new file mode 100644
index 0000000..a4e88f7
--- /dev/null
+++ b/test/cordova/lib/list-started-emulators.bat
@@ -0,0 +1,26 @@
+:: 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
+:: to you under the Apache License, Version 2.0 (the
+:: "License"); you may not use this file except in compliance
+:: with the License. You may obtain a copy of the License at
+::
+:: http://www.apache.org/licenses/LICENSE-2.0
+::
+:: Unless required by applicable law or agreed to in writing,
+:: software distributed under the License is distributed on an
+:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+:: KIND, either express or implied. See the License for the
+:: specific language governing permissions and limitations
+:: under the License.
+
+@ECHO OFF
+SET script_path="%~dp0list-started-emulators"
+IF EXIST %script_path% (
+ node "%script_path%" %*
+) ELSE (
+ ECHO.
+ ECHO ERROR: Could not find 'list-started-emulators' script in 'cordova\lib' folder, aborting...>&2
+ EXIT /B 1
+)
\ No newline at end of file