diff options
author | Parménides GV <parmegv@sdf.org> | 2015-04-22 14:59:49 +0200 |
---|---|---|
committer | Parménides GV <parmegv@sdf.org> | 2015-04-22 14:59:49 +0200 |
commit | acb5e7e33b554b236995926853eb9f1abcb7b6c3 (patch) | |
tree | 1efeb6ff6796175854893bcd21622105cecfbcc7 /app/src | |
parent | 449c3953ce79947554bbfd6ed0386d68aa9f04bd (diff) |
Tests for ConfigurationWizard pass
I've done this because of https://leap.se/code/issues/6863#note-2,
testing the previous commit's changes.
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/androidTest/java/se/leap/bitmaskclient/test/testConfigurationWizard.java | 6 | ||||
-rw-r--r-- | app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java | 2 |
2 files changed, 5 insertions, 3 deletions
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 1fa4cf2f..8db755dd 100644 --- a/app/src/androidTest/java/se/leap/bitmaskclient/test/testConfigurationWizard.java +++ b/app/src/androidTest/java/se/leap/bitmaskclient/test/testConfigurationWizard.java @@ -1,5 +1,6 @@ package se.leap.bitmaskclient.test; +import android.app.Instrumentation; import android.test.*; import android.widget.*; @@ -27,12 +28,13 @@ public class testConfigurationWizard extends ActivityInstrumentationTestCase2<Co protected void setUp() throws Exception { super.setUp(); solo = new Solo(getInstrumentation(), getActivity()); - ConnectionManager.setMobileDataEnabled(true, solo.getCurrentActivity().getApplicationContext()); + //ConnectionManager.setMobileDataEnabled(true, solo.getCurrentActivity().getApplicationContext()); } @Override protected void tearDown() throws Exception { - + solo.finishOpenedActivities(); + super.tearDown(); } public void testListProviders() { diff --git a/app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java b/app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java index 6c57fca2..5d94d180 100644 --- a/app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java +++ b/app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java @@ -695,7 +695,7 @@ public class ProviderAPI extends IntentService { String[] pins = new String[] {ca_cert_fingerprint}; try { URL url = new URL(url_string); - HttpsURLConnection connection = PinningHelper.getPinnedHttpsURLConnection(Dashboard.getContext(), pins, url); + HttpsURLConnection connection = PinningHelper.getPinnedHttpsURLConnection(getApplicationContext(), pins, url); connection.setConnectTimeout(seconds_of_timeout * 1000); if (!LeapSRPSession.getToken().isEmpty()) connection.addRequestProperty(LeapSRPSession.AUTHORIZATION_HEADER, "Token token = " + LeapSRPSession.getToken()); |