Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2ca5651f authored by Chris Manton's avatar Chris Manton
Browse files

shim: Add sync at completion connection test

Bug: 181991662
Test: gd/cert/run
Tag: #refactor
BYPASS_LONG_LINES_REASON: Bluetooth likes 120 lines

Change-Id: Ib8fadd805da65d24be6dc590ecdb0f4978341ffc
parent 6ecf56d0
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <condition_variable>
#include <future>
#include <map>
#include <thread>

@@ -362,4 +363,11 @@ TEST_F(MainShimTest, connect_and_disconnect) {

  result = rx_disconnect_future.get();
  ASSERT_EQ(123, result);

  // *Our* task completing indicates reactor is done
  std::promise<void> done;
  auto future = done.get_future();
  handler_->Call([](std::promise<void> done) { done.set_value(); },
                 std::move(done));
  future.wait();
}