| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import glob | 5 import glob |
| 6 import logging | 6 import logging |
| 7 import os | 7 import os |
| 8 import sys | 8 import sys |
| 9 | 9 |
| 10 from pylib import android_commands | 10 from pylib import android_commands |
| 11 from pylib import cmd_helper | 11 from pylib import cmd_helper |
| 12 from pylib import constants | 12 from pylib import constants |
| 13 from pylib import perf_tests_helper | 13 from pylib import perf_tests_helper |
| 14 from pylib.android_commands import errors | 14 from pylib.android_commands import errors |
| 15 from pylib.base import base_test_result | 15 from pylib.base import base_test_result |
| 16 from pylib.base import base_test_runner | 16 from pylib.base import base_test_runner |
| 17 from pylib.utils import run_tests_helper | 17 from pylib.utils import run_tests_helper |
| 18 | 18 |
| 19 import test_package_apk | 19 import test_package_apk |
| 20 import test_package_executable | 20 import test_package_executable |
| 21 | 21 |
| 22 sys.path.insert( | 22 sys.path.insert( |
| 23 0, os.path.join(constants.DIR_SOURCE_ROOT, 'tools', 'swarm_client')) | 23 0, os.path.join(constants.DIR_SOURCE_ROOT, 'tools', 'swarm_client')) |
| 24 import run_isolated | 24 import run_isolated |
| 25 | 25 |
| 26 | 26 |
| 27 _ISOLATE_FILE_PATHS = { | 27 _ISOLATE_FILE_PATHS = { |
| 28 'base_unittests': 'base/base_unittests.isolate', | 28 #'base_unittests': 'base/base_unittests.isolate', |
| 29 #'net_unittests': 'net/net_unittests.isolate', | 29 #'net_unittests': 'net/net_unittests.isolate', |
| 30 #'unit_tests': 'chrome/unit_tests.isolate', | 30 #'unit_tests': 'chrome/unit_tests.isolate', |
| 31 #'content_browsertests': 'content/content_browsertests.isolate', | 31 #'content_browsertests': 'content/content_browsertests.isolate', |
| 32 #'content_unittests': 'content/content_unittests.isolate', | 32 #'content_unittests': 'content/content_unittests.isolate', |
| 33 } | 33 } |
| 34 _ISOLATE_SCRIPT = os.path.join( | 34 _ISOLATE_SCRIPT = os.path.join( |
| 35 constants.DIR_SOURCE_ROOT, 'tools', 'swarm_client', 'isolate.py') | 35 constants.DIR_SOURCE_ROOT, 'tools', 'swarm_client', 'isolate.py') |
| 36 | 36 |
| 37 | 37 |
| 38 def _GetDataFilesForTestSuite(product_dir, test_suite_basename): | 38 def _GetDataFilesForTestSuite(product_dir, test_suite_basename): |
| (...skipping 28 matching lines...) Expand all Loading... |
| 67 with open(isolated_abs_path) as f: | 67 with open(isolated_abs_path) as f: |
| 68 isolated_content = run_isolated.load_isolated(f.read(), | 68 isolated_content = run_isolated.load_isolated(f.read(), |
| 69 os_flavor='android') | 69 os_flavor='android') |
| 70 assert isolated_content['os'] == 'android' | 70 assert isolated_content['os'] == 'android' |
| 71 return isolated_content['files'].keys() | 71 return isolated_content['files'].keys() |
| 72 | 72 |
| 73 logging.info('Did not find an isolate file for the test suite.') | 73 logging.info('Did not find an isolate file for the test suite.') |
| 74 # Ideally, we'd just push all test data. However, it has >100MB, and a lot | 74 # Ideally, we'd just push all test data. However, it has >100MB, and a lot |
| 75 # of the files are not relevant (some are used for browser_tests, others for | 75 # of the files are not relevant (some are used for browser_tests, others for |
| 76 # features not supported, etc..). | 76 # features not supported, etc..). |
| 77 if test_suite_basename == 'unit_tests': | 77 if test_suite_basename == 'base_unittests': |
| 78 return [ |
| 79 'base/test/data/', |
| 80 ] |
| 81 elif test_suite_basename == 'unit_tests': |
| 78 test_files = [ | 82 test_files = [ |
| 79 'base/test/data/', | 83 'base/test/data/', |
| 80 'chrome/test/data/download-test1.lib', | 84 'chrome/test/data/download-test1.lib', |
| 81 'chrome/test/data/extensions/bad_magic.crx', | 85 'chrome/test/data/extensions/bad_magic.crx', |
| 82 'chrome/test/data/extensions/good.crx', | 86 'chrome/test/data/extensions/good.crx', |
| 83 'chrome/test/data/extensions/icon1.png', | 87 'chrome/test/data/extensions/icon1.png', |
| 84 'chrome/test/data/extensions/icon2.png', | 88 'chrome/test/data/extensions/icon2.png', |
| 85 'chrome/test/data/extensions/icon3.png', | 89 'chrome/test/data/extensions/icon3.png', |
| 86 'chrome/test/data/extensions/allow_silent_upgrade/', | 90 'chrome/test/data/extensions/allow_silent_upgrade/', |
| 87 'chrome/test/data/extensions/app/', | 91 'chrome/test/data/extensions/app/', |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 self.LaunchChromeTestServerSpawner() | 388 self.LaunchChromeTestServerSpawner() |
| 385 self.tool.SetupEnvironment() | 389 self.tool.SetupEnvironment() |
| 386 | 390 |
| 387 #override | 391 #override |
| 388 def TearDown(self): | 392 def TearDown(self): |
| 389 """Cleans up the test enviroment for the test suite.""" | 393 """Cleans up the test enviroment for the test suite.""" |
| 390 self.tool.CleanUpEnvironment() | 394 self.tool.CleanUpEnvironment() |
| 391 if self._cleanup_test_files: | 395 if self._cleanup_test_files: |
| 392 self.adb.RemovePushedFiles() | 396 self.adb.RemovePushedFiles() |
| 393 super(TestRunner, self).TearDown() | 397 super(TestRunner, self).TearDown() |
| OLD | NEW |