Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / tools / telemetry / telemetry / util / support_binaries.py
index 3e8c2bc..edccb0f 100644 (file)
@@ -10,13 +10,14 @@ from telemetry.util import cloud_storage
 from telemetry.util import path
 
 
-def _GetBinPath(binary_name, platform_name):
-  # TODO(tonyg): Add another nesting level for architecture_name.
-  return os.path.join(path.GetTelemetryDir(), 'bin', platform_name, binary_name)
+def _GetBinPath(binary_name, arch_name, platform_name):
+  return os.path.join(
+      path.GetTelemetryDir(), 'bin', platform_name, arch_name, binary_name)
 
 
-def _IsInCloudStorage(binary_name, platform_name):
-  return os.path.exists(_GetBinPath(binary_name, platform_name) + '.sha1')
+def _IsInCloudStorage(binary_name, arch_name, platform_name):
+  return os.path.exists(
+      _GetBinPath(binary_name, arch_name, platform_name) + '.sha1')
 
 
 @decorators.Cache
@@ -39,15 +40,16 @@ def FindLocallyBuiltPath(binary_name):
 
 
 @decorators.Cache
-def FindPath(binary_name, platform_name):
+def FindPath(binary_name, arch_name, platform_name):
   """Returns the path to the given binary name, pulling from the cloud if
   necessary."""
   if platform_name == 'win':
     binary_name += '.exe'
   command = FindLocallyBuiltPath(binary_name)
-  if not command and _IsInCloudStorage(binary_name, platform_name):
-    cloud_storage.GetIfChanged(_GetBinPath(binary_name, platform_name))
-    command = _GetBinPath(binary_name, platform_name)
+  if not command and _IsInCloudStorage(binary_name, arch_name, platform_name):
+    cloud_storage.GetIfChanged(
+        _GetBinPath(binary_name, arch_name, platform_name))
+    command = _GetBinPath(binary_name, arch_name, platform_name)
 
     # Ensure the downloaded file is actually executable.
     if command and os.path.exists(command):