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

Unified Diff: third_party/crashpad/crashpad/snapshot/win/end_to_end_test.py

Issue 2804713002: Update Crashpad to b4095401639ebe2ad33169e5c1d994065cbff1b8 (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: third_party/crashpad/crashpad/snapshot/win/end_to_end_test.py
diff --git a/third_party/crashpad/crashpad/snapshot/win/end_to_end_test.py b/third_party/crashpad/crashpad/snapshot/win/end_to_end_test.py
index 42999df8a2bb15f480b0e3fcd64c906789e57b36..5afdac38ab7c43d19d83a5334a59ae66e1bddcf6 100755
--- a/third_party/crashpad/crashpad/snapshot/win/end_to_end_test.py
+++ b/third_party/crashpad/crashpad/snapshot/win/end_to_end_test.py
@@ -22,6 +22,7 @@ import subprocess
import sys
import tempfile
import time
+import win32con
g_temp_dirs = []
@@ -80,23 +81,23 @@ def GetCdbPath():
return None
-def GetDumpFromProgram(out_dir, pipe_name, executable_name, *args):
+def GetDumpFromProgram(
+ out_dir, pipe_name, executable_name, expect_exit_code, *args):
"""Initialize a crash database, and run |executable_name| connecting to a
crash handler. If pipe_name is set, crashpad_handler will be started first. If
pipe_name is empty, the executable is responsible for starting
crashpad_handler. *args will be passed after other arguments to
- executable_name. Returns the minidump generated by crashpad_handler for
- further testing.
+ executable_name. If the child process does not exit with |expect_exit_code|,
+ an exception will be raised. Returns the path to the minidump generated by
+ crashpad_handler for further testing.
"""
test_database = MakeTempDir()
handler = None
try:
- if subprocess.call(
+ subprocess.check_call(
[os.path.join(out_dir, 'crashpad_database_util.exe'), '--create',
- '--database=' + test_database]) != 0:
- print 'could not initialize report database'
- return None
+ '--database=' + test_database])
if pipe_name is not None:
handler = subprocess.Popen([
@@ -113,12 +114,16 @@ def GetDumpFromProgram(out_dir, pipe_name, executable_name, *args):
printed = True
time.sleep(0.1)
- subprocess.call([os.path.join(out_dir, executable_name), pipe_name] +
- list(args))
+ exit_code = subprocess.call(
+ [os.path.join(out_dir, executable_name), pipe_name] + list(args))
else:
- subprocess.call([os.path.join(out_dir, executable_name),
- os.path.join(out_dir, 'crashpad_handler.com'),
- test_database] + list(args))
+ exit_code = subprocess.call(
+ [os.path.join(out_dir, executable_name),
+ os.path.join(out_dir, 'crashpad_handler.com'),
+ test_database] +
+ list(args))
+ if exit_code != expect_exit_code:
+ raise CalledProcessError(exit_code, executable_name)
out = subprocess.check_output([
os.path.join(out_dir, 'crashpad_database_util.exe'),
@@ -135,24 +140,38 @@ def GetDumpFromProgram(out_dir, pipe_name, executable_name, *args):
def GetDumpFromCrashyProgram(out_dir, pipe_name):
- return GetDumpFromProgram(out_dir, pipe_name, 'crashy_program.exe')
+ return GetDumpFromProgram(out_dir,
+ pipe_name,
+ 'crashy_program.exe',
+ win32con.EXCEPTION_ACCESS_VIOLATION)
def GetDumpFromOtherProgram(out_dir, pipe_name, *args):
- return GetDumpFromProgram(out_dir, pipe_name, 'crash_other_program.exe',
- *args)
+ return GetDumpFromProgram(
+ out_dir, pipe_name, 'crash_other_program.exe', 0, *args)
def GetDumpFromSignal(out_dir, pipe_name, *args):
- return GetDumpFromProgram(out_dir, pipe_name, 'crashy_signal.exe', *args)
+ STATUS_FATAL_APP_EXIT = 0x40000015 # Not known by win32con.
+ return GetDumpFromProgram(out_dir,
+ pipe_name,
+ 'crashy_signal.exe',
+ STATUS_FATAL_APP_EXIT,
+ *args)
def GetDumpFromSelfDestroyingProgram(out_dir, pipe_name):
- return GetDumpFromProgram(out_dir, pipe_name, 'self_destroying_program.exe')
+ return GetDumpFromProgram(out_dir,
+ pipe_name,
+ 'self_destroying_program.exe',
+ win32con.EXCEPTION_BREAKPOINT)
def GetDumpFromZ7Program(out_dir, pipe_name):
- return GetDumpFromProgram(out_dir, pipe_name, 'crashy_z7_loader.exe')
+ return GetDumpFromProgram(out_dir,
+ pipe_name,
+ 'crashy_z7_loader.exe',
+ win32con.EXCEPTION_ACCESS_VIOLATION)
class CdbRun(object):

Powered by Google App Engine
This is Rietveld 408576698