OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/python |
| 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. |
| 5 |
| 6 import glob |
| 7 import os |
| 8 |
| 9 import pyauto_functional # Must be imported before pyauto |
| 10 import pyauto |
| 11 import pyauto_utils |
| 12 |
| 13 |
| 14 class CrashReporterTest(pyauto.PyUITest): |
| 15 """TestCase for Crash Reporter.""" |
| 16 |
| 17 def testRendererCrash(self): |
| 18 """Verify renderer's crash reporting. |
| 19 |
| 20 Attempts to crash, and then checks that crash dumps get generated. Does |
| 21 not actually test crash reports on the server. |
| 22 """ |
| 23 # bail out if not a branded build |
| 24 properties = self.GetBrowserInfo()['properties'] |
| 25 if properties['branding'] != 'Google Chrome': |
| 26 return |
| 27 breakpad_folder = properties['DIR_CRASH_DUMPS'] |
| 28 self.assertTrue(breakpad_folder, 'Cannot figure crash dir') |
| 29 |
| 30 unused = pyauto_utils.ExistingPathReplacer(path=breakpad_folder) |
| 31 self.NavigateToURL('about:crash') # Trigger renderer crash |
| 32 dmp_files = glob.glob(os.path.join(breakpad_folder, '*.dmp')) |
| 33 self.assertEqual(1, len(dmp_files)) |
| 34 |
| 35 |
| 36 if __name__ == '__main__': |
| 37 pyauto_functional.Main() |
| 38 |
OLD | NEW |