OLD | NEW |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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 import os | 6 import os |
7 import glob | 7 import glob |
8 | 8 |
9 import pyauto_functional # Must be imported before pyauto | 9 import pyauto_functional # Must be imported before pyauto |
10 import pyauto | 10 import pyauto |
(...skipping 19 matching lines...) Expand all Loading... | |
30 # (or else it hangs) | 30 # (or else it hangs) |
31 return self.GetDOMValue('%s + ""' % js, 0, tab_index) | 31 return self.GetDOMValue('%s + ""' % js, 0, tab_index) |
32 | 32 |
33 | 33 |
34 def testPDFRunner(self): | 34 def testPDFRunner(self): |
35 """Navigate to pdf files and verify that browser doesn't crash""" | 35 """Navigate to pdf files and verify that browser doesn't crash""" |
36 # bail out if not a branded build | 36 # bail out if not a branded build |
37 properties = self.GetBrowserInfo()['properties'] | 37 properties = self.GetBrowserInfo()['properties'] |
38 if properties['branding'] != 'Google Chrome': | 38 if properties['branding'] != 'Google Chrome': |
39 return | 39 return |
40 breakpad_folder = properties['DIR_CRASH_DUMPS'] | |
41 old_dmp_files = glob.glob(os.path.join(breakpad_folder, '*.dmp')) | |
40 pdf_files_path = os.path.join(self.DataDir(), 'pyauto_private', 'pdf') | 42 pdf_files_path = os.path.join(self.DataDir(), 'pyauto_private', 'pdf') |
41 pdf_files = glob.glob(os.path.join(pdf_files_path, '*.pdf')) | 43 pdf_files = glob.glob(os.path.join(pdf_files_path, '*.pdf')) |
42 for pdf_file in pdf_files: | 44 for pdf_file in pdf_files: |
43 # Some pdfs cause known crashes. Exclude them. crbug.com/63549 | 45 # Some pdfs cause known crashes. Exclude them. crbug.com/63549 |
44 if os.path.basename(pdf_file) in ('nullip.pdf', 'sample.pdf'): | 46 if os.path.basename(pdf_file) in ('nullip.pdf', 'sample.pdf'): |
45 continue | 47 continue |
46 url = self.GetFileURLForPath(pdf_file) | 48 url = self.GetFileURLForPath(pdf_file) |
47 self.AppendTab(pyauto.GURL(url)) | 49 self.AppendTab(pyauto.GURL(url)) |
48 for tab_index in range(1, len(pdf_files) + 1): | 50 for tab_index in range(1, len(pdf_files) + 1): |
49 self.ActivateTab(tab_index) | 51 self.ActivateTab(tab_index) |
50 self._PerformPDFAction('fitToHeight', tab_index=tab_index) | 52 self._PerformPDFAction('fitToHeight', tab_index=tab_index) |
51 self._PerformPDFAction('fitToWidth', tab_index=tab_index) | 53 self._PerformPDFAction('fitToWidth', tab_index=tab_index) |
52 # Assert that there is at least 1 browser window. | 54 # Assert that there is at least 1 browser window. |
53 self.assertTrue(self.GetBrowserWindowCount(), | 55 self.assertTrue(self.GetBrowserWindowCount(), |
54 'Browser crashed, no window is open') | 56 'Browser crashed, no window is open') |
57 # Verify there're no crash dump files | |
58 for dmp_file in glob.glob(os.path.join(breakpad_folder, '*.dmp')): | |
59 self.assertTrue(dmp_file in old_dmp_files, | |
60 msg='Crash dump %s found' % dmp_file) | |
sunandt
2011/01/18 20:04:26
What if there are dump files from old runs or prev
Nirnimesh
2011/01/18 20:11:48
Which is why I make a copy of old dmp files in lin
| |
55 | 61 |
56 | 62 |
57 if __name__ == '__main__': | 63 if __name__ == '__main__': |
58 pyauto_functional.Main() | 64 pyauto_functional.Main() |
OLD | NEW |