Index: build/android/pylib/browsertests/setup.py |
diff --git a/build/android/pylib/browsertests/setup.py b/build/android/pylib/browsertests/setup.py |
index 82c6b11312cf7c9d1249b95501984cb74862a442..58ff1c444270877e0760fb6570e5c5fdebc5deec 100644 |
--- a/build/android/pylib/browsertests/setup.py |
+++ b/build/android/pylib/browsertests/setup.py |
@@ -4,32 +4,22 @@ |
"""Generate test runner factory and tests for content_browsertests.""" |
frankf
2013/07/31 00:14:00
Always rebase, this file is no more.
gkanwar1
2013/07/31 18:07:06
Done.
|
-import logging |
import os |
-import sys |
from pylib import android_commands |
from pylib import cmd_helper |
from pylib import constants |
from pylib import ports |
-from pylib.base import base_test_result |
from pylib.gtest import setup as gtest_setup |
from pylib.gtest import test_runner |
-from pylib.utils import report_results |
-def Setup(test_arguments, timeout, cleanup_test_files, tool, build_type, |
- push_deps, gtest_filter): |
+def Setup(test_options): |
"""Create the test runner factory and tests. |
Args: |
- test_arguments: Additional arguments to pass to the test binary. |
- timeout: Timeout for each test. |
- cleanup_test_files: Whether or not to cleanup test files on device. |
- tool: Name of the Valgrind tool. |
- build_type: 'Release' or 'Debug'. |
- push_deps: If True, push all dependencies to the device. |
- gtest_filter: filter for tests. |
+ test_options: A GTestOptions object containing all options relevant |
+ to running gtests. |
Returns: |
A tuple of (TestRunnerFactory, tests). |
@@ -38,23 +28,19 @@ def Setup(test_arguments, timeout, cleanup_test_files, tool, build_type, |
if not ports.ResetTestServerPortAllocation(): |
raise Exception('Failed to reset test server port.') |
- suite_path = os.path.join(cmd_helper.OutDirectory.get(), build_type, 'apks', |
+ suite_path = os.path.join(cmd_helper.OutDirectory.get(), |
+ test_options.build_type, 'apks', |
constants.BROWSERTEST_SUITE_NAME + '.apk') |
gtest_setup._GenerateDepsDirUsingIsolate( |
- constants.BROWSERTEST_SUITE_NAME, build_type) |
+ constants.BROWSERTEST_SUITE_NAME, test_options.build_type) |
# Constructs a new TestRunner with the current options. |
def TestRunnerFactory(device, shard_index): |
return test_runner.TestRunner( |
- device, |
+ test_options, |
suite_path, |
- test_arguments, |
- timeout, |
- cleanup_test_files, |
- tool, |
- build_type, |
- push_deps, |
+ device, |
constants.BROWSERTEST_TEST_PACKAGE_NAME, |
constants.BROWSERTEST_TEST_ACTIVITY_NAME, |
constants.BROWSERTEST_COMMAND_LINE_FILE) |
@@ -64,8 +50,8 @@ def Setup(test_arguments, timeout, cleanup_test_files, tool, build_type, |
attached_devices = android_commands.GetAttachedDevices() |
all_tests = gtest_setup.GetTestsFiltered( |
- constants.BROWSERTEST_SUITE_NAME, gtest_filter, TestRunnerFactory, |
- attached_devices) |
+ constants.BROWSERTEST_SUITE_NAME, test_options.gtest_filter, |
+ TestRunnerFactory, attached_devices) |
return (TestRunnerFactory, all_tests) |