mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-09 22:26:06 +00:00
LogOutputStreamTest.{WriteAbort,FlushAbort} are flaky because the logcat is sometimes overloaded earlier than expected causing FlushAbort to fail during Write() or either test to fail to write the abort message. This change updates LogOutputStream to detect logcat overloads (EAGAIN) and make one attempt at writing the abort message, even if the output cap hasn't been reached. This change also updates LogOutputStream's interface to defer log writes to a Delegate. In tests, the Delegate implements a mock log and in production, writes to Android's logcat. I've removed VerifyGuards because LogOutputStream no longer writes guards if Write() has never been called and the guards are tested in other tests. Change-Id: Icad83524aaf573c3e082469f1de095b6ca2c4839 Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2439641 Reviewed-by: Mark Mentovai <mark@chromium.org>