mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 07:02:51 +08:00
Adding empty tests. May have to re-think the way we test this method
This commit is contained in:
parent
5b324c85b0
commit
dd0b6b1e30
49
test/src/org/apache/cordova/test/BackButtonTest.java
Normal file
49
test/src/org/apache/cordova/test/BackButtonTest.java
Normal 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");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -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 {
|
||||
|
35
test/src/org/apache/cordova/test/ErrorUrlTest.java
Normal file
35
test/src/org/apache/cordova/test/ErrorUrlTest.java
Normal 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);
|
||||
}
|
||||
|
||||
}
|
11
test/src/org/apache/cordova/test/HtmlNotFoundTest.java
Normal file
11
test/src/org/apache/cordova/test/HtmlNotFoundTest.java
Normal 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);
|
||||
}
|
||||
}
|
11
test/src/org/apache/cordova/test/IFrameTest.java
Normal file
11
test/src/org/apache/cordova/test/IFrameTest.java
Normal 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);
|
||||
}
|
||||
|
||||
}
|
12
test/src/org/apache/cordova/test/JQMTabTest.java
Normal file
12
test/src/org/apache/cordova/test/JQMTabTest.java
Normal 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
|
||||
}
|
||||
|
||||
}
|
11
test/src/org/apache/cordova/test/LifecycleTest.java
Normal file
11
test/src/org/apache/cordova/test/LifecycleTest.java
Normal 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);
|
||||
}
|
||||
}
|
10
test/src/org/apache/cordova/test/LoadTimeoutTest.java
Normal file
10
test/src/org/apache/cordova/test/LoadTimeoutTest.java
Normal 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);
|
||||
}
|
||||
}
|
12
test/src/org/apache/cordova/test/SplashscreenTest.java
Normal file
12
test/src/org/apache/cordova/test/SplashscreenTest.java
Normal 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);
|
||||
}
|
||||
|
||||
}
|
11
test/src/org/apache/cordova/test/UserWebViewTest.java
Normal file
11
test/src/org/apache/cordova/test/UserWebViewTest.java
Normal 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);
|
||||
}
|
||||
}
|
12
test/src/org/apache/cordova/test/WhitelistTest.java
Normal file
12
test/src/org/apache/cordova/test/WhitelistTest.java
Normal 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);
|
||||
}
|
||||
|
||||
}
|
11
test/src/org/apache/cordova/test/XhrTest.java
Normal file
11
test/src/org/apache/cordova/test/XhrTest.java
Normal 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);
|
||||
}
|
||||
}
|
@ -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");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user