| 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 25 matching lines...) Expand all Loading... |
| 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'] | 40 breakpad_folder = properties['DIR_CRASH_DUMPS'] |
| 41 old_dmp_files = glob.glob(os.path.join(breakpad_folder, '*.dmp')) | 41 old_dmp_files = glob.glob(os.path.join(breakpad_folder, '*.dmp')) |
| 42 pdf_files_path = os.path.join(self.DataDir(), 'pyauto_private', 'pdf') | 42 pdf_files_path = os.path.join(self.DataDir(), 'pyauto_private', 'pdf') |
| 43 pdf_files = glob.glob(os.path.join(pdf_files_path, '*.pdf')) | 43 pdf_files = glob.glob(os.path.join(pdf_files_path, '*.pdf')) |
| 44 # Add a pdf file over http:// to the list of pdf files. | 44 # Add a pdf file over http:// to the list of pdf files. |
| 45 # crbug.com/70454 | 45 # crbug.com/70454 |
| 46 pdf_files += ['http://www.irs.gov/pub/irs-pdf/fw4.pdf'] | 46 pdf_files += ['http://www.irs.gov/pub/irs-pdf/fw9.pdf'] |
| 47 for pdf_file in pdf_files: | 47 for pdf_file in pdf_files: |
| 48 # Some pdfs cause known crashes. Exclude them. crbug.com/63549 | 48 # Some pdfs cause known crashes. Exclude them. crbug.com/63549 |
| 49 if os.path.basename(pdf_file) in ('nullip.pdf', 'sample.pdf'): | 49 # crbug.com/70811 |
| 50 if os.path.basename(pdf_file) in ('nullip.pdf', 'sample.pdf', 'fw4.pdf'): |
| 50 continue | 51 continue |
| 51 url = self.GetFileURLForPath(pdf_file) | 52 url = self.GetFileURLForPath(pdf_file) |
| 52 self.AppendTab(pyauto.GURL(url)) | 53 self.AppendTab(pyauto.GURL(url)) |
| 53 for tab_index in range(1, len(pdf_files) + 1): | 54 for tab_index in range(1, len(pdf_files) + 1): |
| 54 self.ActivateTab(tab_index) | 55 self.ActivateTab(tab_index) |
| 55 self._PerformPDFAction('fitToHeight', tab_index=tab_index) | 56 self._PerformPDFAction('fitToHeight', tab_index=tab_index) |
| 56 self._PerformPDFAction('fitToWidth', tab_index=tab_index) | 57 self._PerformPDFAction('fitToWidth', tab_index=tab_index) |
| 57 # Assert that there is at least 1 browser window. | 58 # Assert that there is at least 1 browser window. |
| 58 self.assertTrue(self.GetBrowserWindowCount(), | 59 self.assertTrue(self.GetBrowserWindowCount(), |
| 59 'Browser crashed, no window is open') | 60 'Browser crashed, no window is open') |
| 60 # Verify there're no crash dump files | 61 # Verify there're no crash dump files |
| 61 for dmp_file in glob.glob(os.path.join(breakpad_folder, '*.dmp')): | 62 for dmp_file in glob.glob(os.path.join(breakpad_folder, '*.dmp')): |
| 62 self.assertTrue(dmp_file in old_dmp_files, | 63 self.assertTrue(dmp_file in old_dmp_files, |
| 63 msg='Crash dump %s found' % dmp_file) | 64 msg='Crash dump %s found' % dmp_file) |
| 64 | 65 |
| 65 | 66 |
| 66 if __name__ == '__main__': | 67 if __name__ == '__main__': |
| 67 pyauto_functional.Main() | 68 pyauto_functional.Main() |
| OLD | NEW |