5#ifndef FLUTTER_SHELL_PLATFORM_FUCHSIA_FLUTTER_TESTS_INTEGRATION_UTILS_PORTABLE_UI_TEST_H_
6#define FLUTTER_SHELL_PLATFORM_FUCHSIA_FLUTTER_TESTS_INTEGRATION_UTILS_PORTABLE_UI_TEST_H_
8#include <fuchsia/sysmem/cpp/fidl.h>
9#include <fuchsia/ui/app/cpp/fidl.h>
10#include <fuchsia/ui/composition/cpp/fidl.h>
11#include <fuchsia/ui/display/singleton/cpp/fidl.h>
12#include <fuchsia/ui/input/cpp/fidl.h>
13#include <fuchsia/ui/test/input/cpp/fidl.h>
14#include <fuchsia/ui/test/scene/cpp/fidl.h>
15#include <lib/async-loop/testing/cpp/real_loop.h>
16#include <lib/sys/component/cpp/testing/realm_builder.h>
17#include <lib/sys/component/cpp/testing/realm_builder_types.h>
18#include <zircon/status.h>
29 "fuchsia.vulkan.loader.Loader";
31 "fuchsia.posix.socket.Provider";
33 "fuchsia.ui.pointerinjector.Registry";
43 "fuchsia-pkg://fuchsia.com/oot_flutter_jit_runner#meta/"
44 "flutter_jit_runner.cm";
47 void SetUp(
bool build_realm =
true);
81 std::vector<fuchsia::ui::test::input::MouseButton> pressed_buttons,
90 std::vector<fuchsia::ui::test::input::MouseButton> pressed_buttons,
93 bool use_physical_units =
false);
99 component_testing::RealmBuilder*
realm_builder() {
return &realm_builder_; }
100 component_testing::RealmRoot*
realm_root() {
return realm_.get(); }
106 return touch_injection_request_count_;
110 void SetUpRealmBase();
120 void WatchViewGeometry();
123 void ProcessViewGeometryResponse(
124 fuchsia::ui::observation::geometry::WatchResponse response);
126 fuchsia::ui::test::input::RegistryPtr input_registry_;
127 fuchsia::ui::test::input::TouchScreenPtr fake_touchscreen_;
128 fuchsia::ui::test::input::MousePtr fake_mouse_;
129 fuchsia::ui::test::input::KeyboardPtr fake_keyboard_;
130 fuchsia::ui::test::scene::ControllerPtr scene_provider_;
131 fuchsia::ui::observation::geometry::ViewTreeWatcherPtr view_tree_watcher_;
133 component_testing::RealmBuilder realm_builder_ =
135 std::unique_ptr<component_testing::RealmRoot> realm_;
139 int touch_injection_request_count_ = 0;
142 std::optional<zx_koid_t> client_root_view_ref_koid_;
149 std::optional<fuchsia::ui::observation::geometry::ViewTreeSnapshot>
150 last_view_tree_snapshot_;
static sk_sp< Effect > Create()
static constexpr auto kTestUIStack
void RegisterTouchScreen()
static constexpr auto kFlutterRunnerEnvironment
void SimulateMouseEvent(std::vector< fuchsia::ui::test::input::MouseButton > pressed_buttons, int movement_x, int movement_y)
void SimulateMouseScroll(std::vector< fuchsia::ui::test::input::MouseButton > pressed_buttons, int scroll_x, int scroll_y, bool use_physical_units=false)
static constexpr auto kFlutterJitRunnerRef
static constexpr auto kPointerInjectorRegistryName
void InjectTap(int32_t x, int32_t y)
virtual std::string GetTestUIStackUrl()=0
void LaunchClientWithEmbeddedView()
bool HasViewConnected(zx_koid_t view_ref_koid)
static constexpr auto kTestUIStackRef
void SimulateTextEntry(std::string text)
virtual void ExtendRealm()=0
component_testing::RealmRoot * realm_root()
static constexpr auto kFlutterJitRunner
static constexpr auto kFlutterJitRunnerUrl
static constexpr auto kVulkanLoaderServiceName
static constexpr auto kPosixSocketProviderName
void SetUp(bool build_realm=true)
int touch_injection_request_count() const
component_testing::RealmBuilder * realm_builder()