Adding empty tests. May have to re-think the way we test this method

This commit is contained in:
Joe Bowser 2012-05-11 15:14:35 -07:00
parent 5b324c85b0
commit dd0b6b1e30
13 changed files with 189 additions and 1 deletions

View File

@ -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<backbuttonmultipage> {
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");
}
}
}

View File

@ -33,9 +33,10 @@ public class CordovaActivityTest extends ActivityInstrumentationTestCase2<PhoneG
private LinearLayout innerContainer;
private CordovaWebView testView;
@SuppressWarnings("deprecation")
public CordovaActivityTest()
{
super("com.phonegap.test.activities",PhoneGapActivity.class);
super("org.apache.cordova.test",PhoneGapActivity.class);
}
protected void setUp() throws Exception {

View File

@ -0,0 +1,35 @@
package org.apache.cordova.test;
import org.apache.cordova.CordovaWebView;
import android.test.ActivityInstrumentationTestCase2;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
public class ErrorUrlTest extends ActivityInstrumentationTestCase2<errorurl> {
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);
}
}

View File

@ -0,0 +1,11 @@
package org.apache.cordova.test;
import android.test.ActivityInstrumentationTestCase2;
public class HtmlNotFoundTest extends ActivityInstrumentationTestCase2<htmlnotfound> {
public HtmlNotFoundTest() {
super("org.apache.cordova.test",htmlnotfound.class);
}
}

View File

@ -0,0 +1,11 @@
package org.apache.cordova.test;
import android.test.ActivityInstrumentationTestCase2;
public class IFrameTest extends ActivityInstrumentationTestCase2<iframe> {
public IFrameTest() {
super("org.apache.cordova.test",iframe.class);
}
}

View File

@ -0,0 +1,12 @@
package org.apache.cordova.test;
import android.test.ActivityInstrumentationTestCase2;
public class JQMTabTest extends ActivityInstrumentationTestCase2<jqmtabbackbutton> {
public JQMTabTest(Class<jqmtabbackbutton> activityClass) {
super(activityClass);
// TODO Auto-generated constructor stub
}
}

View File

@ -0,0 +1,11 @@
package org.apache.cordova.test;
import android.test.ActivityInstrumentationTestCase2;
public class LifecycleTest extends ActivityInstrumentationTestCase2<lifecycle> {
public LifecycleTest()
{
super("org.apache.cordova.test",lifecycle.class);
}
}

View File

@ -0,0 +1,10 @@
package org.apache.cordova.test;
import android.test.ActivityInstrumentationTestCase2;
public class LoadTimeoutTest extends ActivityInstrumentationTestCase2<loading> {
public LoadTimeoutTest()
{
super("org.apache.cordova.test",loading.class);
}
}

View File

@ -0,0 +1,12 @@
package org.apache.cordova.test;
import android.test.ActivityInstrumentationTestCase2;
public class SplashscreenTest extends ActivityInstrumentationTestCase2<splashscreen> {
public SplashscreenTest()
{
super("org.apache.cordova.test",splashscreen.class);
}
}

View File

@ -0,0 +1,11 @@
package org.apache.cordova.test;
import android.test.ActivityInstrumentationTestCase2;
public class UserWebViewTest extends ActivityInstrumentationTestCase2<userwebview> {
public UserWebViewTest ()
{
super(userwebview.class);
}
}

View File

@ -0,0 +1,12 @@
package org.apache.cordova.test;
import android.test.ActivityInstrumentationTestCase2;
public class WhitelistTest extends ActivityInstrumentationTestCase2<whitelist> {
public WhitelistTest()
{
super(whitelist.class);
}
}

View File

@ -0,0 +1,11 @@
package org.apache.cordova.test;
import android.test.ActivityInstrumentationTestCase2;
public class XhrTest extends ActivityInstrumentationTestCase2<xhr> {
public XhrTest()
{
super(xhr.class);
}
}

View File

@ -29,4 +29,6 @@ public class errorurl extends DroidGap {
this.setStringProperty("errorUrl", "file:///android_asset/www/htmlnotfound/error.html");
super.loadUrl("file:///android_asset/www/htmlnotfound/index.html");
}
}