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

Unified Diff: testing/android/junit/java/src/org/chromium/testing/local/GtestFilter.java

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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: testing/android/junit/java/src/org/chromium/testing/local/GtestFilter.java
diff --git a/testing/android/junit/java/src/org/chromium/testing/local/GtestFilter.java b/testing/android/junit/java/src/org/chromium/testing/local/GtestFilter.java
index 68dcbb8716d3258f588993ab059b81e6eec5e898..d5527aa22a5ead774ffb565ec83a7a9816ed1e2d 100644
--- a/testing/android/junit/java/src/org/chromium/testing/local/GtestFilter.java
+++ b/testing/android/junit/java/src/org/chromium/testing/local/GtestFilter.java
@@ -9,6 +9,7 @@ import org.junit.runner.manipulation.Filter;
import java.util.HashSet;
import java.util.Set;
+import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
@@ -24,6 +25,7 @@ class GtestFilter extends Filter {
private static final Pattern ASTERISK = Pattern.compile("\\*");
private static final Pattern COLON = Pattern.compile(":");
private static final Pattern DASH = Pattern.compile("-");
+ private static final Pattern DOLLAR = Pattern.compile("\\$");
private static final Pattern PERIOD = Pattern.compile("\\.");
/**
@@ -39,7 +41,8 @@ class GtestFilter extends Filter {
for (String f : filterStrings) {
if (f.isEmpty()) continue;
- String sanitized = PERIOD.matcher(f).replaceAll("\\\\.");
+ String sanitized = PERIOD.matcher(f).replaceAll(Matcher.quoteReplacement("\\."));
+ sanitized = DOLLAR.matcher(sanitized).replaceAll(Matcher.quoteReplacement("\\$"));
sanitized = ASTERISK.matcher(sanitized).replaceAll(".*");
int negIndex = sanitized.indexOf('-');
if (negIndex == 0) {

Powered by Google App Engine
This is Rietveld 408576698