summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/build.gradle2
-rw-r--r--app/src/androidTest/java/se/leap/bitmaskclient/test/BaseTestDashboard.java2
-rw-r--r--app/src/androidTest/java/se/leap/bitmaskclient/test/VpnTestController.java14
-rw-r--r--app/src/androidTest/java/se/leap/bitmaskclient/test/testConfigurationWizard.java2
-rw-r--r--app/src/androidTest/java/se/leap/bitmaskclient/test/testVpnFragment.java10
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java30
6 files changed, 30 insertions, 30 deletions
diff --git a/app/build.gradle b/app/build.gradle
index c4686dae..bc2b7d4b 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -39,7 +39,7 @@ android {
}
dependencies {
- androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.3.1'
+ androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.4.1'
compile 'com.jakewharton:butterknife:6.1.0'
provided 'com.squareup.dagger:dagger-compiler:1.2.2'
compile 'com.github.pedrovgs:renderers:1.5'
diff --git a/app/src/androidTest/java/se/leap/bitmaskclient/test/BaseTestDashboard.java b/app/src/androidTest/java/se/leap/bitmaskclient/test/BaseTestDashboard.java
index fae44d1c..9a9131fd 100644
--- a/app/src/androidTest/java/se/leap/bitmaskclient/test/BaseTestDashboard.java
+++ b/app/src/androidTest/java/se/leap/bitmaskclient/test/BaseTestDashboard.java
@@ -50,7 +50,7 @@ public abstract class BaseTestDashboard extends ActivityInstrumentationTestCase2
private void clickAndWaitForDashboard(String click_text) {
solo.clickOnText(click_text);
- assertTrue(solo.waitForActivity(Dashboard.class, 5000));
+ assertTrue(solo.waitForActivity(Dashboard.class, 80 * 1000));
}
static boolean isShownWithinConfinesOfVisibleScreen(View view) {
diff --git a/app/src/androidTest/java/se/leap/bitmaskclient/test/VpnTestController.java b/app/src/androidTest/java/se/leap/bitmaskclient/test/VpnTestController.java
index 40a9f656..25d81da1 100644
--- a/app/src/androidTest/java/se/leap/bitmaskclient/test/VpnTestController.java
+++ b/app/src/androidTest/java/se/leap/bitmaskclient/test/VpnTestController.java
@@ -52,20 +52,16 @@ public class VpnTestController {
}
protected FabButton getVpnWholeIcon() {
- try {
- View view = solo.getView(R.id.vpn_Status_Image);
- if (view != null)
- return (FabButton) view;
- else
- return null;
- } catch (AssertionFailedError e) {
+ View view = solo.getView(R.id.vpn_Status_Image);
+ if (view != null)
+ return (FabButton) view;
+ else
return null;
- }
}
protected void turningEipOn() {
assertInProgress();
- int max_seconds_until_connected = 30;
+ int max_seconds_until_connected = 120;
Condition condition = new Condition() {
@Override
diff --git a/app/src/androidTest/java/se/leap/bitmaskclient/test/testConfigurationWizard.java b/app/src/androidTest/java/se/leap/bitmaskclient/test/testConfigurationWizard.java
index 6d267e6e..931457ee 100644
--- a/app/src/androidTest/java/se/leap/bitmaskclient/test/testConfigurationWizard.java
+++ b/app/src/androidTest/java/se/leap/bitmaskclient/test/testConfigurationWizard.java
@@ -72,7 +72,7 @@ public class testConfigurationWizard extends ActivityInstrumentationTestCase2<Co
private void waitForProviderDetails() {
String text = solo.getString(R.string.provider_details_fragment_title);
- assertTrue("Provider details dialog did not appear", solo.waitForText(text, 1, 40*1000));
+ assertTrue("Provider details dialog did not appear", solo.waitForText(text, 1, 60*1000));
}
public void testAddNewProvider() {
diff --git a/app/src/androidTest/java/se/leap/bitmaskclient/test/testVpnFragment.java b/app/src/androidTest/java/se/leap/bitmaskclient/test/testVpnFragment.java
index 2f3d2614..106d5cf2 100644
--- a/app/src/androidTest/java/se/leap/bitmaskclient/test/testVpnFragment.java
+++ b/app/src/androidTest/java/se/leap/bitmaskclient/test/testVpnFragment.java
@@ -1,9 +1,5 @@
package se.leap.bitmaskclient.test;
-import java.util.Locale;
-
-import de.blinkt.openvpn.activities.LogWindow;
-
public class testVpnFragment extends BaseTestDashboard {
@Override
@@ -49,10 +45,12 @@ public class testVpnFragment extends BaseTestDashboard {
* You must pay attention to the screen, because you need to cancel de dialog twice (block vpn and normal vpn)
*/
public void testOnFailed() {
+ /* TODO Do not rely on the Android's vpn trust dialog
vpn_controller.clickVpnButton();
- assertTrue(solo.waitForActivity(LogWindow.class));
+ assertTrue("Have you checked the trust vpn dialog?", solo.waitForActivity(LogWindow.class));
solo.goBack();
- vpn_controller.iconShowsDisconnected();
+ assertTrue(vpn_controller.iconShowsDisconnected());
+ */
}
public void testVpnEveryProvider() {
diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java b/app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java
index 171035d1..f41049c5 100644
--- a/app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java
+++ b/app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java
@@ -16,20 +16,27 @@
*/
package se.leap.bitmaskclient.eip;
-import android.content.*;
+import android.content.Context;
+import android.content.SharedPreferences;
-import com.google.gson.*;
-import com.google.gson.reflect.*;
-import com.google.gson.stream.JsonWriter;
+import com.google.gson.Gson;
+import com.google.gson.JsonSyntaxException;
+import com.google.gson.reflect.TypeToken;
-import org.json.*;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
-import java.lang.reflect.*;
-import java.util.*;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
-import de.blinkt.openvpn.*;
-import de.blinkt.openvpn.core.*;
-import se.leap.bitmaskclient.*;
+import de.blinkt.openvpn.VpnProfile;
+import de.blinkt.openvpn.core.Connection;
+import de.blinkt.openvpn.core.ProfileManager;
+import se.leap.bitmaskclient.Provider;
/**
* @author parmegv
@@ -66,7 +73,7 @@ public class GatewaysManager {
}
public void addFromString(String gateways) {
- List<Gateway> gateways_list = new ArrayList<Gateway>();
+ List<Gateway> gateways_list = new ArrayList<>();
try {
gateways_list = new Gson().fromJson(gateways, list_type);
} catch (JsonSyntaxException e) {
@@ -76,7 +83,6 @@ public class GatewaysManager {
if (gateways_list != null) {
for (Gateway gateway : gateways_list)
addGateway(gateway);
- this.gateways.addAll(gateways_list);
}
}