[Nearby Connections][C++] Wake up keep-alive thread to unblock destruction

PiperOrigin-RevId: 399693890
This commit is contained in:
nohle
2021-09-29 08:39:37 -07:00
committed by Copybara-Service
parent 1f0ec837b6
commit bc8769c64e
7 changed files with 126 additions and 47 deletions
@@ -64,6 +64,7 @@ class MockEndpointChannel : public EndpointChannel {
MOCK_METHOD(void, Pause, (), (override));
MOCK_METHOD(void, Resume, (), (override));
MOCK_METHOD(absl::Time, GetLastReadTimestamp, (), (const override));
MOCK_METHOD(absl::Time, GetLastWriteTimestamp, (), (const override));
MOCK_METHOD(void, SetAnalyticsRecorder,
(analytics::AnalyticsRecorder*, const std::string&), (override));
@@ -108,6 +109,8 @@ class EndpointManagerTest : public ::testing::Test {
EXPECT_CALL(*channel, GetMedium()).WillRepeatedly(Return(Medium::BLE));
EXPECT_CALL(*channel, GetLastReadTimestamp())
.WillRepeatedly(Return(start_time_));
EXPECT_CALL(*channel, GetLastWriteTimestamp())
.WillRepeatedly(Return(start_time_));
EXPECT_CALL(mock_listener_.initiated_cb, Call).Times(1);
em_.RegisterEndpoint(&client_, endpoint_id_, info_, options_,
std::move(channel), listener_, connection_token);