1 // Copyright 2018 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef BASE_FUCHSIA_SERVICE_DIRECTORY_TEST_BASE_H_
6 #define BASE_FUCHSIA_SERVICE_DIRECTORY_TEST_BASE_H_
8 #include <lib/zx/channel.h>
11 #include "base/fuchsia/scoped_service_binding.h"
12 #include "base/fuchsia/service_directory_client.h"
13 #include "base/fuchsia/test_interface_impl.h"
14 #include "base/fuchsia/testfidl/cpp/fidl.h"
15 #include "base/message_loop/message_loop.h"
16 #include "testing/gtest/include/gtest/gtest.h"
21 class ServiceDirectoryTestBase : public testing::Test {
23 ServiceDirectoryTestBase();
24 ~ServiceDirectoryTestBase() override;
26 void VerifyTestInterface(fidl::InterfacePtr<testfidl::TestInterface>* stub,
27 zx_status_t expected_error);
30 MessageLoopForIO message_loop_;
32 std::unique_ptr<ServiceDirectory> service_directory_;
33 TestInterfaceImpl test_service_;
34 std::unique_ptr<ScopedServiceBinding<testfidl::TestInterface>>
37 std::unique_ptr<ServiceDirectoryClient> public_service_directory_client_;
38 std::unique_ptr<ServiceDirectoryClient> debug_service_directory_client_;
39 std::unique_ptr<ServiceDirectoryClient>
40 legacy_public_service_directory_client_;
41 std::unique_ptr<ServiceDirectoryClient> root_service_directory_client_;
43 DISALLOW_COPY_AND_ASSIGN(ServiceDirectoryTestBase);
46 } // namespace fuchsia
49 #endif // BASE_FUCHSIA_SERVICE_DIRECTORY_TEST_BASE_H_