From dd0b6b1e30f592a208147fb76a2f7079e421de85 Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Fri, 11 May 2012 15:14:35 -0700 Subject: [PATCH] Adding empty tests. May have to re-think the way we test this method --- .../apache/cordova/test/BackButtonTest.java | 49 +++++++++++++++++++ .../cordova/test/CordovaActivityTest.java | 3 +- .../org/apache/cordova/test/ErrorUrlTest.java | 35 +++++++++++++ .../apache/cordova/test/HtmlNotFoundTest.java | 11 +++++ .../org/apache/cordova/test/IFrameTest.java | 11 +++++ .../org/apache/cordova/test/JQMTabTest.java | 12 +++++ .../apache/cordova/test/LifecycleTest.java | 11 +++++ .../apache/cordova/test/LoadTimeoutTest.java | 10 ++++ .../apache/cordova/test/SplashscreenTest.java | 12 +++++ .../apache/cordova/test/UserWebViewTest.java | 11 +++++ .../apache/cordova/test/WhitelistTest.java | 12 +++++ test/src/org/apache/cordova/test/XhrTest.java | 11 +++++ .../src/org/apache/cordova/test/errorurl.java | 2 + 13 files changed, 189 insertions(+), 1 deletion(-) create mode 100644 test/src/org/apache/cordova/test/BackButtonTest.java create mode 100644 test/src/org/apache/cordova/test/ErrorUrlTest.java create mode 100644 test/src/org/apache/cordova/test/HtmlNotFoundTest.java create mode 100644 test/src/org/apache/cordova/test/IFrameTest.java create mode 100644 test/src/org/apache/cordova/test/JQMTabTest.java create mode 100644 test/src/org/apache/cordova/test/LifecycleTest.java create mode 100644 test/src/org/apache/cordova/test/LoadTimeoutTest.java create mode 100644 test/src/org/apache/cordova/test/SplashscreenTest.java create mode 100644 test/src/org/apache/cordova/test/UserWebViewTest.java create mode 100644 test/src/org/apache/cordova/test/WhitelistTest.java create mode 100644 test/src/org/apache/cordova/test/XhrTest.java 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