Skip to content

Commit

Permalink
Merge branch 'issues/2524' of github.com:ooni/probe-android into issu…
Browse files Browse the repository at this point in the history
…es/2524-http-https-proxy
  • Loading branch information
aanorbel committed Oct 18, 2023
2 parents 2b69a13 + 5336624 commit 376a892
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public static Intent newIntent(Context context, AbstractSuite testSuite) {
String experimentalLinks =
"\n\n* [STUN Reachability](https://github.com/ooni/spec/blob/master/nettests/ts-025-stun-reachability.md)" +
"\n\n* [DNS Check](https://github.com/ooni/spec/blob/master/nettests/ts-028-dnscheck.md)" +
"\n\n* [ECH Check](https://github.com/ooni/spec/blob/master/nettests/ts-039-echcheck.md)" +
"\n\n* [Tor Snowflake](https://ooni.org/nettest/tor-snowflake/) "+ String.format(" ( %s )",getString(R.string.Settings_TestOptions_LongRunningTest))+
"\n\n* [Vanilla Tor](https://github.com/ooni/spec/blob/master/nettests/ts-016-vanilla-tor.md) " + String.format(" ( %s )",getString(R.string.Settings_TestOptions_LongRunningTest));
Markwon.setMarkdown(binding.desc, getString(testSuite.getDesc1(), experimentalLinks));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ public AbstractTest[] getTestList(@Nullable PreferenceManager pm) {
if (super.getTestList(pm) == null) {
ArrayList<AbstractTest> list = new ArrayList<>();
if (pm == null || pm.isExperimentalOn()){
list.add(new Experimental("echcheck"));
list.add(new Experimental("stunreachability"));
list.add(new Experimental("dnscheck"));
list.add(new Experimental("echcheck"));
if ((pm == null || pm.isLongRunningTestsInForeground()) || getAutoRun()){
list.add(new Experimental("torsf"));
list.add(new Experimental("vanilla_tor"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,14 @@ private void setDataUsage(EventResult.Value value, Result result) {
}

private void setFailureMsg(EventResult.Value value, Result result) {
if (result == null) return;
result.failure_msg = value.failure;
if (result == null) {
return;
}
if (result.failure_msg == null) {
result.failure_msg = value.failure;
} else {
result.failure_msg = String.format("%s\n\n%s", result.failure_msg, value.failure);
}
result.save();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ public void getTestList_full() {

List<AbstractTest> tests = Arrays.asList(suite.getTestList(pm));

// Psiphon and Tor. Riseup VPN has been temporarily disabled.
assertEquals(2, tests.size());
assertEquals(3, tests.size());
assertTrue(findTestClass(tests, Psiphon.class));
assertTrue(findTestClass(tests, Tor.class));
// assertTrue(findTestClass(tests, RiseupVPN.class));
assertTrue(findTestClass(tests, RiseupVPN.class));
}

private boolean findTestClass(List<AbstractTest> tests, Class<? extends AbstractTest> klass) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@ public void getTestList_experimental_on() {

List<AbstractTest> tests = Arrays.asList(suite.getTestList(pm));

assertEquals(2, tests.size());
assertEquals(3, tests.size());
assertEquals(Experimental.class, tests.get(0).getClass());
assertEquals(Experimental.class, tests.get(1).getClass());
assertEquals(Experimental.class, tests.get(2).getClass());
assertEquals("stunreachability", tests.get(0).getName());
assertEquals("dnscheck", tests.get(1).getName());
assertEquals("echcheck", tests.get(2).getName());
}

@Test
Expand All @@ -48,15 +50,17 @@ public void getTestList_experimental_on_autorun_on() {

List<AbstractTest> tests = Arrays.asList(autoRunSuite.getTestList(pm));

assertEquals(4, tests.size());
assertEquals(5, tests.size());
assertEquals(Experimental.class, tests.get(0).getClass());
assertEquals(Experimental.class, tests.get(1).getClass());
assertEquals(Experimental.class, tests.get(2).getClass());
assertEquals(Experimental.class, tests.get(3).getClass());
assertEquals(Experimental.class, tests.get(4).getClass());

assertEquals("torsf", tests.get(0).getName());
assertEquals("vanilla_tor", tests.get(1).getName());
assertEquals("stunreachability", tests.get(2).getName());
assertEquals("dnscheck", tests.get(3).getName());
assertEquals("stunreachability", tests.get(0).getName());
assertEquals("dnscheck", tests.get(1).getName());
assertEquals("echcheck", tests.get(2).getName());
assertEquals("torsf", tests.get(3).getName());
assertEquals("vanilla_tor", tests.get(4).getName());
}
}

0 comments on commit 376a892

Please sign in to comment.