[M120 Migration][VD] Enable direct rendering for TVPlus
[platform/framework/web/chromium-efl.git] / components / fuchsia_component_support / mock_realm.h
1 // Copyright 2023 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_FUCHSIA_COMPONENT_SUPPORT_MOCK_REALM_H_
6 #define COMPONENTS_FUCHSIA_COMPONENT_SUPPORT_MOCK_REALM_H_
7
8 #include <fuchsia/component/cpp/fidl_test_base.h>
9
10 #include "base/fuchsia/scoped_service_binding.h"
11 #include "testing/gmock/include/gmock/gmock.h"
12
13 namespace sys {
14 class OutgoingDirectory;
15 }
16
17 namespace fuchsia_component_support {
18
19 // A Mock for tests that wish to validate interactions with
20 // fuchsia.component/Realm.
21 class MockRealm : public fuchsia::component::testing::Realm_TestBase {
22  public:
23   // Publishes the instance in the given outgoing directory.
24   explicit MockRealm(sys::OutgoingDirectory* outgoing);
25   ~MockRealm() override;
26
27   // fuchsia::component::testing::Realm_TestBase:
28   MOCK_METHOD(void,
29               OpenExposedDir,
30               (fuchsia::component::decl::ChildRef child,
31                fidl::InterfaceRequest<fuchsia::io::Directory> exposed_dir,
32                fuchsia::component::Realm::OpenExposedDirCallback callback),
33               (override));
34   MOCK_METHOD(void,
35               CreateChild,
36               (fuchsia::component::decl::CollectionRef collection,
37                fuchsia::component::decl::Child decl,
38                fuchsia::component::CreateChildArgs args,
39                fuchsia::component::Realm::CreateChildCallback callback),
40               (override));
41   MOCK_METHOD(void,
42               DestroyChild,
43               (fuchsia::component::decl::ChildRef child,
44                fuchsia::component::Realm::DestroyChildCallback callback),
45               (override));
46   void NotImplemented_(const std::string& name) override;
47
48  private:
49   base::ScopedServiceBinding<fuchsia::component::Realm> binding_;
50 };
51
52 }  // namespace fuchsia_component_support
53
54 #endif  // COMPONENTS_FUCHSIA_COMPONENT_SUPPORT_MOCK_REALM_H_