diff --git a/test/src/org/apache/cordova/test/BackButtonTest.java b/test/src/org/apache/cordova/test/BackButtonTest.java new file mode 100644 index 00000000..db09792f --- /dev/null +++ b/test/src/org/apache/cordova/test/BackButtonTest.java @@ -0,0 +1,49 @@ +package org.apache.cordova.test; + +import org.apache.cordova.CordovaWebView; + +import android.test.ActivityInstrumentationTestCase2; +import android.test.TouchUtils; +import android.widget.FrameLayout; +import android.widget.LinearLayout; + +public class BackButtonTest extends ActivityInstrumentationTestCase2 { + + private backbuttonmultipage testActivity; + private FrameLayout containerView; + private LinearLayout innerContainer; + private CordovaWebView testView; + private TouchUtils touchTest; + private long TIMEOUT = 5000; + + public BackButtonTest() { + super("org.apache.cordova.test",backbuttonmultipage.class); + } + + protected void setUp() throws Exception { + super.setUp(); + testActivity = this.getActivity(); + containerView = (FrameLayout) testActivity.findViewById(android.R.id.content); + innerContainer = (LinearLayout) containerView.getChildAt(0); + testView = (CordovaWebView) innerContainer.getChildAt(0); + touchTest = new TouchUtils(); + } + + public void testPreconditions(){ + assertNotNull(innerContainer); + assertNotNull(testView); + } + + public void testClick() { + touchTest.tapView(this, testView); + } + + private void sleep() { + try { + Thread.sleep(TIMEOUT ); + } catch (InterruptedException e) { + fail("Unexpected Timeout"); + } + } + +} diff --git a/test/src/org/apache/cordova/test/CordovaActivityTest.java b/test/src/org/apache/cordova/test/CordovaActivityTest.java index 8a38b1ad..3a5b47db 100644 --- a/test/src/org/apache/cordova/test/CordovaActivityTest.java +++ b/test/src/org/apache/cordova/test/CordovaActivityTest.java @@ -33,9 +33,10 @@ public class CordovaActivityTest extends ActivityInstrumentationTestCase2 { + + errorurl testActivity; + private FrameLayout containerView; + private LinearLayout innerContainer; + private CordovaWebView testView; + + public ErrorUrlTest() { + super("org.apache.cordova.test",errorurl.class); + } + + + protected void setUp() throws Exception { + super.setUp(); + testActivity = this.getActivity(); + containerView = (FrameLayout) testActivity.findViewById(android.R.id.content); + innerContainer = (LinearLayout) containerView.getChildAt(0); + testView = (CordovaWebView) innerContainer.getChildAt(0); + + } + + public void testPreconditions(){ + assertNotNull(innerContainer); + assertNotNull(testView); + } + +} diff --git a/test/src/org/apache/cordova/test/HtmlNotFoundTest.java b/test/src/org/apache/cordova/test/HtmlNotFoundTest.java new file mode 100644 index 00000000..4546e5ac --- /dev/null +++ b/test/src/org/apache/cordova/test/HtmlNotFoundTest.java @@ -0,0 +1,11 @@ +package org.apache.cordova.test; + +import android.test.ActivityInstrumentationTestCase2; + +public class HtmlNotFoundTest extends ActivityInstrumentationTestCase2 { + + + public HtmlNotFoundTest() { + super("org.apache.cordova.test",htmlnotfound.class); + } +} diff --git a/test/src/org/apache/cordova/test/IFrameTest.java b/test/src/org/apache/cordova/test/IFrameTest.java new file mode 100644 index 00000000..07fba57a --- /dev/null +++ b/test/src/org/apache/cordova/test/IFrameTest.java @@ -0,0 +1,11 @@ +package org.apache.cordova.test; + +import android.test.ActivityInstrumentationTestCase2; + +public class IFrameTest extends ActivityInstrumentationTestCase2