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

Unified Diff: build/android/pylib/uiautomator/test_runner.py

Issue 13989007: [Android] Split uiautomator test runner from instrumentation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/pylib/uiautomator/dispatch.py ('k') | build/android/pylib/utils/test_options_parser.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/uiautomator/test_runner.py
diff --git a/build/android/pylib/uiautomator/test_runner.py b/build/android/pylib/uiautomator/test_runner.py
new file mode 100644
index 0000000000000000000000000000000000000000..c35ac9756b8b93228a8662ea1b66e8443d4f0385
--- /dev/null
+++ b/build/android/pylib/uiautomator/test_runner.py
@@ -0,0 +1,40 @@
+# Copyright (c) 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Class for running uiautomator tests on a single device."""
+
+from pylib.instrumentation import test_runner as instr_test_runner
+
+
+class TestRunner(instr_test_runner.TestRunner):
+ """Responsible for running a series of tests connected to a single device."""
+
+ def __init__(self, options, device, shard_index, test_pkg, ports_to_forward):
+ """Create a new TestRunner.
+
+ Args:
+ options: An options object similar to the one in parent class plus:
+ - package_name: Application package name under test.
+ """
+ options.ensure_value('install_apk', True)
+ options.ensure_value('wait_for_debugger', False)
+ super(TestRunner, self).__init__(
+ options, device, shard_index, test_pkg, ports_to_forward)
+
+ self.package_name = options.package_name
+
+ #override
+ def PushDependencies(self):
+ self.test_pkg.Install(self.adb)
+
+ #override
+ def _RunTest(self, test, timeout):
+ self.adb.ClearApplicationState(self.package_name)
+ if 'Feature:FirstRunExperience' in self.test_pkg.GetTestAnnotations(test):
+ self.flags.RemoveFlags(['--disable-fre'])
+ else:
+ self.flags.AddFlags(['--disable-fre'])
+ return self.adb.RunUIAutomatorTest(
+ test, self.test_pkg.GetPackageName(), timeout)
+
« no previous file with comments | « build/android/pylib/uiautomator/dispatch.py ('k') | build/android/pylib/utils/test_options_parser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698