Flutter Engine
The Flutter Engine
FlutterShellArgsTest.java
Go to the documentation of this file.
1package test.io.flutter.embedding.engine;
2
3import static org.junit.Assert.assertEquals;
4import static org.junit.Assert.assertTrue;
5
6import android.content.Intent;
7import androidx.test.ext.junit.runners.AndroidJUnit4;
8import io.flutter.embedding.engine.FlutterShellArgs;
9import java.util.Arrays;
10import java.util.HashSet;
11import org.junit.Test;
12import org.junit.runner.RunWith;
13import org.robolectric.annotation.Config;
14
15@Config(manifest = Config.NONE)
16@RunWith(AndroidJUnit4.class)
18 @Test
19 public void itProcessesShellFlags() {
20 // Setup the test.
21 Intent intent = new Intent();
22 intent.putExtra("dart-flags", "--observe --no-hot --no-pub");
23 intent.putExtra("trace-skia-allowlist", "skia.a,skia.b");
24
25 // Execute the behavior under test.
27 HashSet<String> argValues = new HashSet<String>(Arrays.asList(args.toArray()));
28
29 // Verify results.
30 assertEquals(2, argValues.size());
31 assertTrue(argValues.contains("--dart-flags=--observe --no-hot --no-pub"));
32 assertTrue(argValues.contains("--trace-skia-allowlist=skia.a,skia.b"));
33 }
34}
static FlutterShellArgs fromIntent(@NonNull Intent intent)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args