');
+document.write('');
diff --git a/test/assets/www/htmlnotfound/error.html b/test/assets/www/htmlnotfound/error.html
new file mode 100755
index 00000000..3e9a61a8
--- /dev/null
+++ b/test/assets/www/htmlnotfound/error.html
@@ -0,0 +1 @@
+This is an error page.
\ No newline at end of file
diff --git a/test/assets/www/iframe/index.html b/test/assets/www/iframe/index.html
new file mode 100755
index 00000000..b4f358f0
--- /dev/null
+++ b/test/assets/www/iframe/index.html
@@ -0,0 +1,32 @@
+
+
+
+
+
+ Cordova Tests
+
+
+
+
+
+
+ IFrame
+
+
Platform: , Version:
+ UUID: , Name:
+ Width: , Height:
+ , Color Depth:
+
+
+ Loading Google Maps should be successful.
+ Some reason loading Page 2 & Cordova page replaces current page. (ERROR?)
+
+
+ Google Maps
+ Page 2
+ Cordova page
+
+
diff --git a/test/assets/www/iframe/index2.html b/test/assets/www/iframe/index2.html
new file mode 100755
index 00000000..3b3530ea
--- /dev/null
+++ b/test/assets/www/iframe/index2.html
@@ -0,0 +1,23 @@
+
+
+
+
+
+ Cordova Tests
+
+
+
+
+
+ IFrame window
+
+
Platform: , Version:
+ UUID: , Name:
+ Width: , Height:
+ , Color Depth:
+
+
+ This is displaying a Cordova page inside iframe. The info above should be filled out.
+
+
+
diff --git a/test/assets/www/index.html b/test/assets/www/index.html
new file mode 100755
index 00000000..7262bb6e
--- /dev/null
+++ b/test/assets/www/index.html
@@ -0,0 +1,44 @@
+
+
+
+
+
+ Cordova Tests
+
+
+
+
+
+
+
+ Cordova Android Tests
+
+
Platform: , Version:
+ UUID: , Name:
+ Width: , Height:
+ , Color Depth:
+
+
+ Backbutton jQM tab
+ Backbutton with multiple pages
+ Error URL
+ HTML not found
+ IFrame
+ Lifecycle
+ Loading indicator
+ Menus
+ No multitasking
+ Splash screen
+ Load timeout
+ User WebView/Client/Chrome
+ Whitelist
+ XHR
+
+
diff --git a/test/assets/www/jqmtabbackbutton/index.html b/test/assets/www/jqmtabbackbutton/index.html
new file mode 100755
index 00000000..ee3bcfaa
--- /dev/null
+++ b/test/assets/www/jqmtabbackbutton/index.html
@@ -0,0 +1,49 @@
+
+
+
+Backbutton
+
+
+
+
+
+
+
+
+
+
+
+
Main
+
+
+ To test, press several tabs.
+ The "backbutton" can be pressed any time to exit app.
+
+
+
\ No newline at end of file
diff --git a/test/assets/www/jqmtabbackbutton/tab1.html b/test/assets/www/jqmtabbackbutton/tab1.html
new file mode 100755
index 00000000..4d321424
--- /dev/null
+++ b/test/assets/www/jqmtabbackbutton/tab1.html
@@ -0,0 +1,29 @@
+
+
+
+Tab 1
+
+
+
+
+
+
Tab 1
+
+
+Tab 1 content.
+
+
+
+
\ No newline at end of file
diff --git a/test/assets/www/jqmtabbackbutton/tab2.html b/test/assets/www/jqmtabbackbutton/tab2.html
new file mode 100755
index 00000000..a701b435
--- /dev/null
+++ b/test/assets/www/jqmtabbackbutton/tab2.html
@@ -0,0 +1,30 @@
+
+
+
+Tab 2
+
+
+
+
+
+
+
Tab 2
+
+
+Tab 2 content.
+
+
+
+
\ No newline at end of file
diff --git a/test/assets/www/jqmtabbackbutton/tab3.html b/test/assets/www/jqmtabbackbutton/tab3.html
new file mode 100755
index 00000000..c07cd904
--- /dev/null
+++ b/test/assets/www/jqmtabbackbutton/tab3.html
@@ -0,0 +1,30 @@
+
+
+
+Tab 3
+
+
+
+
+
+
+
Tab 3
+
+
+Tab 3 content.
+
+
+
+
\ No newline at end of file
diff --git a/test/assets/www/lifecycle/index.html b/test/assets/www/lifecycle/index.html
new file mode 100755
index 00000000..acea9e13
--- /dev/null
+++ b/test/assets/www/lifecycle/index.html
@@ -0,0 +1,99 @@
+
+
+
+
+
+Lifecycle Page 1
+
+
+
+
+
+
+ Events
+
+
+ Platform: , Version:
+
+
+ UUID: , Name:
+
+
+ Width: , Height:
+ , Color Depth:
+
+
+
+
Press "Home" button, then return to this app to see pause/resume.
+ There should be "Running" entries between pause and resume since app continues to run in the background.
+
+
+
Info for event testing:
+
+
+
+ Load new page
+ Clear status
+
+
+
+
+
+
diff --git a/test/assets/www/lifecycle/index2.html b/test/assets/www/lifecycle/index2.html
new file mode 100755
index 00000000..cc14e353
--- /dev/null
+++ b/test/assets/www/lifecycle/index2.html
@@ -0,0 +1,98 @@
+
+
+
+
+
+Lifecycle Page 2
+
+
+
+
+
+
+ Events
+
+
+ Platform: , Version:
+
+
+ UUID: , Name:
+
+
+ Width: , Height:
+ , Color Depth:
+
+
+
+
Press "Back" button to return to Page 1.
+
+
+
Info for event testing:
+
+
+
+ Load new page
+ Clear status
+
+
+
+
+
+
diff --git a/test/assets/www/main.js b/test/assets/www/main.js
new file mode 100755
index 00000000..f6316928
--- /dev/null
+++ b/test/assets/www/main.js
@@ -0,0 +1,146 @@
+var deviceInfo = function() {
+ document.getElementById("platform").innerHTML = device.platform;
+ document.getElementById("version").innerHTML = device.version;
+ document.getElementById("uuid").innerHTML = device.uuid;
+ document.getElementById("name").innerHTML = device.name;
+ document.getElementById("width").innerHTML = screen.width;
+ document.getElementById("height").innerHTML = screen.height;
+ document.getElementById("colorDepth").innerHTML = screen.colorDepth;
+};
+
+var getLocation = function() {
+ var suc = function(p) {
+ alert(p.coords.latitude + " " + p.coords.longitude);
+ };
+ var locFail = function() {
+ };
+ navigator.geolocation.getCurrentPosition(suc, locFail);
+};
+
+var beep = function() {
+ navigator.notification.beep(2);
+};
+
+var vibrate = function() {
+ navigator.notification.vibrate(0);
+};
+
+function roundNumber(num) {
+ var dec = 3;
+ var result = Math.round(num * Math.pow(10, dec)) / Math.pow(10, dec);
+ return result;
+}
+
+var accelerationWatch = null;
+
+function updateAcceleration(a) {
+ document.getElementById('x').innerHTML = roundNumber(a.x);
+ document.getElementById('y').innerHTML = roundNumber(a.y);
+ document.getElementById('z').innerHTML = roundNumber(a.z);
+}
+
+var toggleAccel = function() {
+ if (accelerationWatch !== null) {
+ navigator.accelerometer.clearWatch(accelerationWatch);
+ updateAcceleration({
+ x : "",
+ y : "",
+ z : ""
+ });
+ accelerationWatch = null;
+ } else {
+ var options = {};
+ options.frequency = 1000;
+ accelerationWatch = navigator.accelerometer.watchAcceleration(
+ updateAcceleration, function(ex) {
+ alert("accel fail (" + ex.name + ": " + ex.message + ")");
+ }, options);
+ }
+};
+
+var preventBehavior = function(e) {
+ e.preventDefault();
+};
+
+function dump_pic(data) {
+ var viewport = document.getElementById('viewport');
+ console.log(data);
+ viewport.style.display = "";
+ viewport.style.position = "absolute";
+ viewport.style.top = "10px";
+ viewport.style.left = "10px";
+ document.getElementById("test_img").src = "data:image/jpeg;base64," + data;
+}
+
+function fail(msg) {
+ alert(msg);
+}
+
+function show_pic() {
+ navigator.camera.getPicture(dump_pic, fail, {
+ quality : 50
+ });
+}
+
+function close() {
+ var viewport = document.getElementById('viewport');
+ viewport.style.position = "relative";
+ viewport.style.display = "none";
+}
+
+function contacts_success(contacts) {
+ alert(contacts.length
+ + ' contacts returned.'
+ + (contacts[2] && contacts[2].name ? (' Third contact is ' + contacts[2].name.formatted)
+ : ''));
+}
+
+function get_contacts() {
+ var obj = new ContactFindOptions();
+ obj.filter = "";
+ obj.multiple = true;
+ navigator.contacts.find(
+ [ "displayName", "name" ], contacts_success,
+ fail, obj);
+}
+
+function check_network() {
+ var networkState = navigator.network.connection.type;
+
+ var states = {};
+ states[Connection.UNKNOWN] = 'Unknown connection';
+ states[Connection.ETHERNET] = 'Ethernet connection';
+ states[Connection.WIFI] = 'WiFi connection';
+ states[Connection.CELL_2G] = 'Cell 2G connection';
+ states[Connection.CELL_3G] = 'Cell 3G connection';
+ states[Connection.CELL_4G] = 'Cell 4G connection';
+ states[Connection.NONE] = 'No network connection';
+
+ confirm('Connection type:\n ' + states[networkState]);
+}
+
+var watchID = null;
+
+function updateHeading(h) {
+ document.getElementById('h').innerHTML = h.magneticHeading;
+}
+
+function toggleCompass() {
+ if (watchID !== null) {
+ navigator.compass.clearWatch(watchID);
+ watchID = null;
+ updateHeading({ magneticHeading : "Off"});
+ } else {
+ var options = { frequency: 1000 };
+ watchID = navigator.compass.watchHeading(updateHeading, function(e) {
+ alert('Compass Error: ' + e.code);
+ }, options);
+ }
+}
+
+function init() {
+ // the next line makes it impossible to see Contacts on the HTC Evo since it
+ // doesn't have a scroll button
+ // document.addEventListener("touchmove", preventBehavior, false);
+ document.addEventListener("deviceready", deviceInfo, true);
+}
diff --git a/test/assets/www/master.css b/test/assets/www/master.css
new file mode 100755
index 00000000..60a8451e
--- /dev/null
+++ b/test/assets/www/master.css
@@ -0,0 +1,117 @@
+ body {
+ background:#222 none repeat scroll 0 0;
+ color:#666;
+ font-family:Helvetica;
+ font-size:72%;
+ line-height:1.5em;
+ margin:0;
+ border-top:1px solid #393939;
+ }
+
+ #info{
+ background:#ffa;
+ border: 1px solid #ffd324;
+ -webkit-border-radius: 5px;
+ border-radius: 5px;
+ clear:both;
+ margin:15px 6px 0;
+ width:295px;
+ padding:4px 0px 2px 10px;
+ }
+
+ #info > h4{
+ font-size:.95em;
+ margin:5px 0;
+ }
+
+ #stage.theme{
+ padding-top:3px;
+ }
+
+ /* Definition List */
+ #stage.theme > dl{
+ padding-top:10px;
+ clear:both;
+ margin:0;
+ list-style-type:none;
+ padding-left:10px;
+ overflow:auto;
+ }
+
+ #stage.theme > dl > dt{
+ font-weight:bold;
+ float:left;
+ margin-left:5px;
+ }
+
+ #stage.theme > dl > dd{
+ width:45px;
+ float:left;
+ color:#a87;
+ font-weight:bold;
+ }
+
+ /* Content Styling */
+ #stage.theme > h1, #stage.theme > h2, #stage.theme > p{
+ margin:1em 0 .5em 13px;
+ }
+
+ #stage.theme > h1{
+ color:#eee;
+ font-size:1.6em;
+ text-align:center;
+ margin:0;
+ margin-top:15px;
+ padding:0;
+ }
+
+ #stage.theme > h2{
+ clear:both;
+ margin:0;
+ padding:3px;
+ font-size:1em;
+ text-align:center;
+ }
+
+ /* Stage Buttons */
+ #stage.theme a.btn{
+ border: 1px solid #555;
+ -webkit-border-radius: 5px;
+ border-radius: 5px;
+ text-align:center;
+ display:block;
+ float:left;
+ background:#444;
+ width:150px;
+ color:#9ab;
+ font-size:1.1em;
+ text-decoration:none;
+ padding:1.2em 0;
+ margin:3px 0px 3px 5px;
+ }
+ #stage.theme a.btn.large{
+ width:308px;
+ padding:1.2em 0;
+ }
+
+ /* Stage Buttons */
+ #stage.theme button.btn{
+ border: 1px solid #555;
+ -webkit-border-radius: 5px;
+ border-radius: 5px;
+ text-align:center;
+ display:block;
+ float:left;
+ background:#444;
+ width:150px;
+ color:#9ab;
+ font-size:1.1em;
+ text-decoration:none;
+ padding:1.2em 0;
+ margin:3px 0px 3px 5px;
+ }
+#stage.theme button.btn.large{
+ width:308px;
+ padding:1.2em 0;
+ }
+
diff --git a/test/assets/www/menus/index.html b/test/assets/www/menus/index.html
new file mode 100755
index 00000000..e79c7314
--- /dev/null
+++ b/test/assets/www/menus/index.html
@@ -0,0 +1,29 @@
+
+
+
+
+
+ Cordova Tests
+
+
+
+
+
+ Menu Test
+
+
Platform: , Version:
+ UUID: , Name:
+ Width: , Height:
+ , Color Depth:
+
+
+
The menu items should be:
+ Item1
+ Item2
+ Item3
+ There is also a context menu. Touch and hold finger here to see:
+ Context Item1
+
+
+
+
diff --git a/test/assets/www/splashscreen/index.html b/test/assets/www/splashscreen/index.html
new file mode 100755
index 00000000..b594c1e4
--- /dev/null
+++ b/test/assets/www/splashscreen/index.html
@@ -0,0 +1,22 @@
+
+
+
+
+
+ Cordova Tests
+
+
+
+
+
+ Splash Screen Test
+
+
Platform: , Version:
+ UUID: , Name:
+ Width: , Height:
+ , Color Depth:
+
+
+ You should have seen the splash screen for 2 seconds.
+
+
diff --git a/test/assets/www/userwebview/index.html b/test/assets/www/userwebview/index.html
new file mode 100755
index 00000000..9e68f67e
--- /dev/null
+++ b/test/assets/www/userwebview/index.html
@@ -0,0 +1,49 @@
+
+
+
+
+
+ Cordova Tests
+
+
+
+
+
+ User WebView/Client/Chrome Test
+
+
Platform: , Version:
+ UUID: , Name:
+ Width: , Height:
+ , Color Depth:
+
+
+
The following should be seen in LogCat:
+ userwebview: TestViewClient()
+ userwebview: TestChromeClient()
+ userwebview: onGeolocationPermissionsShowPrompt(file://)
+ userwebview: shouldOverrideUrlLoading(test://this_will_call_shouldOverrideUrlLoading)
+
+
+
+
+
diff --git a/test/assets/www/whitelist/index.html b/test/assets/www/whitelist/index.html
new file mode 100755
index 00000000..2fc7bb39
--- /dev/null
+++ b/test/assets/www/whitelist/index.html
@@ -0,0 +1,28 @@
+
+
+
+
+
+ Cordova Tests
+
+
+
+
+
+ Whitelist Page 1
+
+
Platform: , Version:
+ UUID: , Name:
+ Width: , Height:
+ , Color Depth:
+
+
+ Loading Page 2 should be successful.
+ Loading Page 3 should be in web browser.
+ Loading Page 2 with target=_blank should be in web browser? (THIS DOESN'T HAPPEN.) https://issues.apache.org/jira/browse/CB-362
+
+ Page 2
+ Page 3
+ Page 2 with target=_blank
+
+
diff --git a/test/assets/www/whitelist/index2.html b/test/assets/www/whitelist/index2.html
new file mode 100755
index 00000000..ffd991e7
--- /dev/null
+++ b/test/assets/www/whitelist/index2.html
@@ -0,0 +1,23 @@
+
+
+
+
+
+ Cordova Tests
+
+
+
+
+
+ Whitelist Page 2
+
+
Platform: , Version:
+ UUID: , Name:
+ Width: , Height:
+ , Color Depth:
+
+
+ Press "backbutton"
+
+
+
diff --git a/test/assets/www/xhr/index.html b/test/assets/www/xhr/index.html
new file mode 100755
index 00000000..9ddd6084
--- /dev/null
+++ b/test/assets/www/xhr/index.html
@@ -0,0 +1,47 @@
+
+
+
+
+
+ Cordova Tests
+
+
+
+
+
+
+ XHR
+
+
Platform: , Version:
+ UUID: , Name:
+ Width: , Height:
+ , Color Depth:
+
+
+
+ Load file://
+ Load Google
+
+
+
diff --git a/test/libs/cordova-1.6.0rc1.jar b/test/libs/cordova-1.6.0rc1.jar
new file mode 100755
index 00000000..825c0fcd
Binary files /dev/null and b/test/libs/cordova-1.6.0rc1.jar differ
diff --git a/test/project.properties b/test/project.properties
new file mode 100755
index 00000000..4bcb2f55
--- /dev/null
+++ b/test/project.properties
@@ -0,0 +1,11 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system use,
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=Google Inc.:Google APIs:14
diff --git a/test/res/drawable-hdpi/ic_launcher.png b/test/res/drawable-hdpi/ic_launcher.png
new file mode 100755
index 00000000..8074c4c5
Binary files /dev/null and b/test/res/drawable-hdpi/ic_launcher.png differ
diff --git a/test/res/drawable-ldpi/ic_launcher.png b/test/res/drawable-ldpi/ic_launcher.png
new file mode 100755
index 00000000..1095584e
Binary files /dev/null and b/test/res/drawable-ldpi/ic_launcher.png differ
diff --git a/test/res/drawable-mdpi/ic_launcher.png b/test/res/drawable-mdpi/ic_launcher.png
new file mode 100755
index 00000000..a07c69fa
Binary files /dev/null and b/test/res/drawable-mdpi/ic_launcher.png differ
diff --git a/test/res/drawable/icon.png b/test/res/drawable/icon.png
new file mode 100755
index 00000000..697df7f3
Binary files /dev/null and b/test/res/drawable/icon.png differ
diff --git a/test/res/drawable/sandy.jpg b/test/res/drawable/sandy.jpg
new file mode 100755
index 00000000..c956d30b
Binary files /dev/null and b/test/res/drawable/sandy.jpg differ
diff --git a/test/res/layout/main.xml b/test/res/layout/main.xml
new file mode 100755
index 00000000..d3063e06
--- /dev/null
+++ b/test/res/layout/main.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
diff --git a/test/res/values/strings.xml b/test/res/values/strings.xml
new file mode 100755
index 00000000..010e98e0
--- /dev/null
+++ b/test/res/values/strings.xml
@@ -0,0 +1,4 @@
+
+
+ CordovaTests
+
diff --git a/test/res/xml/cordova.xml b/test/res/xml/cordova.xml
new file mode 100755
index 00000000..c7b50000
--- /dev/null
+++ b/test/res/xml/cordova.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/test/res/xml/plugins.xml b/test/res/xml/plugins.xml
new file mode 100755
index 00000000..4c651eea
--- /dev/null
+++ b/test/res/xml/plugins.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/src/org/apache/cordova/test/ActivityPlugin.java b/test/src/org/apache/cordova/test/ActivityPlugin.java
new file mode 100755
index 00000000..5e02bf57
--- /dev/null
+++ b/test/src/org/apache/cordova/test/ActivityPlugin.java
@@ -0,0 +1,63 @@
+package org.apache.cordova.test;
+
+import org.apache.cordova.api.LOG;
+import org.json.JSONArray;
+import org.json.JSONException;
+
+import android.content.Intent;
+
+import com.phonegap.api.Plugin;
+import com.phonegap.api.PluginResult;
+
+/**
+ * This class provides a service.
+ */
+public class ActivityPlugin extends Plugin {
+
+ static String TAG = "ActivityPlugin";
+
+ /**
+ * Constructor.
+ */
+ public ActivityPlugin() {
+ }
+
+ /**
+ * Executes the request and returns PluginResult.
+ *
+ * @param action The action to execute.
+ * @param args JSONArry of arguments for the plugin.
+ * @param callbackId The callback id used when calling back into JavaScript.
+ * @return A PluginResult object with a status and message.
+ */
+ @Override
+ public PluginResult execute(String action, JSONArray args, String callbackId) {
+ PluginResult.Status status = PluginResult.Status.OK;
+ String result = "";
+
+ try {
+ if (action.equals("start")) {
+ this.startActivity(args.getString(0));
+ }
+ return new PluginResult(status, result);
+ } catch (JSONException e) {
+ return new PluginResult(PluginResult.Status.JSON_EXCEPTION);
+ }
+ }
+
+ // --------------------------------------------------------------------------
+ // LOCAL METHODS
+ // --------------------------------------------------------------------------
+
+ public void startActivity(String className) {
+ try {
+ Intent intent = new Intent().setClass(this.ctx.getContext(), Class.forName(className));
+ LOG.d(TAG, "Starting activity %s", className);
+ this.ctx.startActivity(intent);
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ LOG.e(TAG, "Error starting activity %s", className);
+ }
+ }
+
+}
diff --git a/test/src/org/apache/cordova/test/FixWebView.java b/test/src/org/apache/cordova/test/FixWebView.java
new file mode 100755
index 00000000..f656bb5a
--- /dev/null
+++ b/test/src/org/apache/cordova/test/FixWebView.java
@@ -0,0 +1,25 @@
+package org.apache.cordova.test;
+
+import android.content.Context;
+import android.webkit.WebView;
+
+public class FixWebView extends WebView {
+
+ public FixWebView(Context context) {
+ super(context);
+ }
+
+ @Override
+ public void pauseTimers() {
+ // Do nothing
+ }
+
+ /**
+ * This method is with different signature in order to stop the timers while move application to background
+ * @param realPause
+ */
+ public void pauseTimers(@SuppressWarnings("unused") boolean realPause) {
+ super.pauseTimers();
+ }
+
+}
diff --git a/test/src/org/apache/cordova/test/backbuttonmultipage.java b/test/src/org/apache/cordova/test/backbuttonmultipage.java
new file mode 100755
index 00000000..9024447e
--- /dev/null
+++ b/test/src/org/apache/cordova/test/backbuttonmultipage.java
@@ -0,0 +1,12 @@
+package org.apache.cordova.test;
+
+import android.os.Bundle;
+import org.apache.cordova.*;
+
+public class backbuttonmultipage extends DroidGap {
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ super.loadUrl("file:///android_asset/www/backbuttonmultipage/index.html");
+ }
+}
diff --git a/test/src/org/apache/cordova/test/background.java b/test/src/org/apache/cordova/test/background.java
new file mode 100755
index 00000000..aad5479b
--- /dev/null
+++ b/test/src/org/apache/cordova/test/background.java
@@ -0,0 +1,16 @@
+package org.apache.cordova.test;
+
+import android.os.Bundle;
+import android.webkit.WebView;
+
+import org.apache.cordova.*;
+
+public class background extends DroidGap {
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ super.init(new FixWebView(this), new CordovaWebViewClient(this), new CordovaChromeClient(this));
+ super.setBooleanProperty("keepRunning", false);
+ super.loadUrl("file:///android_asset/www/background/index.html");
+ }
+}
diff --git a/test/src/org/apache/cordova/test/errorurl.java b/test/src/org/apache/cordova/test/errorurl.java
new file mode 100755
index 00000000..155759e8
--- /dev/null
+++ b/test/src/org/apache/cordova/test/errorurl.java
@@ -0,0 +1,14 @@
+package org.apache.cordova.test;
+
+import android.os.Bundle;
+import org.apache.cordova.*;
+
+public class errorurl extends DroidGap {
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ super.init();
+ this.setStringProperty("errorUrl", "file:///android_asset/www/htmlnotfound/error.html");
+ super.loadUrl("file:///android_asset/www/htmlnotfound/index.html");
+ }
+}
diff --git a/test/src/org/apache/cordova/test/htmlnotfound.java b/test/src/org/apache/cordova/test/htmlnotfound.java
new file mode 100755
index 00000000..7a4389ad
--- /dev/null
+++ b/test/src/org/apache/cordova/test/htmlnotfound.java
@@ -0,0 +1,13 @@
+package org.apache.cordova.test;
+
+import android.os.Bundle;
+import org.apache.cordova.*;
+
+public class htmlnotfound extends DroidGap {
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ super.init();
+ super.loadUrl("file:///android_asset/www/htmlnotfound/index.html");
+ }
+}
diff --git a/test/src/org/apache/cordova/test/iframe.java b/test/src/org/apache/cordova/test/iframe.java
new file mode 100755
index 00000000..c018da91
--- /dev/null
+++ b/test/src/org/apache/cordova/test/iframe.java
@@ -0,0 +1,12 @@
+package org.apache.cordova.test;
+
+import android.os.Bundle;
+import org.apache.cordova.*;
+
+public class iframe extends DroidGap {
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ super.loadUrl("file:///android_asset/www/iframe/index.html");
+ }
+}
diff --git a/test/src/org/apache/cordova/test/jqmtabbackbutton.java b/test/src/org/apache/cordova/test/jqmtabbackbutton.java
new file mode 100755
index 00000000..f20244cb
--- /dev/null
+++ b/test/src/org/apache/cordova/test/jqmtabbackbutton.java
@@ -0,0 +1,12 @@
+package org.apache.cordova.test;
+
+import android.os.Bundle;
+import org.apache.cordova.*;
+
+public class jqmtabbackbutton extends DroidGap {
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ super.loadUrl("file:///android_asset/www/jqmtabbackbutton/index.html");
+ }
+}
diff --git a/test/src/org/apache/cordova/test/lifecycle.java b/test/src/org/apache/cordova/test/lifecycle.java
new file mode 100755
index 00000000..434cd360
--- /dev/null
+++ b/test/src/org/apache/cordova/test/lifecycle.java
@@ -0,0 +1,12 @@
+package org.apache.cordova.test;
+
+import android.os.Bundle;
+import org.apache.cordova.*;
+
+public class lifecycle extends DroidGap {
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ super.loadUrl("file:///android_asset/www/lifecycle/index.html");
+ }
+}
diff --git a/test/src/org/apache/cordova/test/loading.java b/test/src/org/apache/cordova/test/loading.java
new file mode 100755
index 00000000..39866e69
--- /dev/null
+++ b/test/src/org/apache/cordova/test/loading.java
@@ -0,0 +1,13 @@
+package org.apache.cordova.test;
+
+import android.os.Bundle;
+import org.apache.cordova.*;
+
+public class loading extends DroidGap {
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ super.setStringProperty("loadingDialog", "Testing,Loading...");
+ super.loadUrl("http://www.google.com");
+ }
+}
diff --git a/test/src/org/apache/cordova/test/menus.java b/test/src/org/apache/cordova/test/menus.java
new file mode 100755
index 00000000..dc539b25
--- /dev/null
+++ b/test/src/org/apache/cordova/test/menus.java
@@ -0,0 +1,62 @@
+package org.apache.cordova.test;
+
+import android.os.Bundle;
+import android.view.ContextMenu;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.ContextMenu.ContextMenuInfo;
+
+import org.apache.cordova.*;
+import org.apache.cordova.api.LOG;
+
+public class menus extends DroidGap {
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ super.init();
+ super.registerForContextMenu(super.appView);
+ super.loadUrl("file:///android_asset/www/menus/index.html");
+ }
+
+ // Demonstrate how to add your own menus to app
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ super.onCreateOptionsMenu(menu);
+ int base = Menu.FIRST;
+ // Group, item id, order, title
+ menu.add(base, base, base, "Item1");
+ menu.add(base, base + 1, base + 1, "Item2");
+ menu.add(base, base + 2, base + 2, "Item3");
+ return true;
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ LOG.d("menus", "Item " + item.getItemId() + " pressed.");
+ this.appView.loadUrl("javascript:alert('Menu " + item.getItemId() + " pressed.')");
+ return super.onOptionsItemSelected(item);
+ }
+
+ @Override
+ public boolean onPrepareOptionsMenu(Menu menu) {
+ LOG.d("menus", "onPrepareOptionsMenu()");
+ // this.appView.loadUrl("javascript:alert('onPrepareOptionsMenu()')");
+ return true;
+ }
+
+ @Override
+ public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo info) {
+ LOG.d("menus", "onCreateContextMenu()");
+ menu.setHeaderTitle("Test Context Menu");
+ menu.add(200, 200, 200, "Context Item1");
+ }
+
+ @Override
+ public boolean onContextItemSelected(MenuItem item) {
+ this.appView.loadUrl("javascript:alert('Context Menu " + item.getItemId() + " pressed.')");
+ return true;
+ }
+
+}
diff --git a/test/src/org/apache/cordova/test/splashscreen.java b/test/src/org/apache/cordova/test/splashscreen.java
new file mode 100755
index 00000000..ba45c383
--- /dev/null
+++ b/test/src/org/apache/cordova/test/splashscreen.java
@@ -0,0 +1,17 @@
+package org.apache.cordova.test;
+
+import android.os.Bundle;
+import org.apache.cordova.*;
+
+public class splashscreen extends DroidGap {
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ super.init();
+
+ // Show splashscreen
+ this.setIntegerProperty("splashscreen", R.drawable.sandy);
+
+ super.loadUrl("file:///android_asset/www/splashscreen/index.html", 2000);
+ }
+}
diff --git a/test/src/org/apache/cordova/test/tests.java b/test/src/org/apache/cordova/test/tests.java
new file mode 100755
index 00000000..99988402
--- /dev/null
+++ b/test/src/org/apache/cordova/test/tests.java
@@ -0,0 +1,14 @@
+package org.apache.cordova.test;
+
+import android.os.Bundle;
+import org.apache.cordova.*;
+
+public class tests extends DroidGap {
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ super.init();
+ super.pluginManager.addService("Activity", "org.apache.cordova.test.ActivityPlugin");
+ super.loadUrl("file:///android_asset/www/index.html");
+ }
+}
diff --git a/test/src/org/apache/cordova/test/timeout.java b/test/src/org/apache/cordova/test/timeout.java
new file mode 100755
index 00000000..09a58381
--- /dev/null
+++ b/test/src/org/apache/cordova/test/timeout.java
@@ -0,0 +1,16 @@
+package org.apache.cordova.test;
+
+import android.os.Bundle;
+import org.apache.cordova.*;
+
+public class timeout extends DroidGap {
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ super.init();
+
+ // Short timeout to cause error
+ this.setIntegerProperty("loadUrlTimeoutValue", 10);
+ super.loadUrl("http://www.google.com");
+ }
+}
diff --git a/test/src/org/apache/cordova/test/userwebview.java b/test/src/org/apache/cordova/test/userwebview.java
new file mode 100755
index 00000000..8056ef22
--- /dev/null
+++ b/test/src/org/apache/cordova/test/userwebview.java
@@ -0,0 +1,54 @@
+package org.apache.cordova.test;
+
+import android.os.Bundle;
+import android.webkit.WebView;
+import android.webkit.GeolocationPermissions.Callback;
+
+import org.apache.cordova.*;
+import org.apache.cordova.api.LOG;
+
+public class userwebview extends DroidGap {
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ super.init(new WebView(this), new TestViewClient(this), new TestChromeClient(this));
+ super.loadUrl("file:///android_asset/www/userwebview/index.html");
+ }
+
+ public class TestChromeClient extends CordovaChromeClient {
+ public TestChromeClient(DroidGap arg0) {
+ super(arg0);
+ LOG.d("userwebview", "TestChromeClient()");
+ }
+
+ @Override
+ public void onGeolocationPermissionsShowPrompt(String origin, Callback callback) {
+ LOG.d("userwebview", "onGeolocationPermissionsShowPrompt(" + origin + ")");
+ super.onGeolocationPermissionsShowPrompt(origin, callback);
+ callback.invoke(origin, true, false);
+ }
+ }
+
+ /**
+ * This class can be used to override the GapViewClient and receive notification of webview events.
+ */
+ public class TestViewClient extends CordovaWebViewClient {
+ public TestViewClient(DroidGap arg0) {
+ super(arg0);
+ LOG.d("userwebview", "TestViewClient()");
+ }
+
+ @Override
+ public boolean shouldOverrideUrlLoading(WebView view, String url) {
+ LOG.d("userwebview", "shouldOverrideUrlLoading(" + url + ")");
+ return super.shouldOverrideUrlLoading(view, url);
+ }
+
+ @Override
+ public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
+ LOG.d("userwebview", "onReceivedError: Error code=" + errorCode + " Description=" + description + " URL=" + failingUrl);
+ super.onReceivedError(view, errorCode, description, failingUrl);
+ }
+ }
+
+}
diff --git a/test/src/org/apache/cordova/test/whitelist.java b/test/src/org/apache/cordova/test/whitelist.java
new file mode 100755
index 00000000..030d439f
--- /dev/null
+++ b/test/src/org/apache/cordova/test/whitelist.java
@@ -0,0 +1,12 @@
+package org.apache.cordova.test;
+
+import android.os.Bundle;
+import org.apache.cordova.*;
+
+public class whitelist extends DroidGap {
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ super.loadUrl("file:///android_asset/www/whitelist/index.html");
+ }
+}
diff --git a/test/src/org/apache/cordova/test/xhr.java b/test/src/org/apache/cordova/test/xhr.java
new file mode 100755
index 00000000..5ec95205
--- /dev/null
+++ b/test/src/org/apache/cordova/test/xhr.java
@@ -0,0 +1,12 @@
+package org.apache.cordova.test;
+
+import android.os.Bundle;
+import org.apache.cordova.*;
+
+public class xhr extends DroidGap {
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ super.loadUrl("file:///android_asset/www/xhr/index.html");
+ }
+}