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 """Runs the Java tests. See more information on run_instrumentation_tests.py.""" | 5 """Runs the Java tests. See more information on run_instrumentation_tests.py.""" |
6 | 6 |
7 import fnmatch | 7 import fnmatch |
8 import logging | 8 import logging |
9 import os | 9 import os |
10 import re | 10 import re |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 # If the test is set to run on a specific device type only (IE: only | 358 # If the test is set to run on a specific device type only (IE: only |
359 # tablet or phone) and it is being run on the wrong device, the test | 359 # tablet or phone) and it is being run on the wrong device, the test |
360 # just quits and does not do anything. The java test harness will still | 360 # just quits and does not do anything. The java test harness will still |
361 # print the appropriate annotation for us, but will add --NORUN-- for | 361 # print the appropriate annotation for us, but will add --NORUN-- for |
362 # us so we know to ignore the results. | 362 # us so we know to ignore the results. |
363 # The --NORUN-- tag is managed by MainActivityTestBase.java | 363 # The --NORUN-- tag is managed by MainActivityTestBase.java |
364 if regex.group(1) != '--NORUN--': | 364 if regex.group(1) != '--NORUN--': |
365 | 365 |
366 # Obtain the relevant perf data. The data is dumped to a | 366 # Obtain the relevant perf data. The data is dumped to a |
367 # JSON formatted file. | 367 # JSON formatted file. |
368 json_string = self.adb.GetFileContents( | 368 json_string = self.adb.GetProtectedFileContents( |
369 '/data/data/com.google.android.apps.chrome/files/PerfTestData.txt') | 369 '/data/data/com.google.android.apps.chrome/files/PerfTestData.txt') |
370 | 370 |
371 if json_string: | 371 if json_string: |
372 json_string = '\n'.join(json_string) | 372 json_string = '\n'.join(json_string) |
373 else: | 373 else: |
374 raise FatalTestException('Perf file does not exist or is empty') | 374 raise FatalTestException('Perf file does not exist or is empty') |
375 | 375 |
376 if self.save_perf_json: | 376 if self.save_perf_json: |
377 json_local_file = '/tmp/chromium-android-perf-json-' + raw_test_name | 377 json_local_file = '/tmp/chromium-android-perf-json-' + raw_test_name |
378 with open(json_local_file, 'w') as f: | 378 with open(json_local_file, 'w') as f: |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 | 586 |
587 logging.info('Will run: %s', str(tests)) | 587 logging.info('Will run: %s', str(tests)) |
588 | 588 |
589 if len(attached_devices) > 1 and (coverage or options.wait_for_debugger): | 589 if len(attached_devices) > 1 and (coverage or options.wait_for_debugger): |
590 logging.warning('Coverage / debugger can not be sharded, ' | 590 logging.warning('Coverage / debugger can not be sharded, ' |
591 'using first available device') | 591 'using first available device') |
592 attached_devices = attached_devices[:1] | 592 attached_devices = attached_devices[:1] |
593 sharder = TestSharder(attached_devices, options, tests, apks) | 593 sharder = TestSharder(attached_devices, options, tests, apks) |
594 test_results = sharder.RunShardedTests() | 594 test_results = sharder.RunShardedTests() |
595 return test_results | 595 return test_results |
OLD | NEW |