Bug 943734 - escape URL arguments in mochitests for the benefit of LLDB; r=jmaher
authorNathan Froyd <froydnj@mozilla.com>
Tue, 03 Dec 2013 13:01:30 -0500
changeset 174738 895031613c5021d5e796def2bf1e7c0250fa82e3
parent 174737 45decd50b1180a19bd4e57f44f6db969f331ee68
child 174739 aebd77677855992dc918b4ca302ac070ee83de35
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs943734
milestone28.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 943734 - escape URL arguments in mochitests for the benefit of LLDB; r=jmaher
build/automationutils.py
testing/mochitest/runtests.py
--- a/build/automationutils.py
+++ b/build/automationutils.py
@@ -62,17 +62,18 @@ DEBUGGER_INFO = {
 
   "cgdb": {
     "interactive": True,
     "args": "-q --args"
   },
 
   "lldb": {
     "interactive": True,
-    "args": "--"
+    "args": "--",
+    "requiresEscapedArgs": True
   },
 
   # valgrind doesn't explain much about leaks unless you set the
   # '--leak-check=full' flag.
   "valgrind": {
     "interactive": False,
     "args": "--leak-check=full"
   }
@@ -206,17 +207,18 @@ def getDebuggerInfo(directory, debugger,
     def getDebuggerInfo(type, default):
       if debuggerName in DEBUGGER_INFO and type in DEBUGGER_INFO[debuggerName]:
         return DEBUGGER_INFO[debuggerName][type]
       return default
 
     debuggerInfo = {
       "path": debuggerPath,
       "interactive" : getDebuggerInfo("interactive", False),
-      "args": getDebuggerInfo("args", "").split()
+      "args": getDebuggerInfo("args", "").split(),
+      "requiresEscapedArgs": getDebuggerInfo("requiresEscapedArgs", False)
     }
 
     if debuggerArgs:
       debuggerInfo["args"] = debuggerArgs.split()
     if debuggerInteractive:
       debuggerInfo["interactive"] = debuggerInteractive
 
   return debuggerInfo
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -830,17 +830,19 @@ class Mochitest(MochitestUtilsMixin):
 
     # build command line
     cmd = os.path.abspath(app)
     args = list(extraArgs)
     # TODO: mozrunner should use -foreground at least for mac
     # https://bugzilla.mozilla.org/show_bug.cgi?id=916512
     args.append('-foreground')
     if testUrl:
-       args.append(testUrl)
+      if debuggerInfo and debuggerInfo['requiresEscapedArgs']:
+        testUrl = testUrl.replace("&", "\\&")
+      args.append(testUrl)
 
     if mozinfo.info["debug"] and not webapprtChrome:
       shutdownLeaks = ShutdownLeaks(log.info)
     else:
       shutdownLeaks = None
 
     # create an instance to process the output
     outputHandler = self.OutputHandler(harness=self,