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

Side by Side Diff: build/android/pylib/instrumentation/instrumentation_test_instance_test.py

Issue 1514453007: Show more stack trace in instrumentation tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Better imports. Created 5 years 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
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/ChromeStrictMode.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 6
7 """Unit tests for instrumentation.TestRunner.""" 7 """Unit tests for instrumentation.TestRunner."""
8 8
9 # pylint: disable=W0212 9 # pylint: disable=W0212
10 10
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 (-2, { 97 (-2, {
98 'class': 'test.package.TestClass', 98 'class': 'test.package.TestClass',
99 'test': 'testMethod', 99 'test': 'testMethod',
100 }), 100 }),
101 ] 101 ]
102 results = instrumentation_test_instance.GenerateTestResults( 102 results = instrumentation_test_instance.GenerateTestResults(
103 None, None, statuses, 0, 1000) 103 None, None, statuses, 0, 1000)
104 self.assertEqual(1, len(results)) 104 self.assertEqual(1, len(results))
105 self.assertEqual(base_test_result.ResultType.FAIL, results[0].GetType()) 105 self.assertEqual(base_test_result.ResultType.FAIL, results[0].GetType())
106 106
107 def testGenerateTestResults_testUnknownException(self):
108 stacktrace = 'long\nstacktrace'
109 statuses = [
110 (1, {
111 'class': 'test.package.TestClass',
112 'test': 'testMethod',
113 }),
114 (-1, {
115 'class': 'test.package.TestClass',
116 'test': 'testMethod',
117 'stack': stacktrace,
118 }),
119 ]
120 results = instrumentation_test_instance.GenerateTestResults(
121 None, None, statuses, 0, 1000)
122 self.assertEqual(1, len(results))
123 self.assertEqual(base_test_result.ResultType.FAIL, results[0].GetType())
124 self.assertEqual(stacktrace, results[0].GetLog())
125
107 126
108 if __name__ == '__main__': 127 if __name__ == '__main__':
109 unittest.main(verbosity=2) 128 unittest.main(verbosity=2)
OLDNEW
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/ChromeStrictMode.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698