Merge to XFA: Hook up show-config to testing scripts.

Review URL: https://codereview.chromium.org/1607923004 .
(cherry picked from commit d40e189ba1ab515ef9b3df7928e215be150df336)

TBR=ochang@chromium.org

Review URL: https://codereview.chromium.org/1607113002 .
diff --git a/testing/tools/run_corpus_tests.py b/testing/tools/run_corpus_tests.py
index e2b950c..0c44cc6 100755
--- a/testing/tools/run_corpus_tests.py
+++ b/testing/tools/run_corpus_tests.py
@@ -102,7 +102,8 @@
   if not os.path.exists(working_dir):
     os.makedirs(working_dir)
 
-  test_suppressor = suppressor.Suppressor(finder)
+  feature_string = subprocess.check_output([pdfium_test_path, '--show-config'])
+  test_suppressor = suppressor.Suppressor(finder, feature_string)
   image_differ = pngdiffer.PNGDiffer(finder)
 
   # test files are under .../pdfium/testing/corpus.
diff --git a/testing/tools/run_javascript_tests.py b/testing/tools/run_javascript_tests.py
index 0c24017..b09ea49 100755
--- a/testing/tools/run_javascript_tests.py
+++ b/testing/tools/run_javascript_tests.py
@@ -63,6 +63,11 @@
   if not os.path.exists(working_dir):
     os.makedirs(working_dir)
 
+  feature_string = subprocess.check_output([pdfium_test_path, '--show-config'])
+  if "V8" not in feature_string.strip().split(","):
+    print "V8 not enabled, skipping."
+    return 0
+
   input_files = []
   if len(args):
     for file_name in args:
diff --git a/testing/tools/run_pixel_tests.py b/testing/tools/run_pixel_tests.py
index 8d83840..8a102f4 100755
--- a/testing/tools/run_pixel_tests.py
+++ b/testing/tools/run_pixel_tests.py
@@ -70,7 +70,8 @@
   if not os.path.exists(working_dir):
     os.makedirs(working_dir)
 
-  test_suppressor = suppressor.Suppressor(finder)
+  feature_string = subprocess.check_output([pdfium_test_path, '--show-config'])
+  test_suppressor = suppressor.Suppressor(finder, feature_string)
   image_differ = pngdiffer.PNGDiffer(finder)
 
   input_files = []
diff --git a/testing/tools/suppressor.py b/testing/tools/suppressor.py
index f25db45..a1c3171 100755
--- a/testing/tools/suppressor.py
+++ b/testing/tools/suppressor.py
@@ -8,10 +8,13 @@
 import common
 
 class Suppressor:
-  def __init__(self, finder):
+  def __init__(self, finder, feature_string):
+    feature_vector = feature_string.strip().split(",")
+    v8_option = ["nov8", "v8"]["V8" in feature_vector]
+    xfa_option = ["noxfa", "xfa"]["XFA" in feature_vector]
     with open(os.path.join(finder.TestingDir(), 'SUPPRESSIONS')) as f:
       self.suppression_set = set(self._FilterSuppressions(
-        common.os_name(), "v8", "xfa", self._ExtractSuppressions(f)))
+        common.os_name(), v8_option, xfa_option, self._ExtractSuppressions(f)))
 
   def _ExtractSuppressions(self, f):
     return [y.split(' ') for y in