blob: 8eeb62ae5a176a726b5ec064af8f14a70c1340f3 [file] [log] [blame]
// Copyright 2024 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SRC_CONNECTIVITY_BLUETOOTH_CORE_BT_HOST_PUBLIC_PW_BLUETOOTH_SAPPHIRE_INTERNAL_HOST_TESTING_LOOP_FIXTURE_H_
#define SRC_CONNECTIVITY_BLUETOOTH_CORE_BT_HOST_PUBLIC_PW_BLUETOOTH_SAPPHIRE_INTERNAL_HOST_TESTING_LOOP_FIXTURE_H_
#include <lib/async-testing/test_loop.h>
#include <gtest/gtest.h>
namespace bt::testing {
class TestLoopFixture : public ::testing::Test {
public:
async_dispatcher_t* dispatcher() { return loop_.dispatcher(); }
void RunLoopUntilIdle() { loop_.RunUntilIdle(); }
void RunLoopFor(zx::duration duration) { loop_.RunFor(duration); }
private:
async::TestLoop loop_;
};
} // namespace bt::testing
#endif // SRC_CONNECTIVITY_BLUETOOTH_CORE_BT_HOST_PUBLIC_PW_BLUETOOTH_SAPPHIRE_INTERNAL_HOST_TESTING_LOOP_FIXTURE_H_