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

Side by Side Diff: build/android/pylib/monkey/test_runner.py

Issue 26071002: [Android] Looks for events injected to signal passing monkey test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 """Runs a monkey test on a single device.""" 5 """Runs a monkey test on a single device."""
6 6
7 import random 7 import random
8 8
9 from pylib.base import base_test_result 9 from pylib.base import base_test_result
10 from pylib.base import base_test_runner 10 from pylib.base import base_test_runner
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 # Run the test. 60 # Run the test.
61 output = '' 61 output = ''
62 if before_pids: 62 if before_pids:
63 output = '\n'.join(self._LaunchMonkeyTest()) 63 output = '\n'.join(self._LaunchMonkeyTest())
64 after_pids = self.adb.ExtractPid(self.options.package_name) 64 after_pids = self.adb.ExtractPid(self.options.package_name)
65 65
66 crashed = (not before_pids or not after_pids 66 crashed = (not before_pids or not after_pids
67 or after_pids[0] != before_pids[0]) 67 or after_pids[0] != before_pids[0])
68 68
69 results = base_test_result.TestRunResults() 69 results = base_test_result.TestRunResults()
70 if 'Monkey finished' in output and not crashed: 70 success_pattern = 'Events injected: %d' % self.options.event_count
71 if success_pattern in output and not crashed:
71 result = base_test_result.BaseTestResult( 72 result = base_test_result.BaseTestResult(
72 test_name, base_test_result.ResultType.PASS, log=output) 73 test_name, base_test_result.ResultType.PASS, log=output)
73 else: 74 else:
74 result = base_test_result.BaseTestResult( 75 result = base_test_result.BaseTestResult(
75 test_name, base_test_result.ResultType.FAIL, log=output) 76 test_name, base_test_result.ResultType.FAIL, log=output)
76 results.AddResult(result) 77 results.AddResult(result)
77 return results, False 78 return results, False
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698