Googletest export

Migrate ZX_WAIT_ASYNC_REPEATING to ZX_WAIT_ASYNC_ONCE

ZX_WAIT_ASYNC_REPEATING is deprecated so convert code to use
ZX_WAIT_ASYNC_ONCE instead.

PiperOrigin-RevId: 243707147
This commit is contained in:
Abseil Team 2019-04-15 19:08:09 -04:00 committed by Alex Strelnikov
parent 39f72ea6f5
commit 6d66818066

View File

@ -888,7 +888,7 @@ int FuchsiaDeathTest::Wait() {
// Register to wait for the socket to be readable or closed.
status_zx = stderr_socket_.wait_async(
port_, kSocketKey, ZX_SOCKET_READABLE | ZX_SOCKET_PEER_CLOSED,
ZX_WAIT_ASYNC_REPEATING);
ZX_WAIT_ASYNC_ONCE);
GTEST_DEATH_TEST_CHECK_(status_zx == ZX_OK);
bool process_terminated = false;
@ -912,7 +912,7 @@ int FuchsiaDeathTest::Wait() {
process_terminated = true;
}
} else if (packet.key == kSocketKey) {
GTEST_DEATH_TEST_CHECK_(ZX_PKT_IS_SIGNAL_REP(packet.type));
GTEST_DEATH_TEST_CHECK_(ZX_PKT_IS_SIGNAL_ONE(packet.type));
if (packet.signal.observed & ZX_SOCKET_READABLE) {
// Read data from the socket.
constexpr size_t kBufferSize = 1024;
@ -929,6 +929,10 @@ int FuchsiaDeathTest::Wait() {
socket_closed = true;
} else {
GTEST_DEATH_TEST_CHECK_(status_zx == ZX_ERR_SHOULD_WAIT);
status_zx = stderr_socket_.wait_async(
port_, kSocketKey, ZX_SOCKET_READABLE | ZX_SOCKET_PEER_CLOSED,
ZX_WAIT_ASYNC_ONCE);
GTEST_DEATH_TEST_CHECK_(status_zx == ZX_OK);
}
} else {
GTEST_DEATH_TEST_CHECK_(packet.signal.observed & ZX_SOCKET_PEER_CLOSED);