From c21292dd71ee69c1a0756e5ef8474b621996be06 Mon Sep 17 00:00:00 2001 From: Justin Cohen Date: Thu, 16 Mar 2023 23:10:08 -0400 Subject: [PATCH] Fix iOS test with libc++ exception throw change. After https://reviews.llvm.org/D141222 exceptions call into __libcpp_verbose_abort, which Chromium sets to `brk 0` in release. Bug: 1425429 Change-Id: Ie00d1317bb03fcb1f15fb5c41ab69640dfb564b7 Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4347775 Reviewed-by: Robert Sesek Commit-Queue: Justin Cohen --- test/ios/BUILD.gn | 6 +++++- test/ios/crash_type_xctest.mm | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/test/ios/BUILD.gn b/test/ios/BUILD.gn index c17f461c..6e4195ad 100644 --- a/test/ios/BUILD.gn +++ b/test/ios/BUILD.gn @@ -66,7 +66,11 @@ source_set("google_test_setup") { source_set("xcuitests") { testonly = true sources = [ "crash_type_xctest.mm" ] - configs += [ "../..:crashpad_config" ] + configs += [ + "../..:crashpad_config", + "../../build:crashpad_is_in_chromium", + ] + deps = [ "../../build:ios_enable_arc", "../../build:ios_xctest", diff --git a/test/ios/crash_type_xctest.mm b/test/ios/crash_type_xctest.mm index c1d2433e..d73d359f 100644 --- a/test/ios/crash_type_xctest.mm +++ b/test/ios/crash_type_xctest.mm @@ -150,10 +150,16 @@ - (void)testException { [rootObject_ crashException]; + // After https://reviews.llvm.org/D141222 exceptions call + // __libcpp_verbose_abort, which Chromium sets to `brk 0` in release. +#if defined(CRASHPAD_IS_IN_CHROMIUM) && defined(NDEBUG) + [self verifyCrashReportException:SIGABRT]; +#else [self verifyCrashReportException:EXC_SOFT_SIGNAL]; NSNumber* report_exception; XCTAssertTrue([rootObject_ pendingReportExceptionInfo:&report_exception]); XCTAssertEqual(report_exception.intValue, SIGABRT); +#endif } - (void)testNSException {