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

Unified Diff: build/android/pylib/instrumentation/test_runner_test.py

Issue 607583002: [Android] Fix UIAutomator test running. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/instrumentation/test_runner.py ('k') | build/android/pylib/uiautomator/test_runner.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/instrumentation/test_runner_test.py
diff --git a/build/android/pylib/instrumentation/test_runner_test.py b/build/android/pylib/instrumentation/test_runner_test.py
index 394c6b7c8b3130bf4ef3fdb2eec12bb99fc27034..1a2b40f29aaf8a3cbf96d66cafcc522caf7ef0e8 100755
--- a/build/android/pylib/instrumentation/test_runner_test.py
+++ b/build/android/pylib/instrumentation/test_runner_test.py
@@ -251,18 +251,14 @@ class InstrumentationTestRunnerTest(unittest.TestCase):
self.assertEqual(base_test_result.ResultType.CRASH, result.GetType())
self.assertEqual('\nfoo/bar.py (27)\nhello/world.py (42)', result.GetLog())
- def testRunInstrumentationTest_verifyAdbShellCommand(self):
+ def test_RunTest_verifyAdbShellCommand(self):
self.instance.options.test_runner = 'MyTestRunner'
self.instance.device.RunShellCommand = mock.Mock()
- self.instance._GenerateTestResult = mock.Mock()
- with mock.patch('pylib.instrumentation.test_runner.'
- 'TestRunner._ParseAmInstrumentRawOutput',
- return_value=(mock.Mock(), mock.Mock(), mock.Mock())):
- self.instance.RunInstrumentationTest(
- 'test.package.TestClass#testMethod',
- 'test.package',
- {'test_arg_key': 'test_arg_value'},
- 100)
+ self.instance.test_pkg.GetPackageName = mock.Mock(
+ return_value='test.package')
+ self.instance._GetInstrumentationArgs = mock.Mock(
+ return_value={'test_arg_key': 'test_arg_value'})
+ self.instance._RunTest('test.package.TestClass#testMethod', 100)
self.instance.device.RunShellCommand.assert_called_with(
['am', 'instrument', '-r',
'-e', 'test_arg_key', "'test_arg_value'",
« no previous file with comments | « build/android/pylib/instrumentation/test_runner.py ('k') | build/android/pylib/uiautomator/test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698