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

Unified Diff: tools/perf/core/stacktrace_unittest.py

Issue 1880333002: Use is_valid_dump to check for valid dumps in telemetry exceptions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable windows for testValidDump Created 4 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 | « components/crash/content/tools/generate_breakpad_symbols.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/core/stacktrace_unittest.py
diff --git a/tools/perf/core/stacktrace_unittest.py b/tools/perf/core/stacktrace_unittest.py
index 3c53929331ce7350b4a8abd41cdcdea8fa49610b..856e954c706a12e9a23b49a01385f8f323595980 100644
--- a/tools/perf/core/stacktrace_unittest.py
+++ b/tools/perf/core/stacktrace_unittest.py
@@ -12,26 +12,24 @@ from telemetry.testing import tab_test_case
class TabStackTraceTest(tab_test_case.TabTestCase):
- # TODO(dyen): For now this doesn't work on Android but continue to
- # expand this.
- # TODO(kbr): currently failing on Windows because the symbolized
- # stack trace format is unexpected. http://crbug.com/561763
- @decorators.Enabled('mac', 'linux')
# Stack traces do not currently work on 10.6, but they are also being
# disabled shortly so just disable it for now.
- @decorators.Disabled('snowleopard')
- def testStackTrace(self):
+ # All platforms except chromeos should at least have a valid minidump.
+ # TODO(dyen): Investigate why crashpad_database_util is not being included.
+ @decorators.Disabled('snowleopard', 'chromeos', 'win')
+ def testValidDump(self):
with self.assertRaises(exceptions.DevtoolsTargetCrashException) as c:
self._tab.Navigate('chrome://crash', timeout=5)
- self.assertIn('Thread 0 (crashed)', '\n'.join(c.exception.stack_trace))
+ self.assertTrue(c.exception.is_valid_dump)
# Stack traces aren't working on Android yet.
- @decorators.Enabled('mac', 'linux', 'win')
+ # TODO(dyen): Investigate why windows is crashing in mojo.
+ @decorators.Enabled('mac', 'linux')
@decorators.Disabled('snowleopard')
def testCrashSymbols(self):
with self.assertRaises(exceptions.DevtoolsTargetCrashException) as c:
self._tab.Navigate('chrome://crash', timeout=5)
- self.assertIn('CrashIntentionally', '\n'.join(c.exception.stack_trace))
+ self.assertIn('CrashIntentionally', '\n'.join(c.exception.stack_trace))
# The breakpad file specific test only apply to platforms which use the
# breakpad symbol format. This also must be tested in isolation because it can
@@ -46,19 +44,19 @@ class TabStackTraceTest(tab_test_case.TabTestCase):
dir=os.path.dirname(executable_path),
prefix=executable + '.breakpad',
delete=True) as f:
- f.write('Garbage Data 012345')
+ garbage_hash = 'ABCDEF1234567'
+ f.write('MODULE PLATFORM ARCH %s %s' % (garbage_hash, executable))
f.flush()
with self.assertRaises(exceptions.DevtoolsTargetCrashException) as c:
self._tab.Navigate('chrome://crash', timeout=5)
- # The symbol directory should now contain our breakpad file.
- tmp_dir = os.path.join(self._browser._browser_backend._tmp_minidump_dir)
-
- # Symbol directory should have been created.
- symbol_dir = os.path.join(tmp_dir, 'symbols', executable)
- self.assertTrue(os.path.isdir(symbol_dir))
+ # The symbol directory should now symbols for out executable.
+ tmp_dir = os.path.join(self._browser._browser_backend._tmp_minidump_dir)
+ symbol_dir = os.path.join(tmp_dir, 'symbols')
+ self.assertTrue(os.path.isdir(symbol_dir))
- # A single symbol file should still exist here.
- self.assertEqual(1, len(os.listdir(symbol_dir)))
+ # Bad breakpad file should not be in the symbol directory
+ garbage_symbol_dir = os.path.join(symbol_dir, executable, garbage_hash)
+ self.assertFalse(os.path.isdir(garbage_symbol_dir))
- # Stack trace should still work.
- self.assertIn('CrashIntentionally', '\n'.join(c.exception.stack_trace))
+ # Stack trace should still work.
+ self.assertIn('CrashIntentionally', '\n'.join(c.exception.stack_trace))
« no previous file with comments | « components/crash/content/tools/generate_breakpad_symbols.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698