Chromium Code Reviews| 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..cc98937d7c04cffb3d1b004482cf631f3831e4ce 100644 |
| --- a/tools/perf/core/stacktrace_unittest.py |
| +++ b/tools/perf/core/stacktrace_unittest.py |
| @@ -12,18 +12,14 @@ 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. |
| + @decorators.Disabled('snowleopard', 'chromeos') |
| + 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') |
| @@ -31,7 +27,7 @@ class TabStackTraceTest(tab_test_case.TabTestCase): |
| 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 +42,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) |
| + # 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)) |
| - # Symbol directory should have been created. |
| - symbol_dir = os.path.join(tmp_dir, 'symbols', executable) |
| - self.assertTrue(os.path.isdir(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)) |
| - # A single symbol file should still exist here. |
|
nednguyen
2016/04/14 00:35:41
This logic is no longer important to test?
David Yen
2016/04/14 00:38:13
This doesn't work on Mac because the binary with s
|
| - self.assertEqual(1, len(os.listdir(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)) |