mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 07:02:51 +08:00
Add back a test that url (and errorUrl) are not settable via Intent extras
This commit is contained in:
parent
c3267def97
commit
9baa27508a
@ -37,14 +37,11 @@ public class BaseCordovaIntegrationTest extends ActivityInstrumentationTestCase2
|
||||
super(MainTestActivity.class);
|
||||
}
|
||||
|
||||
protected void setUpWithStartUrl(String url) {
|
||||
setUpWithStartUrl(url, null, null);
|
||||
}
|
||||
protected void setUpWithStartUrl(String url, String prefKey, String prefValue) {
|
||||
protected void setUpWithStartUrl(String url, String... prefsAndValues) {
|
||||
Intent intent = new Intent(getInstrumentation().getContext(), MainTestActivity.class);
|
||||
intent.putExtra("testStartUrl", url);
|
||||
if (prefKey != null) {
|
||||
intent.putExtra(prefKey, prefValue);
|
||||
for (int i = 0; i < prefsAndValues.length; i += 2) {
|
||||
intent.putExtra(prefsAndValues[i], prefsAndValues[i + 1]);
|
||||
}
|
||||
setActivityIntent(intent);
|
||||
testActivity = getActivity();
|
||||
|
@ -24,10 +24,12 @@ package org.apache.cordova.test;
|
||||
public class ErrorUrlTest extends BaseCordovaIntegrationTest {
|
||||
private static final String START_URL = "file:///android_asset/www/htmlnotfound/index.html";
|
||||
private static final String ERROR_URL = "file:///android_asset/www/htmlnotfound/error.html";
|
||||
private static final String INVALID_URL = "file:///android_asset/www/htmlnotfound/invalid.html";
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
setUpWithStartUrl(START_URL, "testErrorUrl", ERROR_URL);
|
||||
// INVALID_URL tests that errorUrl and url are *not* settable via the intent.
|
||||
setUpWithStartUrl(START_URL, "testErrorUrl", ERROR_URL, "errorurl", INVALID_URL, "url", INVALID_URL);
|
||||
}
|
||||
|
||||
public void testUrl() throws Throwable {
|
||||
|
Loading…
Reference in New Issue
Block a user