Lacros: fix a deployment bug where ash-chrome is not restarted

Currently, when deploying lacros-chrome and the config file is
modified, ash-chrome will not be restarted automatically, which is a
bug. This CL fixes the bug and also fixes an incorrect assumption in
the unit tests.

BUG=chromium:1156369
TEST=unit tests + manual testing

Change-Id: Ie84c6c9eeab5d31752ec31bd07c6967153d4ba4d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/2606845
Tested-by: Yuke Liao <liaoyuke@chromium.org>
Commit-Queue: Yuke Liao <liaoyuke@chromium.org>
Reviewed-by: Ben Pastene <bpastene@chromium.org>
diff --git a/scripts/deploy_chrome_unittest.py b/scripts/deploy_chrome_unittest.py
index ccaa01c..273a9cc 100644
--- a/scripts/deploy_chrome_unittest.py
+++ b/scripts/deploy_chrome_unittest.py
@@ -449,6 +449,7 @@
     # Raises a RunCommandError on its first invocation, but passes on subsequent
     # calls.
     def SideEffect(*args, **kwargs):
+      # pylint: disable=unused-argument
       if not SideEffect.called:
         SideEffect.called = True
         raise cros_build_lib.RunCommandError('fail')
@@ -490,16 +491,10 @@
     self.deploy._MountRootfsAsWritable = mock.Mock()
     self.deploy._PrepareStagingDir = mock.Mock()
     self.deploy._CheckDeviceFreeSpace = mock.Mock()
-
-    self._ran_start_command = False
-
+    self.deploy._KillAshChromeIfNeeded = mock.Mock()
     self.StartPatcher(parallel_unittest.ParallelMock())
 
-    # Common mocking shared between tests.
-    def kill_procs_side_effect():
-      self.deploy._stopped_ui = True
-    self.deploy._KillAshChromeIfNeeded = mock.Mock(
-        side_effect=kill_procs_side_effect)
+    self._ran_start_command = False
 
     def start_ui_side_effect(*args, **kwargs):
       # pylint: disable=unused-argument