Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: snapshot/win/end_to_end_test.py

Issue 1405243002: Fix CRITICAL_SECTION test (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: . Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « handler/win/crashy_test_program.cc ('k') | util/util.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 # Copyright 2015 The Crashpad Authors. All rights reserved. 3 # Copyright 2015 The Crashpad Authors. All rights reserved.
4 # 4 #
5 # Licensed under the Apache License, Version 2.0 (the "License"); 5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License. 6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at 7 # You may obtain a copy of the License at
8 # 8 #
9 # http://www.apache.org/licenses/LICENSE-2.0 9 # http://www.apache.org/licenses/LICENSE-2.0
10 # 10 #
11 # Unless required by applicable law or agreed to in writing, software 11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS, 12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and 14 # See the License for the specific language governing permissions and
15 # limitations under the License. 15 # limitations under the License.
16 16
17 import os 17 import os
18 import platform
18 import random 19 import random
19 import re 20 import re
20 import subprocess 21 import subprocess
21 import sys 22 import sys
22 import tempfile 23 import tempfile
23 24
24 g_temp_dirs = [] 25 g_temp_dirs = []
25 26
26 27
27 def MakeTempDir(): 28 def MakeTempDir():
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 176
176 out = CdbRun(cdb_path, dump_path, '!gle') 177 out = CdbRun(cdb_path, dump_path, '!gle')
177 out.Check('LastErrorValue: \(Win32\) 0x2 \(2\) - The system cannot find the ' 178 out.Check('LastErrorValue: \(Win32\) 0x2 \(2\) - The system cannot find the '
178 'file specified.', '!gle gets last error') 179 'file specified.', '!gle gets last error')
179 out.Check('LastStatusValue: \(NTSTATUS\) 0xc000000f - {File Not Found} The ' 180 out.Check('LastStatusValue: \(NTSTATUS\) 0xc000000f - {File Not Found} The '
180 'file %hs does not exist.', '!gle gets last ntstatus') 181 'file %hs does not exist.', '!gle gets last ntstatus')
181 182
182 out = CdbRun(cdb_path, dump_path, '!locks') 183 out = CdbRun(cdb_path, dump_path, '!locks')
183 out.Check(r'CritSec crashy_program!crashpad::`anonymous namespace\'::' 184 out.Check(r'CritSec crashy_program!crashpad::`anonymous namespace\'::'
184 r'g_test_critical_section', 'lock was captured') 185 r'g_test_critical_section', 'lock was captured')
185 out.Check(r'\*\*\* Locked', 'lock debug info was captured, and is locked') 186 if float(platform.win32_ver()[0]) != 7:
187 # We can't allocate CRITICAL_SECTIONs with .DebugInfo on Win 7.
188 out.Check(r'\*\*\* Locked', 'lock debug info was captured, and is locked')
186 189
187 190
188 def main(args): 191 def main(args):
189 try: 192 try:
190 if len(args) != 1: 193 if len(args) != 1:
191 print >>sys.stderr, 'must supply binary dir' 194 print >>sys.stderr, 'must supply binary dir'
192 return 1 195 return 1
193 196
194 cdb_path = GetCdbPath() 197 cdb_path = GetCdbPath()
195 if not cdb_path: 198 if not cdb_path:
(...skipping 15 matching lines...) Expand all
211 214
212 RunTests(cdb_path, dump_path, pipe_name) 215 RunTests(cdb_path, dump_path, pipe_name)
213 216
214 return 0 217 return 0
215 finally: 218 finally:
216 CleanUpTempDirs() 219 CleanUpTempDirs()
217 220
218 221
219 if __name__ == '__main__': 222 if __name__ == '__main__':
220 sys.exit(main(sys.argv[1:])) 223 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « handler/win/crashy_test_program.cc ('k') | util/util.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698