forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for --dart-flags in FlutterShellArgs. (flutter#44855) (fl…
- Loading branch information
1 parent
7d6e376
commit 687a1a7
Showing
4 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
shell/platform/android/test/io/flutter/embedding/engine/FlutterShellArgsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package test.io.flutter.embedding.engine; | ||
|
||
import android.content.Intent; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.robolectric.RobolectricTestRunner; | ||
import org.robolectric.annotation.Config; | ||
|
||
import io.flutter.embedding.engine.FlutterShellArgs; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
@Config(manifest=Config.NONE) | ||
@RunWith(RobolectricTestRunner.class) | ||
public class FlutterShellArgsTest { | ||
@Test | ||
public void itProcessesDartFlags() { | ||
// Setup the test. | ||
Intent intent = new Intent(); | ||
intent.putExtra("dart-flags", "--observe --no-hot --no-pub"); | ||
|
||
// Execute the behavior under test. | ||
FlutterShellArgs args = FlutterShellArgs.fromIntent(intent); | ||
|
||
// Verify results. | ||
assertEquals(1, args.toArray().length); | ||
assertEquals("--dart-flags=--observe --no-hot --no-pub", args.toArray()[0]); | ||
} | ||
} |