Commit bd4fdd4f authored by tonyg@chromium.org's avatar tonyg@chromium.org

[Telemetry] Don't restore command lines that will break Chrome.

A common problem is that if something goes wrong with Telemetry, the command
line file which points all network traffic at Web Page Replay can be left in
place which results in users not understanding why no pages will load.

So if we detect this setting, simply clear the file.

BUG=

Review URL: https://codereview.chromium.org/108573008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242109 0039d316-1c4b-4281-b951-d872f2087c98
parent 9267024e
......@@ -189,7 +189,7 @@ class AndroidBrowserBackend(chrome_browser_backend.ChromeBrowserBackend):
# Initialize fields so that an explosion during init doesn't break in Close.
self._adb = backend_settings.adb
self._backend_settings = backend_settings
self._saved_cmdline = None
self._saved_cmdline = ''
self._port = adb_commands.AllocateTestServerPort()
# Kill old browser.
......@@ -296,7 +296,13 @@ class AndroidBrowserBackend(chrome_browser_backend.ChromeBrowserBackend):
self.Close()
raise
finally:
self._SetCommandLineFile(self._saved_cmdline or '')
# Restore the saved command line if it appears to have come from a user.
# If it appears to be a Telemetry created command line, then don't restore
# it. This is to prevent a common bug where --host-resolver-rules borks
# people's browsers if something goes wrong with Telemetry.
self._SetCommandLineFile(
self._saved_cmdline
if '--host-resolver-rules' not in self._saved_cmdline else '')
def GetBrowserStartupArgs(self):
args = super(AndroidBrowserBackend, self).GetBrowserStartupArgs()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment