debugd: Refactor code for getting debugd helper path.

This CL refactors code for getting debugd helper path into
SandboxedProcess::GetHelperPath().

BUG=chromium:373578
TEST=Tested the following:
1. Build and run unit tests.
2. Run the command below in a root shell:

   dbus-send --system --print-reply --dest=org.chromium.debugd \
       /org/chromium/debugd org.chromium.debugd.TestICMP \
       string:8.8.8.8

   dbus-send --system --print-reply --dest=org.chromium.debugd \
       /org/chromium/debugd org.chromium.debugd.Smartctl \
       string:capabilities

   dbus-send --system --print-reply --dest=org.chromium.debugd \
       /org/chromium/debugd org.chromium.debugd.GetModemStatus

   dbus-send --system --print-reply --dest=org.chromium.debugd \
       /org/chromium/debugd org.chromium.debugd.GetWiMaxStatus

   restart debugd DEBUGD_HELPERS=/tmp

   # Now the following command should fail as debugd tries to find the
   # helper executable from /tmp
   dbus-send --system --print-reply --dest=org.chromium.debugd \
       /org/chromium/debugd org.chromium.debugd.GetWiMaxStatus

Change-Id: I29b17a9f61ef330e90be493a20b6f236eb307fb8
Reviewed-on: https://chromium-review.googlesource.com/200000
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
13 files changed
tree: cf471a9c196ca0f0ebd3398e0b434ea6a5047bc2
  1. doc/
  2. share/
  3. src/
  4. .gitignore
  5. debugd.gyp
  6. OWNERS
  7. README