Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4265)

Unified Diff: base/test/android/javatests/src/org/chromium/base/test/BaseTestResult.java

Issue 1414403002: Add CommandLineArgumentParameter and use it for WebView tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix-cr-526885-read-nested-annotations
Patch Set: Comments addressed Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/test/android/javatests/src/org/chromium/base/test/BaseTestResult.java
diff --git a/base/test/android/javatests/src/org/chromium/base/test/BaseTestResult.java b/base/test/android/javatests/src/org/chromium/base/test/BaseTestResult.java
index 64ad9f24236b0e3ef733b8cd5c4ff7c10647f992..d3f693f5fa7fc6224a5e61ff57231cae21923154 100644
--- a/base/test/android/javatests/src/org/chromium/base/test/BaseTestResult.java
+++ b/base/test/android/javatests/src/org/chromium/base/test/BaseTestResult.java
@@ -14,6 +14,7 @@ import junit.framework.TestCase;
import junit.framework.TestResult;
import org.chromium.base.Log;
+import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.parameter.BaseParameter;
import org.chromium.base.test.util.parameter.Parameter;
import org.chromium.base.test.util.parameter.Parameterizable;
@@ -156,6 +157,19 @@ public class BaseTestResult extends TestResult {
List<ParameterError> failures = new ArrayList<>();
Map<String, BaseParameter> availableParameters = testCase.getAvailableParameters();
+ // Remove all @ParameterizedTests that contain CommandLineArgumentParameter -- those
nyquist 2015/11/05 23:52:52 Nit: {@link CommandLineFlags.Parameter}?
mnaganov (inactive) 2015/11/06 00:30:34 Fixed. Although, this isn't a JavaDoc, so I didn't
+ // are handled in test_runner.py as it is needed to re-launch the whole test activity
+ // to apply command-line args correctly. Note that this way we will also ignore any
+ // other parameters that may present in these @ParameterizedTests.
+ for (Iterator<ParameterizedTest> iter = parameterizedTests.iterator(); iter.hasNext();) {
+ ParameterizedTest paramTest = iter.next();
+ for (Parameter p: paramTest.parameters()) {
+ if (CommandLineFlags.Parameter.PARAMETER_TAG.equals(p.tag())) {
+ iter.remove();
+ }
+ }
+ }
+
if (parameterizedTests.isEmpty()) {
super.run(test);
} else {

Powered by Google App Engine
This is Rietveld 408576698