OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 import tempfile | 5 import tempfile |
6 import os | 6 import os |
7 | 7 |
8 from telemetry.core import exceptions | 8 from telemetry.core import exceptions |
9 from telemetry import decorators | 9 from telemetry import decorators |
10 from telemetry.testing import tab_test_case | 10 from telemetry.testing import tab_test_case |
(...skipping 18 matching lines...) Expand all Loading... |
29 self._tab.Navigate('chrome://crash', timeout=5) | 29 self._tab.Navigate('chrome://crash', timeout=5) |
30 self.assertIn('CrashIntentionally', '\n'.join(c.exception.stack_trace)) | 30 self.assertIn('CrashIntentionally', '\n'.join(c.exception.stack_trace)) |
31 | 31 |
32 # Some platforms do not support full stack traces, this test requires only | 32 # Some platforms do not support full stack traces, this test requires only |
33 # minimal symbols to be available. | 33 # minimal symbols to be available. |
34 @decorators.Enabled('mac', 'linux', 'win') | 34 @decorators.Enabled('mac', 'linux', 'win') |
35 @decorators.Disabled('snowleopard') | 35 @decorators.Disabled('snowleopard') |
36 def testCrashMinimalSymbols(self): | 36 def testCrashMinimalSymbols(self): |
37 with self.assertRaises(exceptions.DevtoolsTargetCrashException) as c: | 37 with self.assertRaises(exceptions.DevtoolsTargetCrashException) as c: |
38 self._tab.Navigate('chrome://crash', timeout=5) | 38 self._tab.Navigate('chrome://crash', timeout=5) |
39 self.assertIn('OnNavigate', '\n'.join(c.exception.stack_trace)) | 39 self.assertIn('PrepareRenderViewForNavigation', |
| 40 '\n'.join(c.exception.stack_trace)) |
40 | 41 |
41 # The breakpad file specific test only apply to platforms which use the | 42 # The breakpad file specific test only apply to platforms which use the |
42 # breakpad symbol format. This also must be tested in isolation because it can | 43 # breakpad symbol format. This also must be tested in isolation because it can |
43 # potentially interfere with other tests symbol parsing. | 44 # potentially interfere with other tests symbol parsing. |
44 @decorators.Enabled('mac', 'linux') | 45 @decorators.Enabled('mac', 'linux') |
45 @decorators.Isolated | 46 @decorators.Isolated |
46 def testBadBreakpadFileIgnored(self): | 47 def testBadBreakpadFileIgnored(self): |
47 # pylint: disable=protected-access | 48 # pylint: disable=protected-access |
48 executable_path = self._browser._browser_backend._executable | 49 executable_path = self._browser._browser_backend._executable |
49 executable = os.path.basename(executable_path) | 50 executable = os.path.basename(executable_path) |
(...skipping 10 matching lines...) Expand all Loading... |
60 tmp_dir = os.path.join(self._browser._browser_backend._tmp_minidump_dir) | 61 tmp_dir = os.path.join(self._browser._browser_backend._tmp_minidump_dir) |
61 symbol_dir = os.path.join(tmp_dir, 'symbols') | 62 symbol_dir = os.path.join(tmp_dir, 'symbols') |
62 self.assertTrue(os.path.isdir(symbol_dir)) | 63 self.assertTrue(os.path.isdir(symbol_dir)) |
63 | 64 |
64 # Bad breakpad file should not be in the symbol directory | 65 # Bad breakpad file should not be in the symbol directory |
65 garbage_symbol_dir = os.path.join(symbol_dir, executable, garbage_hash) | 66 garbage_symbol_dir = os.path.join(symbol_dir, executable, garbage_hash) |
66 self.assertFalse(os.path.isdir(garbage_symbol_dir)) | 67 self.assertFalse(os.path.isdir(garbage_symbol_dir)) |
67 | 68 |
68 # Stack trace should still work. | 69 # Stack trace should still work. |
69 self.assertIn('CrashIntentionally', '\n'.join(c.exception.stack_trace)) | 70 self.assertIn('CrashIntentionally', '\n'.join(c.exception.stack_trace)) |
OLD | NEW |