| Index: base/test/android/javatests/src/org/chromium/base/test/util/CommandLineFlags.java
|
| diff --git a/base/test/android/javatests/src/org/chromium/base/test/util/CommandLineFlags.java b/base/test/android/javatests/src/org/chromium/base/test/util/CommandLineFlags.java
|
| index 408074c29f42d5d552120375ad574f984556d364..a1590a8d817cf349a19daa29183642d3381bd1b0 100644
|
| --- a/base/test/android/javatests/src/org/chromium/base/test/util/CommandLineFlags.java
|
| +++ b/base/test/android/javatests/src/org/chromium/base/test/util/CommandLineFlags.java
|
| @@ -11,6 +11,7 @@ import junit.framework.Assert;
|
| import org.chromium.base.BaseChromiumApplication;
|
| import org.chromium.base.CommandLine;
|
| import org.chromium.base.test.BaseTestResult.PreTestHook;
|
| +import org.chromium.base.test.util.parameter.BaseParameter;
|
|
|
| import java.lang.annotation.ElementType;
|
| import java.lang.annotation.Inherited;
|
| @@ -113,4 +114,38 @@ public final class CommandLineFlags {
|
|
|
| };
|
| }
|
| +
|
| + /**
|
| + * Instructs the test runner to execute the test with modified command-line flags.
|
| + * Flags to add are specified using 'stringArray' of argument named 'add',
|
| + * and flags to remove -- in the argument named 'remove'. A parameter without arguments
|
| + * instructs to run the test with default command-line flags.
|
| + *
|
| + * Example:
|
| + * @ParameterizedTest.Set(tests = {
|
| + * @ParameterizedTest(parameters = {
|
| + * @Parameter(
|
| + * tag = CommandLineFlags.Parameter.PARAMETER_TAG)}),
|
| + * @ParameterizedTest(parameters = {
|
| + * @Parameter(
|
| + * tag = CommandLineFlags.Parameter.PARAMETER_TAG,
|
| + * arguments = {
|
| + * @Parameter.Argument(
|
| + * name = CommandLineFlags.Parameter.ADD_ARG,
|
| + * stringArray = {'arg1', 'arg2'})
|
| + * })})})
|
| + *
|
| + * Note that because the entire instrumentation test process needs to be restarted to apply
|
| + * modified command-line arguments, this annotation is handled by test_runner.py, not by
|
| + * BaseTestResult class.
|
| + */
|
| + public class Parameter extends BaseParameter {
|
| + public static final String PARAMETER_TAG = "cmdlinearg-parameter";
|
| + public static final String ADD_ARG = "add";
|
| + public static final String REMOVE_ARG = "remove";
|
| +
|
| + public Parameter(org.chromium.base.test.util.parameter.Parameter.Reader parameterReader) {
|
| + super(PARAMETER_TAG, parameterReader);
|
| + }
|
| + }
|
| }
|
|
|