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 | 8 |
9 from pylib import android_commands | 9 from pylib import android_commands |
10 from pylib import constants | 10 from pylib import constants |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 Args: | 24 Args: |
25 test_suite_basename: The test suite basename for which to return file paths. | 25 test_suite_basename: The test suite basename for which to return file paths. |
26 | 26 |
27 Returns: | 27 Returns: |
28 A list of test file and directory paths. | 28 A list of test file and directory paths. |
29 """ | 29 """ |
30 # Ideally, we'd just push all test data. However, it has >100MB, and a lot | 30 # Ideally, we'd just push all test data. However, it has >100MB, and a lot |
31 # of the files are not relevant (some are used for browser_tests, others for | 31 # of the files are not relevant (some are used for browser_tests, others for |
32 # features not supported, etc..). | 32 # features not supported, etc..). |
33 if test_suite_basename in ['base_unittests', 'sql_unittests', 'unit_tests']: | 33 if test_suite_basename == 'base_unittests': |
| 34 return [ |
| 35 'base/test/data/', |
| 36 ] |
| 37 elif test_suite_basename == 'unit_tests': |
34 test_files = [ | 38 test_files = [ |
35 'base/test/data/', | 39 'base/test/data/', |
36 'chrome/test/data/download-test1.lib', | 40 'chrome/test/data/download-test1.lib', |
37 'chrome/test/data/extensions/bad_magic.crx', | 41 'chrome/test/data/extensions/bad_magic.crx', |
38 'chrome/test/data/extensions/good.crx', | 42 'chrome/test/data/extensions/good.crx', |
39 'chrome/test/data/extensions/icon1.png', | 43 'chrome/test/data/extensions/icon1.png', |
40 'chrome/test/data/extensions/icon2.png', | 44 'chrome/test/data/extensions/icon2.png', |
41 'chrome/test/data/extensions/icon3.png', | 45 'chrome/test/data/extensions/icon3.png', |
42 'chrome/test/data/extensions/allow_silent_upgrade/', | 46 'chrome/test/data/extensions/allow_silent_upgrade/', |
43 'chrome/test/data/extensions/app/', | 47 'chrome/test/data/extensions/app/', |
44 'chrome/test/data/extensions/bad/', | 48 'chrome/test/data/extensions/bad/', |
45 'chrome/test/data/extensions/effective_host_permissions/', | 49 'chrome/test/data/extensions/effective_host_permissions/', |
46 'chrome/test/data/extensions/empty_manifest/', | 50 'chrome/test/data/extensions/empty_manifest/', |
47 'chrome/test/data/extensions/good/Extensions/', | 51 'chrome/test/data/extensions/good/Extensions/', |
48 'chrome/test/data/extensions/manifest_tests/', | 52 'chrome/test/data/extensions/manifest_tests/', |
49 'chrome/test/data/extensions/page_action/', | 53 'chrome/test/data/extensions/page_action/', |
50 'chrome/test/data/extensions/permissions/', | 54 'chrome/test/data/extensions/permissions/', |
51 'chrome/test/data/extensions/script_and_capture/', | 55 'chrome/test/data/extensions/script_and_capture/', |
52 'chrome/test/data/extensions/unpacker/', | 56 'chrome/test/data/extensions/unpacker/', |
53 'chrome/test/data/bookmarks/', | 57 'chrome/test/data/bookmarks/', |
54 'chrome/test/data/components/', | 58 'chrome/test/data/components/', |
55 'chrome/test/data/extensions/json_schema_test.js', | 59 'chrome/test/data/extensions/json_schema_test.js', |
56 'chrome/test/data/History/', | 60 'chrome/test/data/History/', |
57 'chrome/test/data/json_schema_validator/', | 61 'chrome/test/data/json_schema_validator/', |
58 'chrome/test/data/pref_service/', | 62 'chrome/test/data/pref_service/', |
| 63 'chrome/test/data/simple_open_search.xml', |
59 'chrome/test/data/top_sites/', | 64 'chrome/test/data/top_sites/', |
60 'chrome/test/data/web_app_info/', | 65 'chrome/test/data/web_app_info/', |
61 'chrome/test/data/web_database', | 66 'chrome/test/data/web_database', |
62 'chrome/test/data/webui/', | 67 'chrome/test/data/webui/', |
| 68 'chrome/third_party/mock4js/', |
| 69 'net/data/ssl/certificates', |
| 70 'third_party/accessibility-developer-tools/gen/axs_testing.js', |
| 71 ] |
| 72 # The following are spell check data. Now only list the data under |
| 73 # third_party/hunspell_dictionaries which are used by unit tests. |
| 74 old_cwd = os.getcwd() |
| 75 os.chdir(constants.CHROME_DIR) |
| 76 test_files += glob.glob('third_party/hunspell_dictionaries/*.bdic') |
| 77 os.chdir(old_cwd) |
| 78 return test_files |
| 79 elif test_suite_basename == 'components_unittests': |
| 80 return [ |
63 'components/test/data/zip', | 81 'components/test/data/zip', |
64 'chrome/third_party/mock4js/', | |
65 'content/browser/gpu/software_rendering_list.json', | |
66 'net/data/cache_tests/insert_load1', | |
67 'net/data/cache_tests/dirty_entry5', | |
68 'net/data/ssl/certificates/', | |
69 'third_party/accessibility-developer-tools/gen/axs_testing.js', | |
70 'ui/base/test/data/data_pack_unittest', | |
71 ] | 82 ] |
72 if test_suite_basename == 'unit_tests': | |
73 test_files += ['chrome/test/data/simple_open_search.xml'] | |
74 # The following are spell check data. Now only list the data under | |
75 # third_party/hunspell_dictionaries which are used by unit tests. | |
76 old_cwd = os.getcwd() | |
77 os.chdir(constants.CHROME_DIR) | |
78 test_files += glob.glob('third_party/hunspell_dictionaries/*.bdic') | |
79 os.chdir(old_cwd) | |
80 return test_files | |
81 elif test_suite_basename == 'media_unittests': | 83 elif test_suite_basename == 'media_unittests': |
82 return [ | 84 return [ |
83 'media/test/data', | 85 'media/test/data', |
84 ] | 86 ] |
85 elif test_suite_basename == 'net_unittests': | 87 elif test_suite_basename == 'net_unittests': |
86 return [ | 88 return [ |
87 'chrome/test/data/animate1.gif', | 89 'chrome/test/data/animate1.gif', |
88 'chrome/test/data/simple.html', | 90 'chrome/test/data/simple.html', |
89 'net/data/cache_tests', | 91 'net/data/cache_tests', |
90 'net/data/filter_unittests', | 92 'net/data/filter_unittests', |
91 'net/data/ftp', | 93 'net/data/ftp', |
92 'net/data/proxy_resolver_v8_tracing_unittest', | 94 'net/data/proxy_resolver_v8_tracing_unittest', |
93 'net/data/proxy_resolver_v8_unittest', | 95 'net/data/proxy_resolver_v8_unittest', |
| 96 'net/data/proxy_script_fetcher_unittest', |
94 'net/data/ssl/certificates', | 97 'net/data/ssl/certificates', |
95 'net/data/url_request_unittest/', | 98 'net/data/url_request_unittest/', |
96 'net/data/proxy_script_fetcher_unittest' | |
97 ] | 99 ] |
98 elif test_suite_basename == 'ui_tests': | 100 elif test_suite_basename == 'ui_tests': |
99 return [ | 101 return [ |
100 'chrome/test/data/dromaeo', | 102 'chrome/test/data/dromaeo', |
101 'chrome/test/data/json2.js', | 103 'chrome/test/data/json2.js', |
102 'chrome/test/data/sunspider', | 104 'chrome/test/data/sunspider', |
103 ] | 105 ] |
| 106 elif test_suite_basename == 'ui_unittests': |
| 107 return [ |
| 108 'ui/base/test/data/data_pack_unittest/truncated-header.pak', |
| 109 ] |
104 elif test_suite_basename == 'content_unittests': | 110 elif test_suite_basename == 'content_unittests': |
105 return [ | 111 return [ |
| 112 'content/browser/gpu/software_rendering_list.json', |
106 'content/test/data/gpu/webgl_conformance_test_expectations.txt', | 113 'content/test/data/gpu/webgl_conformance_test_expectations.txt', |
107 'net/data/ssl/certificates/', | 114 'net/data/ssl/certificates/', |
| 115 'third_party/hyphen/hyph_en_US.dic', |
108 'webkit/data/dom_storage/webcore_test_database.localstorage', | 116 'webkit/data/dom_storage/webcore_test_database.localstorage', |
109 'third_party/hyphen/hyph_en_US.dic', | |
110 ] | 117 ] |
111 elif test_suite_basename == 'cc_perftests': | 118 elif test_suite_basename == 'cc_perftests': |
112 return [ | 119 return [ |
113 'cc/test/data', | 120 'cc/test/data', |
114 ] | 121 ] |
115 elif test_suite_basename == 'perf_tests': | 122 elif test_suite_basename == 'perf_tests': |
116 return [ | 123 return [ |
117 'base/test/data', | 124 'base/test/data', |
118 ] | 125 ] |
119 elif test_suite_basename == 'content_browsertests': | 126 elif test_suite_basename == 'content_browsertests': |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 self.LaunchChromeTestServerSpawner() | 380 self.LaunchChromeTestServerSpawner() |
374 self.tool.SetupEnvironment() | 381 self.tool.SetupEnvironment() |
375 | 382 |
376 #override | 383 #override |
377 def TearDown(self): | 384 def TearDown(self): |
378 """Cleans up the test enviroment for the test suite.""" | 385 """Cleans up the test enviroment for the test suite.""" |
379 self.tool.CleanUpEnvironment() | 386 self.tool.CleanUpEnvironment() |
380 if self._cleanup_test_files: | 387 if self._cleanup_test_files: |
381 self.adb.RemovePushedFiles() | 388 self.adb.RemovePushedFiles() |
382 super(TestRunner, self).TearDown() | 389 super(TestRunner, self).TearDown() |
OLD | NEW |