Bug 1497962 - Ensure extra_prefs is passed as a list r=jgraham
authorWes Kocher <wkocher@mozilla.com>
Thu, 11 Oct 2018 09:05:41 +0000
changeset 489046 43470b75b0d4c3f53ac5f8f50f1789873e50430b
parent 489045 e18103445f9e44d015e300cf9249f4ffa994ccc8
child 489047 57d97b765e4913a0abecea6444eb4e9bd43025cd
push id246
push userfmarier@mozilla.com
push dateSat, 13 Oct 2018 00:15:40 +0000
reviewersjgraham
bugs1497962
milestone64.0a1
Bug 1497962 - Ensure extra_prefs is passed as a list r=jgraham Differential Revision: https://phabricator.services.mozilla.com/D8264
testing/web-platform/tests/tools/wptrunner/wptrunner/wptcommandline.py
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/wptcommandline.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/wptcommandline.py
@@ -497,16 +497,19 @@ def check_args(kwargs):
     if kwargs["ssl_type"] != "none" and kwargs["product"] == "firefox" and kwargs["certutil_binary"]:
         path = exe_path(kwargs["certutil_binary"])
         if path is None:
             print >> sys.stderr, "certutil-binary argument missing or not a valid executable"
             sys.exit(1)
         kwargs["certutil_binary"] = path
 
     if kwargs['extra_prefs']:
+        # If a single pref is passed in as a string, make it a list
+        if type(kwargs['extra_prefs']) in (str, unicode):
+            kwargs['extra_prefs'] = [kwargs['extra_prefs']]
         missing = any('=' not in prefarg for prefarg in kwargs['extra_prefs'])
         if missing:
             print >> sys.stderr, "Preferences via --setpref must be in key=value format"
             sys.exit(1)
         kwargs['extra_prefs'] = [tuple(prefarg.split('=', 1)) for prefarg in
                                  kwargs['extra_prefs']]
 
     if kwargs["reftest_internal"] is None: