Commit 43c7d2cb authored by akwizgran's avatar akwizgran

Add service discovery test.

parent 6ad3a303
......@@ -24,8 +24,9 @@ import static org.briarproject.interferometer.MainViewModel.StartResult.NO_BLUET
import static org.briarproject.interferometer.MainViewModel.TestPhase.BT_DISABLED;
import static org.briarproject.interferometer.MainViewModel.TestPhase.BT_ENABLED;
import static org.briarproject.interferometer.MainViewModel.TestPhase.CONNECTIONS;
import static org.briarproject.interferometer.MainViewModel.TestPhase.DISCOVERY;
import static org.briarproject.interferometer.MainViewModel.TestPhase.DEVICE_DISCOVERY;
import static org.briarproject.interferometer.MainViewModel.TestPhase.READY;
import static org.briarproject.interferometer.MainViewModel.TestPhase.SERVICE_DISCOVERY;
import static org.briarproject.interferometer.Utils.formatSpeed;
public class MainActivity extends AppCompatActivity {
......@@ -88,8 +89,10 @@ public class MainActivity extends AppCompatActivity {
testPhaseTextView.setText(R.string.testing_bt_disabled);
} else if (phase == BT_ENABLED) {
testPhaseTextView.setText(R.string.testing_bt_enabled);
} else if (phase == DISCOVERY) {
testPhaseTextView.setText(R.string.testing_discovery);
} else if (phase == DEVICE_DISCOVERY) {
testPhaseTextView.setText(R.string.testing_device_discovery);
} else if (phase == SERVICE_DISCOVERY) {
testPhaseTextView.setText(R.string.testing_service_discovery);
} else if (phase == CONNECTIONS) {
testPhaseTextView.setText(R.string.testing_connections);
}
......
......@@ -14,13 +14,15 @@ import androidx.fragment.app.DialogFragment;
import static org.briarproject.interferometer.MainViewModel.CONSUMED;
import static org.briarproject.interferometer.MainViewModel.DOWNLOAD_CONNECTIONS;
import static org.briarproject.interferometer.MainViewModel.DOWNLOAD_DEVICE_DISCOVERY;
import static org.briarproject.interferometer.MainViewModel.DOWNLOAD_DISABLED;
import static org.briarproject.interferometer.MainViewModel.DOWNLOAD_DISCOVERY;
import static org.briarproject.interferometer.MainViewModel.DOWNLOAD_ENABLED;
import static org.briarproject.interferometer.MainViewModel.DOWNLOAD_SERVICE_DISCOVERY;
import static org.briarproject.interferometer.MainViewModel.UPLOAD_CONNECTIONS;
import static org.briarproject.interferometer.MainViewModel.UPLOAD_DEVICE_DISCOVERY;
import static org.briarproject.interferometer.MainViewModel.UPLOAD_DISABLED;
import static org.briarproject.interferometer.MainViewModel.UPLOAD_DISCOVERY;
import static org.briarproject.interferometer.MainViewModel.UPLOAD_ENABLED;
import static org.briarproject.interferometer.MainViewModel.UPLOAD_SERVICE_DISCOVERY;
import static org.briarproject.interferometer.Utils.formatSpeed;
public class ResultsDialogFragment extends DialogFragment {
......@@ -51,10 +53,15 @@ public class ResultsDialogFragment extends DialogFragment {
formatSpeed(args.getDouble(DOWNLOAD_ENABLED)),
formatSpeed(args.getDouble(UPLOAD_ENABLED))));
TextView discovery = v.findViewById(R.id.discovery);
discovery.setText(getString(R.string.results_format_discovery,
formatSpeed(args.getDouble(DOWNLOAD_DISCOVERY)),
formatSpeed(args.getDouble(UPLOAD_DISCOVERY))));
TextView deviceDiscovery = v.findViewById(R.id.device_discovery);
deviceDiscovery.setText(getString(R.string.results_format_device_discovery,
formatSpeed(args.getDouble(DOWNLOAD_DEVICE_DISCOVERY)),
formatSpeed(args.getDouble(UPLOAD_DEVICE_DISCOVERY))));
TextView serviceDiscovery = v.findViewById(R.id.service_discovery);
serviceDiscovery.setText(getString(R.string.results_format_service_discovery,
formatSpeed(args.getDouble(DOWNLOAD_SERVICE_DISCOVERY)),
formatSpeed(args.getDouble(UPLOAD_SERVICE_DISCOVERY))));
TextView connections = v.findViewById(R.id.connections);
connections.setText(getString(R.string.results_format_connections,
......
......@@ -18,7 +18,13 @@
android:layout_marginBottom="8dp" />
<TextView
android:id="@+id/discovery"
android:id="@+id/device_discovery"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp" />
<TextView
android:id="@+id/service_discovery"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp" />
......
......@@ -11,8 +11,9 @@
<string name="testing_bt_disabled">Testing with Bluetooth disabled</string>
<string name="testing_bt_enabled">Testing with Bluetooth enabled</string>
<string name="testing_discovery">Testing with Bluetooth discovery</string>
<string name="testing_connections">Testing with Bluetooth connections</string>
<string name="testing_device_discovery">Testing with device discovery</string>
<string name="testing_service_discovery">Testing with service discovery</string>
<string name="testing_connections">Testing with connections</string>
<string name="download_format">Download: %s</string>
<string name="upload_format">Upload: %s</string>
......@@ -20,6 +21,7 @@
<string name="results_title">Wi-Fi Throughput</string>
<string name="results_format_bt_disabled">BT disabled: %s down, %s up</string>
<string name="results_format_bt_enabled">BT enabled: %s down, %s up</string>
<string name="results_format_discovery">Discovery: %s down, %s up</string>
<string name="results_format_device_discovery">Device discovery: %s down, %s up</string>
<string name="results_format_service_discovery">Service discovery: %s down, %s up</string>
<string name="results_format_connections">Connections: %s down, %s up</string>
</resources>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment