You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2015/02/12 21:04:20 UTC
[3/3] android commit: Add back a test that url (and errorUrl) are not
settable via Intent extras
Add back a test that url (and errorUrl) are not settable via Intent extras
Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/9baa2750
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/9baa2750
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/9baa2750
Branch: refs/heads/master
Commit: 9baa27508ab7eb7a90ed405809aad9f20b318882
Parents: c3267de
Author: Andrew Grieve <ag...@chromium.org>
Authored: Thu Feb 12 15:03:44 2015 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Thu Feb 12 15:03:44 2015 -0500
----------------------------------------------------------------------
.../org/apache/cordova/test/BaseCordovaIntegrationTest.java | 9 +++------
.../src/org/apache/cordova/test/ErrorUrlTest.java | 4 +++-
2 files changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/9baa2750/test/androidTest/src/org/apache/cordova/test/BaseCordovaIntegrationTest.java
----------------------------------------------------------------------
diff --git a/test/androidTest/src/org/apache/cordova/test/BaseCordovaIntegrationTest.java b/test/androidTest/src/org/apache/cordova/test/BaseCordovaIntegrationTest.java
index ff76930..ecc40f6 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();
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/9baa2750/test/androidTest/src/org/apache/cordova/test/ErrorUrlTest.java
----------------------------------------------------------------------
diff --git a/test/androidTest/src/org/apache/cordova/test/ErrorUrlTest.java b/test/androidTest/src/org/apache/cordova/test/ErrorUrlTest.java
index fc6ce8c..9038380 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 {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org