mirror of
https://github.com/apache/cordova-android.git
synced 2026-05-11 00:00:05 +08:00
Make CordovaWebview resilient to init() not being called (for backwards-compatibility)
This can happen when apps are not utilizing CordovaActivity and instead creating their own CordovaWebView.
This commit is contained in:
+3
-3
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
|
||||
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
|
||||
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="src" path="gen"/>
|
||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
|
||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
|
||||
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
|
||||
<classpathentry kind="output" path="bin/classes"/>
|
||||
</classpath>
|
||||
|
||||
@@ -75,7 +75,7 @@ public class BackButtonMultiPageTest extends ActivityInstrumentationTestCase2<ba
|
||||
public void run()
|
||||
{
|
||||
String url = testView.getUrl();
|
||||
assertTrue(url.endsWith("sample2.html"));
|
||||
assertEquals("file:///android_asset/www/backbuttonmultipage/sample2.html", url);
|
||||
testView.sendJavascript("window.location = 'sample3.html';"); }
|
||||
});
|
||||
|
||||
@@ -84,8 +84,10 @@ public class BackButtonMultiPageTest extends ActivityInstrumentationTestCase2<ba
|
||||
public void run()
|
||||
{
|
||||
String url = testView.getUrl();
|
||||
assertTrue(url.endsWith("sample3.html"));
|
||||
testView.backHistory();
|
||||
assertEquals("file:///android_asset/www/backbuttonmultipage/sample3.html", url);
|
||||
testView.printBackForwardList();
|
||||
assertTrue(testView.backHistory());
|
||||
testView.printBackForwardList();
|
||||
}
|
||||
});
|
||||
sleep();
|
||||
@@ -93,8 +95,8 @@ public class BackButtonMultiPageTest extends ActivityInstrumentationTestCase2<ba
|
||||
public void run()
|
||||
{
|
||||
String url = testView.getUrl();
|
||||
assertTrue(url.endsWith("sample2.html"));
|
||||
testView.backHistory();
|
||||
assertEquals("file:///android_asset/www/backbuttonmultipage/sample2.html", url);
|
||||
assertTrue(testView.backHistory());
|
||||
}
|
||||
});
|
||||
sleep();
|
||||
@@ -102,7 +104,7 @@ public class BackButtonMultiPageTest extends ActivityInstrumentationTestCase2<ba
|
||||
public void run()
|
||||
{
|
||||
String url = testView.getUrl();
|
||||
assertTrue(url.endsWith("index.html"));
|
||||
assertEquals("file:///android_asset/www/backbuttonmultipage/index.html", url);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public class ErrorUrlTest extends ActivityInstrumentationTestCase2<errorurl> {
|
||||
String good_url = "file:///android_asset/www/htmlnotfound/error.html";
|
||||
String url = testView.getUrl();
|
||||
assertNotNull(url);
|
||||
assertTrue(url.equals(good_url));
|
||||
assertEquals(good_url, url);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user