def push_test_data(dev):
     # Push data dependencies.
     device_root = self._delegate.GetTestDataRoot(dev)
     host_device_tuples_substituted = [
         (h,
          local_device_test_run.SubstituteDeviceRoot(
              d, device_root)) for h, d in host_device_tuples
     ]
     local_device_environment.place_nomedia_on_device(
         dev, device_root)
     dev.PushChangedFiles(
         host_device_tuples_substituted,
         delete_device_stale=True,
         # Some gtest suites, e.g. unit_tests, have data dependencies that
         # can take longer than the default timeout to push. See
         # crbug.com/791632 for context.
         timeout=600 *
         math.ceil(_GetDeviceTimeoutMultiplier() / 10))
     if not host_device_tuples:
         dev.RemovePath(device_root,
                        force=True,
                        recursive=True,
                        rename=True)
         dev.RunShellCommand(['mkdir', '-p', device_root],
                             check_return=True)
 def push_test_data():
   # Push data dependencies.
   device_root = self._delegate.GetTestDataRoot(dev)
   host_device_tuples_substituted = [
       (h, local_device_test_run.SubstituteDeviceRoot(d, device_root))
       for h, d in host_device_tuples]
   dev.PushChangedFiles(
       host_device_tuples_substituted,
       delete_device_stale=True)
   if not host_device_tuples:
     dev.RunShellCommand(['rm', '-rf', device_root], check_return=True)
     dev.RunShellCommand(['mkdir', '-p', device_root], check_return=True)
 def push_test_data():
   device_root = posixpath.join(dev.GetExternalStoragePath(),
                                'chromium_tests_root')
   host_device_tuples_substituted = [
       (h, local_device_test_run.SubstituteDeviceRoot(d, device_root))
       for h, d in host_device_tuples]
   logging.info('instrumentation data deps:')
   for h, d in host_device_tuples_substituted:
     logging.info('%r -> %r', h, d)
   dev.PushChangedFiles(host_device_tuples_substituted,
                        delete_device_stale=True)
   if not host_device_tuples_substituted:
     dev.RunShellCommand(['rm', '-rf', device_root], check_return=True)
     dev.RunShellCommand(['mkdir', '-p', device_root], check_return=True)
 def push_test_data(dev):
   device_root = posixpath.join(dev.GetExternalStoragePath(),
                                'chromium_tests_root')
   host_device_tuples_substituted = [
       (h, local_device_test_run.SubstituteDeviceRoot(d, device_root))
       for h, d in host_device_tuples]
   logging.info('Pushing data dependencies.')
   for h, d in host_device_tuples_substituted:
     logging.debug('  %r -> %r', h, d)
   local_device_environment.place_nomedia_on_device(dev, device_root)
   dev.PushChangedFiles(host_device_tuples_substituted,
                        delete_device_stale=True)
   if not host_device_tuples_substituted:
     dev.RunShellCommand(['rm', '-rf', device_root], check_return=True)
     dev.RunShellCommand(['mkdir', '-p', device_root], check_return=True)
Beispiel #5
0
 def testListWithoutNoneDevicePath(self):
     self.assertEquals(
         '/another/fake/device/path',
         local_device_test_run.SubstituteDeviceRoot(
             ['/', 'another', 'fake', 'device', 'path'],
             '/fake/device/root'))
Beispiel #6
0
 def testListWithNoneDevicePath(self):
     self.assertEquals(
         '/fake/device/root/subpath',
         local_device_test_run.SubstituteDeviceRoot([None, 'subpath'],
                                                    '/fake/device/root'))
Beispiel #7
0
 def testStringDevicePath(self):
     self.assertEquals(
         '/another/fake/device/path',
         local_device_test_run.SubstituteDeviceRoot(
             '/another/fake/device/path', '/fake/device/root'))
Beispiel #8
0
 def testNoneDevicePath(self):
     self.assertEquals(
         '/fake/device/root',
         local_device_test_run.SubstituteDeviceRoot(None,
                                                    '/fake/device/root'))