Chromium Code Reviews| Index: base/test/android/javatests/src/org/chromium/base/test/util/parameter/parameters/CommandLineArgumentParameter.java |
| diff --git a/base/test/android/javatests/src/org/chromium/base/test/util/parameter/parameters/CommandLineArgumentParameter.java b/base/test/android/javatests/src/org/chromium/base/test/util/parameter/parameters/CommandLineArgumentParameter.java |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6c73ece2b9eb3d7602d0c363acbdbf08440a171e |
| --- /dev/null |
| +++ b/base/test/android/javatests/src/org/chromium/base/test/util/parameter/parameters/CommandLineArgumentParameter.java |
| @@ -0,0 +1,42 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +package org.chromium.base.test.util.parameter.parameters; |
| + |
| +import org.chromium.base.test.util.parameter.BaseParameter; |
| +import org.chromium.base.test.util.parameter.Parameter; |
| + |
| +/** |
| + * 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 = CommandLineArgumentParameter.PARAMETER_TAG)}), |
| + * @ParameterizedTest(parameters = { |
| + * @Parameter( |
| + * tag = CommandLineArgumentParameter.PARAMETER_TAG, |
| + * arguments = { |
| + * @Parameter.Argument( |
| + * name = CommandLineArgumentParameter.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 CommandLineArgumentParameter extends BaseParameter { |
|
jbudorick
2015/10/27 16:14:36
I'm not crazy about having both this and @CommandL
mnaganov (inactive)
2015/10/27 23:53:30
I thought about that, but what I disliked is wordi
jbudorick
2015/10/28 16:36:35
Yeah, that's pretty nasty.
What about something l
|
| + public static final String PARAMETER_TAG = "cmdlinearg-parameter"; |
| + public static final String ADD_ARG = "add"; |
| + public static final String REMOVE_ARG = "remove"; |
| + |
| + public CommandLineArgumentParameter(Parameter.Reader parameterReader) { |
| + super(PARAMETER_TAG, parameterReader); |
| + } |
| +} |