deploy_chrome: Always prompt to remove rootfs verification

This partially undoes a change for crbug.com/436971 in order
to make the behavior of deploy_chrome more consistent.

Developers using --target-dir will be prompted to remove rootfs
verification if necessary, allowing the root partition to be
modified, same as for developers not using --target-dir. This
allows simplification of documentation, e.g. for modifying
/etc/chrome_dev.conf.

Developers not wishing to remove rootfs verification and reboot
can answer 'No' to the prompt and deploy_chrome will still work
if --target-dir specifies a directory in /usr/local.

BUG=None
TEST=Run deploy_chrome --mount-dir=/opt/google/chrome
     --target-dir=/usr/local/chrome on a freshly imaged device
     and ensure that the prompt to remove rootfs verification
     is shown.

Change-Id: Ia174921eaff2ba91956c9886d58274e9a0d82c13
Reviewed-on: https://chromium-review.googlesource.com/1132417
Tested-by: Steven Bennetts <stevenjb@chromium.org>
Trybot-Ready: Steven Bennetts <stevenjb@chromium.org>
Reviewed-by: Robert Flack <flackr@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/scripts/deploy_chrome_unittest.py b/scripts/deploy_chrome_unittest.py
index 1d94d67..60c29dc 100644
--- a/scripts/deploy_chrome_unittest.py
+++ b/scripts/deploy_chrome_unittest.py
@@ -165,7 +165,7 @@
     """Test the working case, disabling rootfs verification."""
     self.deploy_mock.MockMountCmd(0)
     self.deploy._DisableRootfsVerification()
-    self.assertFalse(self.deploy._target_dir_is_still_readonly.is_set())
+    self.assertFalse(self.deploy._root_dir_is_still_readonly.is_set())
 
   def testDisableRootfsVerificationFailure(self):
     """Test failure to disable rootfs verification."""
@@ -176,7 +176,7 @@
     self.assertRaises(cros_build_lib.RunCommandError,
                       self.deploy._DisableRootfsVerification)
     self.remote_reboot_mock.side_effect = None
-    self.assertFalse(self.deploy._target_dir_is_still_readonly.is_set())
+    self.assertFalse(self.deploy._root_dir_is_still_readonly.is_set())
 
 
 class TestMount(DeployTest):
@@ -184,32 +184,32 @@
 
   def testSuccess(self):
     """Test case where we are able to mount as writable."""
-    self.assertFalse(self.deploy._target_dir_is_still_readonly.is_set())
+    self.assertFalse(self.deploy._root_dir_is_still_readonly.is_set())
     self.deploy_mock.MockMountCmd(0)
     self.deploy._MountRootfsAsWritable()
-    self.assertFalse(self.deploy._target_dir_is_still_readonly.is_set())
+    self.assertFalse(self.deploy._root_dir_is_still_readonly.is_set())
 
   def testMountError(self):
     """Test that mount failure doesn't raise an exception by default."""
-    self.assertFalse(self.deploy._target_dir_is_still_readonly.is_set())
+    self.assertFalse(self.deploy._root_dir_is_still_readonly.is_set())
     self.PatchObject(remote_access.RemoteDevice, 'IsDirWritable',
                      return_value=False, autospec=True)
     self.deploy._MountRootfsAsWritable()
-    self.assertTrue(self.deploy._target_dir_is_still_readonly.is_set())
+    self.assertTrue(self.deploy._root_dir_is_still_readonly.is_set())
 
   def testMountRwFailure(self):
     """Test that mount failure raises an exception if error_code_ok=False."""
     self.assertRaises(cros_build_lib.RunCommandError,
                       self.deploy._MountRootfsAsWritable, error_code_ok=False)
-    self.assertFalse(self.deploy._target_dir_is_still_readonly.is_set())
+    self.assertFalse(self.deploy._root_dir_is_still_readonly.is_set())
 
   def testMountTempDir(self):
     """Test that mount succeeds if target dir is writable."""
-    self.assertFalse(self.deploy._target_dir_is_still_readonly.is_set())
+    self.assertFalse(self.deploy._root_dir_is_still_readonly.is_set())
     self.PatchObject(remote_access.RemoteDevice, 'IsDirWritable',
                      return_value=True, autospec=True)
     self.deploy._MountRootfsAsWritable()
-    self.assertFalse(self.deploy._target_dir_is_still_readonly.is_set())
+    self.assertFalse(self.deploy._root_dir_is_still_readonly.is_set())
 
 
 class TestUiJobStarted(DeployTest):