mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-09 14:06:33 +00:00
win: Wrap test::ChildLauncher::Start() in ASSERT_NO_FATAL_FAILURE()
Test: crashpad_snapshot_test, crashpad_util_test, end_to_end_test Change-Id: I09581521678fe3b083c409f308eeab2e583b3c9f Reviewed-on: https://chromium-review.googlesource.com/481245 Commit-Queue: Mark Mentovai <mark@chromium.org> Reviewed-by: Scott Graham <scottmg@chromium.org>
This commit is contained in:
parent
e04194afd9
commit
74fddc3fed
@ -147,6 +147,7 @@
|
||||
'dependencies': [
|
||||
'../client/client.gyp:crashpad_client',
|
||||
'../test/test.gyp:crashpad_test',
|
||||
'../third_party/gtest/gtest.gyp:gtest',
|
||||
'../third_party/mini_chromium/mini_chromium.gyp:base',
|
||||
'../util/util.gyp:crashpad_util',
|
||||
],
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "base/logging.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "client/crashpad_client.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "test/test_paths.h"
|
||||
#include "test/win/child_launcher.h"
|
||||
#include "util/file/file_io.h"
|
||||
@ -93,6 +94,10 @@ int CrashOtherProgram(int argc, wchar_t* argv[]) {
|
||||
test_executable.DirName().Append(L"hanging_program.exe").value();
|
||||
ChildLauncher child(child_test_executable, argv[1]);
|
||||
child.Start();
|
||||
if (testing::Test::HasFatalFailure()) {
|
||||
LOG(ERROR) << "failed to start child";
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
// Wait until it's ready.
|
||||
char c;
|
||||
|
@ -148,7 +148,7 @@ void TestCrashingChild(const base::string16& directory_modification) {
|
||||
L"_crashing_child.exe")
|
||||
.value();
|
||||
ChildLauncher child(child_test_executable, pipe_name);
|
||||
child.Start();
|
||||
ASSERT_NO_FATAL_FAILURE(child.Start());
|
||||
|
||||
// The child tells us (approximately) where it will crash.
|
||||
WinVMAddress break_near_address;
|
||||
@ -256,7 +256,7 @@ void TestDumpWithoutCrashingChild(
|
||||
L"_dump_without_crashing.exe")
|
||||
.value();
|
||||
ChildLauncher child(child_test_executable, pipe_name);
|
||||
child.Start();
|
||||
ASSERT_NO_FATAL_FAILURE(child.Start());
|
||||
|
||||
// The child tells us (approximately) where it will capture a dump.
|
||||
WinVMAddress dump_near_address;
|
||||
|
@ -53,7 +53,7 @@ void TestExtraMemoryRanges(TestType type,
|
||||
L"_extra_memory_ranges.exe")
|
||||
.value();
|
||||
ChildLauncher child(child_test_executable, L"");
|
||||
child.Start();
|
||||
ASSERT_NO_FATAL_FAILURE(child.Start());
|
||||
|
||||
// Wait for the child process to indicate that it's done setting up its
|
||||
// annotations via the CrashpadInfo interface.
|
||||
|
@ -57,7 +57,7 @@ void TestAnnotationsOnCrash(TestType type,
|
||||
L"_simple_annotations.exe")
|
||||
.value();
|
||||
ChildLauncher child(child_test_executable, L"");
|
||||
child.Start();
|
||||
ASSERT_NO_FATAL_FAILURE(child.Start());
|
||||
|
||||
// Wait for the child process to indicate that it's done setting up its
|
||||
// annotations via the CrashpadInfo interface.
|
||||
|
@ -46,7 +46,7 @@ void TestImageReaderChild(const base::string16& directory_modification) {
|
||||
L"_image_reader.exe")
|
||||
.value();
|
||||
ChildLauncher child(child_test_executable, done_uuid.ToString16());
|
||||
child.Start();
|
||||
ASSERT_NO_FATAL_FAILURE(child.Start());
|
||||
|
||||
char c;
|
||||
ASSERT_TRUE(
|
||||
|
@ -39,6 +39,9 @@ class ChildLauncher {
|
||||
|
||||
//! \brief Starts the child process, after which the handle functions below
|
||||
//! will be valid.
|
||||
//!
|
||||
//! Errors are signaled via gtest assertions. This method may be invoked via
|
||||
//! `ASSERT_NO_FATAL_FAILURE()` to assert that it succeeds.
|
||||
void Start();
|
||||
|
||||
//! \brief Waits for the child process to exit.
|
||||
|
@ -151,7 +151,7 @@ void TestOtherProcess(const base::string16& directory_modification) {
|
||||
AppendCommandLineArgument(done_uuid.ToString16(), &args);
|
||||
|
||||
ChildLauncher child(child_test_executable, args);
|
||||
child.Start();
|
||||
ASSERT_NO_FATAL_FAILURE(child.Start());
|
||||
|
||||
// The child sends us a code address we can look up in the memory map.
|
||||
WinVMAddress code_address;
|
||||
|
Loading…
x
Reference in New Issue
Block a user