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

Unified Diff: test/win/win_multiprocess_test.cc

Issue 1164683005: win: fix uncaught multiprocess child test failures (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: 0 -> EXIT_SUCCESS Created 5 years, 7 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
« no previous file with comments | « test/win/win_multiprocess.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/win/win_multiprocess_test.cc
diff --git a/test/win/win_multiprocess_test.cc b/test/win/win_multiprocess_test.cc
index 51f8b98a2e9b7de4fbd07a6445b465fe730b9927..eaf3d66953872c4f8d5f77a708bb5bad7527efac 100644
--- a/test/win/win_multiprocess_test.cc
+++ b/test/win/win_multiprocess_test.cc
@@ -41,6 +41,36 @@ class TestWinMultiprocess final : public WinMultiprocess {
DISALLOW_COPY_AND_ASSIGN(TestWinMultiprocess);
};
+enum class FailureType {
+ kExpect,
+ kAssert,
+};
+
+class TestWinMultiprocessChildFails final : public WinMultiprocess {
+ public:
+ explicit TestWinMultiprocessChildFails(FailureType failure_type)
+ : WinMultiprocess(), failure_type_(failure_type) {}
+ ~TestWinMultiprocessChildFails() {}
+
+ private:
+ void WinMultiprocessParent() override {}
+ void WinMultiprocessChild() override {
+ switch (failure_type_) {
+ case FailureType::kExpect:
+ EXPECT_FALSE(true);
+ break;
+ case FailureType::kAssert:
+ ASSERT_FALSE(true);
+ break;
+ }
+ }
+
+ FailureType failure_type_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestWinMultiprocessChildFails);
+};
+
+
TEST(WinMultiprocess, WinMultiprocess) {
TestWinMultiprocess win_multiprocess(0);
win_multiprocess.Run();
@@ -52,6 +82,20 @@ TEST(WinMultiprocess, WinMultiprocessNonSuccessExitCode) {
win_multiprocess.Run();
}
+TEST(WinMultiprocessChildFails, ChildExpectFailure) {
+ TestWinMultiprocessChildFails multiprocess_failing_child(
+ FailureType::kExpect);
+ multiprocess_failing_child.SetExpectedChildExitCode(255);
+ multiprocess_failing_child.Run();
+}
+
+TEST(WinMultiprocessChildFails, ChildAssertFailure) {
+ TestWinMultiprocessChildFails multiprocess_failing_child(
+ FailureType::kAssert);
+ multiprocess_failing_child.SetExpectedChildExitCode(255);
+ multiprocess_failing_child.Run();
+}
+
} // namespace
} // namespace test
} // namespace crashpad
« no previous file with comments | « test/win/win_multiprocess.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698