OLD | NEW |
1 # Copyright (C) 2011 Google Inc. All rights reserved. | 1 # Copyright (C) 2011 Google Inc. All rights reserved. |
2 # | 2 # |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions | 4 # modification, are permitted provided that the following conditions |
5 # are met: | 5 # are met: |
6 # | 6 # |
7 # 1. Redistributions of source code must retain the above copyright | 7 # 1. Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # 2. Redistributions in binary form must reproduce the above copyright | 9 # 2. Redistributions in binary form must reproduce the above copyright |
10 # notice, this list of conditions and the following disclaimer in the | 10 # notice, this list of conditions and the following disclaimer in the |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 System Profile: | 61 System Profile: |
62 Model: Xserve3,1, BootROM XS31.0081.B04, 8 processors, Quad-Core Intel Xeon, 2.2
6 GHz, 6 GB, SMC 1.43f4 | 62 Model: Xserve3,1, BootROM XS31.0081.B04, 8 processors, Quad-Core Intel Xeon, 2.2
6 GHz, 6 GB, SMC 1.43f4 |
63 Graphics: NVIDIA GeForce GT 120, NVIDIA GeForce GT 120, PCIe, 256 MB | 63 Graphics: NVIDIA GeForce GT 120, NVIDIA GeForce GT 120, PCIe, 256 MB |
64 Memory Module: global_name | 64 Memory Module: global_name |
65 Network Service: Ethernet 2, Ethernet, en1 | 65 Network Service: Ethernet 2, Ethernet, en1 |
66 PCI Card: NVIDIA GeForce GT 120, sppci_displaycontroller, MXM-Slot | 66 PCI Card: NVIDIA GeForce GT 120, sppci_displaycontroller, MXM-Slot |
67 Serial ATA Device: OPTIARC DVD RW AD-5670S | 67 Serial ATA Device: OPTIARC DVD RW AD-5670S |
68 """.format(process_name=process_name, pid=pid) | 68 """.format(process_name=process_name, pid=pid) |
69 | 69 |
| 70 |
70 class CrashLogsTest(unittest.TestCase): | 71 class CrashLogsTest(unittest.TestCase): |
| 72 |
71 def test_find_log_darwin(self): | 73 def test_find_log_darwin(self): |
72 if not SystemHost().platform.is_mac(): | 74 if not SystemHost().platform.is_mac(): |
73 return | 75 return |
74 | 76 |
75 older_mock_crash_report = make_mock_crash_report_darwin('DumpRenderTree'
, 28528) | 77 older_mock_crash_report = make_mock_crash_report_darwin('DumpRenderTree'
, 28528) |
76 mock_crash_report = make_mock_crash_report_darwin('DumpRenderTree', 2853
0) | 78 mock_crash_report = make_mock_crash_report_darwin('DumpRenderTree', 2853
0) |
77 newer_mock_crash_report = make_mock_crash_report_darwin('DumpRenderTree'
, 28529) | 79 newer_mock_crash_report = make_mock_crash_report_darwin('DumpRenderTree'
, 28529) |
78 other_process_mock_crash_report = make_mock_crash_report_darwin('FooProc
ess', 28527) | 80 other_process_mock_crash_report = make_mock_crash_report_darwin('FooProc
ess', 28527) |
79 misformatted_mock_crash_report = 'Junk that should not appear in a crash
report' + make_mock_crash_report_darwin('DumpRenderTree', 28526)[200:] | 81 misformatted_mock_crash_report = 'Junk that should not appear in a crash
report' + \ |
| 82 make_mock_crash_report_darwin('DumpRenderTree', 28526)[200:] |
80 files = {} | 83 files = {} |
81 files['/Users/mock/Library/Logs/DiagnosticReports/DumpRenderTree_2011-06
-13-150718_quadzen.crash'] = older_mock_crash_report | 84 files['/Users/mock/Library/Logs/DiagnosticReports/DumpRenderTree_2011-06
-13-150718_quadzen.crash'] = older_mock_crash_report |
82 files['/Users/mock/Library/Logs/DiagnosticReports/DumpRenderTree_2011-06
-13-150719_quadzen.crash'] = mock_crash_report | 85 files['/Users/mock/Library/Logs/DiagnosticReports/DumpRenderTree_2011-06
-13-150719_quadzen.crash'] = mock_crash_report |
83 files['/Users/mock/Library/Logs/DiagnosticReports/DumpRenderTree_2011-06
-13-150720_quadzen.crash'] = newer_mock_crash_report | 86 files['/Users/mock/Library/Logs/DiagnosticReports/DumpRenderTree_2011-06
-13-150720_quadzen.crash'] = newer_mock_crash_report |
84 files['/Users/mock/Library/Logs/DiagnosticReports/DumpRenderTree_2011-06
-13-150721_quadzen.crash'] = None | 87 files['/Users/mock/Library/Logs/DiagnosticReports/DumpRenderTree_2011-06
-13-150721_quadzen.crash'] = None |
85 files['/Users/mock/Library/Logs/DiagnosticReports/DumpRenderTree_2011-06
-13-150722_quadzen.crash'] = other_process_mock_crash_report | 88 files['/Users/mock/Library/Logs/DiagnosticReports/DumpRenderTree_2011-06
-13-150722_quadzen.crash'] = other_process_mock_crash_report |
86 files['/Users/mock/Library/Logs/DiagnosticReports/DumpRenderTree_2011-06
-13-150723_quadzen.crash'] = misformatted_mock_crash_report | 89 files['/Users/mock/Library/Logs/DiagnosticReports/DumpRenderTree_2011-06
-13-150723_quadzen.crash'] = misformatted_mock_crash_report |
87 filesystem = MockFileSystem(files) | 90 filesystem = MockFileSystem(files) |
88 crash_logs = CrashLogs(MockSystemHost(filesystem=filesystem)) | 91 crash_logs = CrashLogs(MockSystemHost(filesystem=filesystem)) |
89 log = crash_logs.find_newest_log("DumpRenderTree") | 92 log = crash_logs.find_newest_log("DumpRenderTree") |
(...skipping 15 matching lines...) Expand all Loading... |
105 | 108 |
106 filesystem.read_text_file = bad_read | 109 filesystem.read_text_file = bad_read |
107 log = crash_logs.find_newest_log("DumpRenderTree", 28531, include_errors
=True) | 110 log = crash_logs.find_newest_log("DumpRenderTree", 28531, include_errors
=True) |
108 self.assertIn('IOError: No such file or directory', log) | 111 self.assertIn('IOError: No such file or directory', log) |
109 | 112 |
110 filesystem = MockFileSystem(files) | 113 filesystem = MockFileSystem(files) |
111 crash_logs = CrashLogs(MockSystemHost(filesystem=filesystem)) | 114 crash_logs = CrashLogs(MockSystemHost(filesystem=filesystem)) |
112 filesystem.mtime = bad_mtime | 115 filesystem.mtime = bad_mtime |
113 log = crash_logs.find_newest_log("DumpRenderTree", newer_than=1.0, inclu
de_errors=True) | 116 log = crash_logs.find_newest_log("DumpRenderTree", newer_than=1.0, inclu
de_errors=True) |
114 self.assertIn('OSError: No such file or directory', log) | 117 self.assertIn('OSError: No such file or directory', log) |
OLD | NEW |