summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/test/chromeos/autotest/files/client/site_tests/desktopui_BrowserTest/desktopui_BrowserTest.py22
1 files changed, 18 insertions, 4 deletions
diff --git a/chrome/test/chromeos/autotest/files/client/site_tests/desktopui_BrowserTest/desktopui_BrowserTest.py b/chrome/test/chromeos/autotest/files/client/site_tests/desktopui_BrowserTest/desktopui_BrowserTest.py
index 38df439..f9d7321 100644
--- a/chrome/test/chromeos/autotest/files/client/site_tests/desktopui_BrowserTest/desktopui_BrowserTest.py
+++ b/chrome/test/chromeos/autotest/files/client/site_tests/desktopui_BrowserTest/desktopui_BrowserTest.py
@@ -8,10 +8,19 @@ from blacklists import blacklist, blacklist_vm
SKIP_DEPS_ARG = 'skip_deps'
GDBSERVER_ARG = 'gdbserver'
GTEST_FILTER_ARG = 'gtest_filter='
+PASS_TO_TESTS_ARG = 'pass_to_tests='
GDBSERVER_SETUP_CMD = '/sbin/iptables -A INPUT -p tcp --dport 1234 -j ACCEPT'
GDBSERVER_STRING = 'gdbserver PORT:1234'
+def extract_named_args(name, arguments=[]):
+ # return a list of arguments with the named part removed
+ return [x[len(name):]
+ for x in arguments
+ # if the argument starts with the given name
+ if name == x[:len(name)]]
+
+
def get_binary_prefix(arguments=[]):
if GDBSERVER_ARG in arguments:
cros_ui.xsystem(GDBSERVER_SETUP_CMD, ignore_status=True)
@@ -37,9 +46,7 @@ class desktopui_BrowserTest(chrome_test.ChromeTestBase, cros_ui_test.UITest):
def get_tests_to_run(self, group=0, total_groups=1, arguments=[]):
# Tests specified in arguments override default test behavior
- tests_to_run = [x[len(GTEST_FILTER_ARG):]
- for x in arguments
- if GTEST_FILTER_ARG in x]
+ tests_to_run = extract_named_args(GTEST_FILTER_ARG, arguments)
if not tests_to_run:
tests_to_run = self.filter_bad_tests(
self.generate_test_list(self.binary_to_run, group,
@@ -49,6 +56,13 @@ class desktopui_BrowserTest(chrome_test.ChromeTestBase, cros_ui_test.UITest):
def run_once(self, group=0, total_groups=1, arguments=[]):
tests_to_run = self.get_tests_to_run(group, total_groups, arguments)
+
+ test_args = '--gtest_filter=%s' % ':'.join(tests_to_run);
+ args_to_pass = ' --'.join(extract_named_args(PASS_TO_TESTS_ARG,
+ arguments));
+ if args_to_pass:
+ test_args += ' --' + args_to_pass
+
self.run_chrome_test(self.binary_to_run,
- '--gtest_filter=%s' % ':'.join(tests_to_run),
+ test_args,
prefix=get_binary_prefix(arguments))