#include "mojo/public/cpp/bindings/service_factory.h"
#include <optional>
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/run_loop.h"
#include "base/test/bind.h"
#include "base/test/task_environment.h"
#include "mojo/public/cpp/bindings/generic_pending_receiver.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/bindings/tests/service_factory_unittest.test-mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {
namespace test {
namespace service_factory_unittest {
class ServiceFactoryTest : public testing::Test { … };
class TestService1Impl : public mojom::TestService1 { … };
class TestService2Impl : public mojom::TestService2 { … };
int TestService1Impl::num_instances_ = …;
auto RunTestService1(PendingReceiver<mojom::TestService1> receiver) { … }
auto RunTestService2(PendingReceiver<mojom::TestService2> receiver) { … }
TEST_F(ServiceFactoryTest, BasicMatching) { … }
TEST_F(ServiceFactoryTest, DestroyInstanceOnClientDisconnect) { … }
TEST_F(ServiceFactoryTest, DestroyInstanceOnServiceDisconnect) { … }
TEST_F(ServiceFactoryTest, DestroyInstancesOnFactoryDestruction) { … }
}
}
}