Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
flutter_runner::testing::MockInjectorRegistry Class Reference

#include <mock_injector_registry.h>

Inheritance diagram for flutter_runner::testing::MockInjectorRegistry:

Public Member Functions

 MockInjectorRegistry (fidl::InterfaceRequest< fuchsia::ui::pointerinjector::Registry > registry)
 
void Register (fuchsia::ui::pointerinjector::Config config, fidl::InterfaceRequest< fuchsia::ui::pointerinjector::Device > injector, RegisterCallback callback) override
 
void Inject (std::vector< fuchsia::ui::pointerinjector::Event > events, InjectCallback callback) override
 
void ClearBindings ()
 
const fuchsia::ui::pointerinjector::Config & config () const
 
const std::vector< fuchsia::ui::pointerinjector::Event > & events () const
 
uint32_t num_register_calls ()
 
size_t num_registered ()
 
uint32_t num_events_received () const
 

Detailed Description

Definition at line 17 of file mock_injector_registry.h.

Constructor & Destructor Documentation

◆ MockInjectorRegistry()

flutter_runner::testing::MockInjectorRegistry::MockInjectorRegistry ( fidl::InterfaceRequest< fuchsia::ui::pointerinjector::Registry >  registry)
inlineexplicit

Definition at line 20 of file mock_injector_registry.h.

22 : registry_(this, std::move(registry)) {}

Member Function Documentation

◆ ClearBindings()

void flutter_runner::testing::MockInjectorRegistry::ClearBindings ( )
inline

Definition at line 54 of file mock_injector_registry.h.

54{ bindings_.clear(); }

◆ config()

const fuchsia::ui::pointerinjector::Config & flutter_runner::testing::MockInjectorRegistry::config ( ) const
inline

Definition at line 58 of file mock_injector_registry.h.

58{ return config_; }

◆ events()

const std::vector< fuchsia::ui::pointerinjector::Event > & flutter_runner::testing::MockInjectorRegistry::events ( ) const
inline

Definition at line 62 of file mock_injector_registry.h.

62 {
63 return events_;
64 }

◆ Inject()

void flutter_runner::testing::MockInjectorRegistry::Inject ( std::vector< fuchsia::ui::pointerinjector::Event events,
InjectCallback  callback 
)
inlineoverride

Definition at line 43 of file mock_injector_registry.h.

44 {
45 num_events_received_ += events.size();
46
47 for (auto& event : events) {
48 events_.push_back(std::move(event));
49 }
50
51 callback();
52 }
const std::vector< fuchsia::ui::pointerinjector::Event > & events() const
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
FlKeyEvent * event

◆ num_events_received()

uint32_t flutter_runner::testing::MockInjectorRegistry::num_events_received ( ) const
inline

Definition at line 70 of file mock_injector_registry.h.

70{ return num_events_received_; }

◆ num_register_calls()

uint32_t flutter_runner::testing::MockInjectorRegistry::num_register_calls ( )
inline

Definition at line 66 of file mock_injector_registry.h.

66{ return num_register_calls_; }

◆ num_registered()

size_t flutter_runner::testing::MockInjectorRegistry::num_registered ( )
inline

Definition at line 68 of file mock_injector_registry.h.

68{ return bindings_.size(); }

◆ Register()

void flutter_runner::testing::MockInjectorRegistry::Register ( fuchsia::ui::pointerinjector::Config  config,
fidl::InterfaceRequest< fuchsia::ui::pointerinjector::Device >  injector,
RegisterCallback  callback 
)
inlineoverride

Definition at line 25 of file mock_injector_registry.h.

28 {
29 num_register_calls_++;
30 const uint32_t id = next_id_++;
31
32 auto [it, success] = bindings_.try_emplace(id, this, std::move(injector));
33
34 it->second.set_error_handler(
35 [this, id](zx_status_t status) { bindings_.erase(id); });
36
37 config_ = std::move(config);
38
39 callback();
40 }
const fuchsia::ui::pointerinjector::Config & config() const

The documentation for this class was generated from the following file: