Fix deploy_chrome with content_shell overlays

Fix content_shell detection and add copy paths conditionals for deploying
ECS with strict staging.

BUG=chromium:347780
TEST=`./scripts/deploy_chrome_unittest.py` test cases added and passes

Change-Id: I712260232febf5d707a7ca57b3cd69c9846b36cd
Reviewed-on: https://chromium-review.googlesource.com/190251
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Steve Fung <stevefung@chromium.org>
Commit-Queue: Steve Fung <stevefung@chromium.org>
Tested-by: Steve Fung <stevefung@chromium.org>
diff --git a/scripts/deploy_chrome.py b/scripts/deploy_chrome.py
index 64a7541..98dd17b 100644
--- a/scripts/deploy_chrome.py
+++ b/scripts/deploy_chrome.py
@@ -324,15 +324,21 @@
       raise DeployFailure(ex)
 
   def _CheckDeployType(self):
-    if self.options.build_dir and os.path.exists(
-        os.path.join(self.options.build_dir, 'system.unand')):
-      # Content shell deployment.
-      self.content_shell = True
-      self.options.build_dir = os.path.join(self.options.build_dir,
-                                            'system.unand/chrome/')
-      self.options.dostrip = False
-      self.options.target_dir = _ANDROID_DIR
-      self.copy_paths = chrome_util.GetCopyPaths(True)
+    if self.options.build_dir:
+      if os.path.exists(os.path.join(self.options.build_dir, 'system.unand')):
+        # Unand Content shell deployment.
+        self.content_shell = True
+        self.options.build_dir = os.path.join(self.options.build_dir,
+                                              'system.unand/chrome/')
+        self.options.dostrip = False
+        self.options.target_dir = _ANDROID_DIR
+        self.copy_paths = chrome_util.GetCopyPaths(True)
+      elif os.path.exists(os.path.join(self.options.build_dir,
+                                       'content_shell')) and not os.path.exists(
+          os.path.join(self.options.build_dir, 'chrome')):
+        # Content shell deployment
+        self.content_shell = True
+        self.copy_paths = chrome_util.GetCopyPaths(True)
     elif self.options.local_pkg_path or self.options.gs_path:
       # Package deployment.
       pkg_path = self.options.local_pkg_path