Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Side by Side Diff: build/android/single_test_runner.py

Issue 10051021: apk-based test runner work for android (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 logging 5 import logging
6 import os 6 import os
7 import sys 7 import sys
8 8
9 from base_test_runner import BaseTestRunner 9 from base_test_runner import BaseTestRunner
10 import debug_info 10 import debug_info
11 import run_tests_helper 11 import run_tests_helper
12 from test_package_apk import TestPackageApk
12 from test_package_executable import TestPackageExecutable 13 from test_package_executable import TestPackageExecutable
13 from test_result import TestResults 14 from test_result import TestResults
14 15
15 16
16 class SingleTestRunner(BaseTestRunner): 17 class SingleTestRunner(BaseTestRunner):
17 """Single test suite attached to a single device. 18 """Single test suite attached to a single device.
18 19
19 Args: 20 Args:
20 device: Device to run the tests. 21 device: Device to run the tests.
21 test_suite: A specific test suite to run, empty to run all. 22 test_suite: A specific test suite to run, empty to run all.
(...skipping 17 matching lines...) Expand all
39 self._gtest_filter = gtest_filter 40 self._gtest_filter = gtest_filter
40 self._test_arguments = test_arguments 41 self._test_arguments = test_arguments
41 self.test_results = TestResults() 42 self.test_results = TestResults()
42 if dump_debug_info: 43 if dump_debug_info:
43 self.dump_debug_info = debug_info.GTestDebugInfo(self.adb, device, 44 self.dump_debug_info = debug_info.GTestDebugInfo(self.adb, device,
44 os.path.basename(test_suite), gtest_filter) 45 os.path.basename(test_suite), gtest_filter)
45 else: 46 else:
46 self.dump_debug_info = None 47 self.dump_debug_info = None
47 self.fast_and_loose = fast_and_loose 48 self.fast_and_loose = fast_and_loose
48 49
49 self.test_package = TestPackageExecutable(self.adb, device, 50 if os.path.splitext(test_suite)[1] == '.apk':
50 test_suite, timeout, rebaseline, performance_test, cleanup_test_files, 51 self.test_package = TestPackageApk(
51 tool, self.dump_debug_info) 52 self.adb, device,
53 test_suite, timeout, rebaseline, performance_test, cleanup_test_files,
54 tool, self.dump_debug_info)
55 else:
56 android_product_out = '.' # os.environ['ANDROID_PRODUCT_OUT']
57 symbols_dir = os.path.join(
58 android_product_out, 'symbols', 'data',
59 'local')
bulach 2012/04/12 15:51:42 56-59 seem unnecessary in this context..
John Grabowski 2012/04/13 01:11:37 right; removed
60 self.test_package = TestPackageExecutable(
61 self.adb, device,
62 test_suite, timeout, rebaseline, performance_test, cleanup_test_files,
63 tool, self.dump_debug_info)
52 64
53 def _GetHttpServerDocumentRootForTestSuite(self): 65 def _GetHttpServerDocumentRootForTestSuite(self):
54 """Returns the document root needed by the test suite.""" 66 """Returns the document root needed by the test suite."""
55 if self.test_package.test_suite_basename == 'page_cycler_tests': 67 if self.test_package.test_suite_basename == 'page_cycler_tests':
56 return os.path.join(run_tests_helper.CHROME_DIR, 'data', 'page_cycler') 68 return os.path.join(run_tests_helper.CHROME_DIR, 'data', 'page_cycler')
57 return None 69 return None
58 70
59 71
60 def _TestSuiteRequiresMockTestServer(self): 72 def _TestSuiteRequiresMockTestServer(self):
61 """Returns True if the test suite requires mock test server.""" 73 """Returns True if the test suite requires mock test server."""
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 def TearDown(self): 312 def TearDown(self):
301 """Cleans up the test enviroment for the test suite.""" 313 """Cleans up the test enviroment for the test suite."""
302 self.test_package.tool.CleanUpEnvironment() 314 self.test_package.tool.CleanUpEnvironment()
303 if self.test_package.cleanup_test_files: 315 if self.test_package.cleanup_test_files:
304 self.adb.RemovePushedFiles() 316 self.adb.RemovePushedFiles()
305 if self.dump_debug_info: 317 if self.dump_debug_info:
306 self.dump_debug_info.StopRecordingLog() 318 self.dump_debug_info.StopRecordingLog()
307 if self.test_package.performance_test: 319 if self.test_package.performance_test:
308 self.adb.TearDownPerformanceTest() 320 self.adb.TearDownPerformanceTest()
309 super(SingleTestRunner, self).TearDown() 321 super(SingleTestRunner, self).TearDown()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698