mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 07:02:51 +08:00
Two automated tests completed
This commit is contained in:
parent
e35a8de4bb
commit
5edb3acad5
@ -8,6 +8,7 @@ import android.widget.LinearLayout;
|
||||
|
||||
public class ErrorUrlTest extends ActivityInstrumentationTestCase2<errorurl> {
|
||||
|
||||
private int TIMEOUT = 1000;
|
||||
errorurl testActivity;
|
||||
private FrameLayout containerView;
|
||||
private LinearLayout innerContainer;
|
||||
@ -33,9 +34,21 @@ public class ErrorUrlTest extends ActivityInstrumentationTestCase2<errorurl> {
|
||||
|
||||
public void testUrl()
|
||||
{
|
||||
sleep();
|
||||
String good_url = "file:///android_asset/www/htmlnotfound/error.html";
|
||||
String url = testView.getUrl();
|
||||
assertNotNull(url);
|
||||
assertTrue(url.equals(good_url));
|
||||
}
|
||||
|
||||
|
||||
private void sleep() {
|
||||
try {
|
||||
Thread.sleep(TIMEOUT);
|
||||
} catch (InterruptedException e) {
|
||||
fail("Unexpected Timeout");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import android.widget.LinearLayout;
|
||||
|
||||
public class HtmlNotFoundTest extends ActivityInstrumentationTestCase2<htmlnotfound> {
|
||||
|
||||
|
||||
private int TIMEOUT = 1000;
|
||||
private htmlnotfound testActivity;
|
||||
private FrameLayout containerView;
|
||||
private LinearLayout innerContainer;
|
||||
@ -27,15 +27,26 @@ public class HtmlNotFoundTest extends ActivityInstrumentationTestCase2<htmlnotfo
|
||||
testView = (CordovaWebView) innerContainer.getChildAt(0);
|
||||
}
|
||||
|
||||
public void testPreconditions(){
|
||||
public void testPreconditions(){
|
||||
assertNotNull(innerContainer);
|
||||
assertNotNull(testView);
|
||||
}
|
||||
}
|
||||
|
||||
public void testUrl()
|
||||
{
|
||||
sleep();
|
||||
String good_url = "file:///android_asset/www/htmlnotfound/error.html";
|
||||
String url = testView.getUrl();
|
||||
assertNotNull(url);
|
||||
assertFalse(url.equals(good_url));
|
||||
}
|
||||
|
||||
private void sleep() {
|
||||
try {
|
||||
Thread.sleep(TIMEOUT);
|
||||
} catch (InterruptedException e) {
|
||||
fail("Unexpected Timeout");
|
||||
}
|
||||
}
|
||||
|
||||
public void testUrl()
|
||||
{
|
||||
String good_url = "file:///android_asset/www/htmlnotfound/error.html";
|
||||
String url = testView.getUrl();
|
||||
assertFalse(url.equals(good_url));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user