|
5 | 5 | package dev.flutter.plugins.e2e; |
6 | 6 |
|
7 | 7 | import android.content.Context; |
| 8 | +import com.google.common.util.concurrent.ListenableFuture; |
| 9 | +import com.google.common.util.concurrent.SettableFuture; |
8 | 10 | import io.flutter.embedding.engine.plugins.FlutterPlugin; |
9 | 11 | import io.flutter.plugin.common.BinaryMessenger; |
10 | 12 | import io.flutter.plugin.common.MethodCall; |
|
13 | 15 | import io.flutter.plugin.common.MethodChannel.Result; |
14 | 16 | import io.flutter.plugin.common.PluginRegistry.Registrar; |
15 | 17 | import java.util.Map; |
16 | | -import java9.util.concurrent.CompletableFuture; |
17 | 18 |
|
18 | 19 | /** E2EPlugin */ |
19 | 20 | public class E2EPlugin implements MethodCallHandler, FlutterPlugin { |
20 | 21 | private MethodChannel methodChannel; |
21 | 22 |
|
22 | | - public static CompletableFuture<Map<String, String>> testResults = new CompletableFuture<>(); |
| 23 | + private static final SettableFuture<Map<String, String>> testResultsSettable = |
| 24 | + SettableFuture.create(); |
| 25 | + public static final ListenableFuture<Map<String, String>> testResults = testResultsSettable; |
23 | 26 |
|
24 | 27 | private static final String CHANNEL = "plugins.flutter.io/e2e"; |
25 | 28 |
|
@@ -49,7 +52,7 @@ public void onDetachedFromEngine(FlutterPluginBinding binding) { |
49 | 52 | public void onMethodCall(MethodCall call, Result result) { |
50 | 53 | if (call.method.equals("allTestsFinished")) { |
51 | 54 | Map<String, String> results = call.argument("results"); |
52 | | - testResults.complete(results); |
| 55 | + testResultsSettable.set(results); |
53 | 56 | result.success(null); |
54 | 57 | } else { |
55 | 58 | result.notImplemented(); |
|
0 commit comments