diff --git a/test/androidTest/src/org/apache/cordova/test/BaseCordovaIntegrationTest.java b/test/androidTest/src/org/apache/cordova/test/BaseCordovaIntegrationTest.java index ff769304..ecc40f64 100644 --- a/test/androidTest/src/org/apache/cordova/test/BaseCordovaIntegrationTest.java +++ b/test/androidTest/src/org/apache/cordova/test/BaseCordovaIntegrationTest.java @@ -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(); diff --git a/test/androidTest/src/org/apache/cordova/test/ErrorUrlTest.java b/test/androidTest/src/org/apache/cordova/test/ErrorUrlTest.java index fc6ce8c3..9038380b 100644 --- a/test/androidTest/src/org/apache/cordova/test/ErrorUrlTest.java +++ b/test/androidTest/src/org/apache/cordova/test/ErrorUrlTest.java @@ -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 {