Flutter Engine
flutter_runner_test::MockSemanticsManager Class Reference

#include <flutter_runner_fakes.h>

Inheritance diagram for flutter_runner_test::MockSemanticsManager:

Public Member Functions

 MockSemanticsManager ()
 
void RegisterViewForSemantics (fuchsia::ui::views::ViewRef view_ref, fidl::InterfaceHandle< fuchsia::accessibility::semantics::SemanticListener > handle, fidl::InterfaceRequest< fuchsia::accessibility::semantics::SemanticTree > semantic_tree) override
 
fidl::InterfaceRequestHandler< SemanticsManager > GetHandler (async_dispatcher_t *dispatcher)
 
bool RegisterViewCalled ()
 
void ResetTree ()
 
void UpdateSemanticNodes (std::vector< fuchsia::accessibility::semantics::Node > nodes) override
 
void DeleteSemanticNodes (std::vector< uint32_t > node_ids) override
 
const std::vector< uint32_t > & LastDeletedNodeIds () const
 
int DeleteCount () const
 
bool DeleteOverflowed () const
 
int UpdateCount () const
 
bool UpdateOverflowed () const
 
int CommitCount () const
 
const std::vector< fuchsia::accessibility::semantics::Node > & LastUpdatedNodes () const
 
void CommitUpdates (CommitUpdatesCallback callback) override
 

Detailed Description

Definition at line 13 of file flutter_runner_fakes.h.

Constructor & Destructor Documentation

◆ MockSemanticsManager()

flutter_runner_test::MockSemanticsManager::MockSemanticsManager ( )
inline

Definition at line 17 of file flutter_runner_fakes.h.

17 : tree_binding_(this) {}

Member Function Documentation

◆ CommitCount()

int flutter_runner_test::MockSemanticsManager::CommitCount ( ) const
inline

Definition at line 82 of file flutter_runner_fakes.h.

82 { return commit_count_; }

◆ CommitUpdates()

void flutter_runner_test::MockSemanticsManager::CommitUpdates ( CommitUpdatesCallback  callback)
inlineoverride

Definition at line 89 of file flutter_runner_fakes.h.

89  {
90  commit_count_++;
91  }

◆ DeleteCount()

int flutter_runner_test::MockSemanticsManager::DeleteCount ( ) const
inline

Definition at line 76 of file flutter_runner_fakes.h.

76 { return delete_count_; }

◆ DeleteOverflowed()

bool flutter_runner_test::MockSemanticsManager::DeleteOverflowed ( ) const
inline

Definition at line 77 of file flutter_runner_fakes.h.

77 { return delete_overflowed_; }

◆ DeleteSemanticNodes()

void flutter_runner_test::MockSemanticsManager::DeleteSemanticNodes ( std::vector< uint32_t >  node_ids)
inlineoverride

Definition at line 61 of file flutter_runner_fakes.h.

References flutter_runner::AccessibilityBridge::kNodeIdSize, and fml::size().

61  {
62  delete_count_++;
63  if (!delete_overflowed_) {
64  size_t size =
65  sizeof(node_ids) +
67  delete_overflowed_ = size > ZX_CHANNEL_MAX_MSG_BYTES;
68  }
69  last_deleted_node_ids_ = std::move(node_ids);
70  }
constexpr std::size_t size(T(&array)[N])
Definition: size.h:13

◆ GetHandler()

fidl::InterfaceRequestHandler<SemanticsManager> flutter_runner_test::MockSemanticsManager::GetHandler ( async_dispatcher_t *  dispatcher)
inline

Definition at line 30 of file flutter_runner_fakes.h.

31  {
32  return bindings_.GetHandler(this, dispatcher);
33  }

◆ LastDeletedNodeIds()

const std::vector<uint32_t>& flutter_runner_test::MockSemanticsManager::LastDeletedNodeIds ( ) const
inline

Definition at line 72 of file flutter_runner_fakes.h.

72  {
73  return last_deleted_node_ids_;
74  }

◆ LastUpdatedNodes()

const std::vector<fuchsia::accessibility::semantics::Node>& flutter_runner_test::MockSemanticsManager::LastUpdatedNodes ( ) const
inline

Definition at line 84 of file flutter_runner_fakes.h.

85  {
86  return last_updated_nodes_;
87  }

◆ RegisterViewCalled()

bool flutter_runner_test::MockSemanticsManager::RegisterViewCalled ( )
inline

Definition at line 35 of file flutter_runner_fakes.h.

35 { return has_view_ref_; }

◆ RegisterViewForSemantics()

void flutter_runner_test::MockSemanticsManager::RegisterViewForSemantics ( fuchsia::ui::views::ViewRef  view_ref,
fidl::InterfaceHandle< fuchsia::accessibility::semantics::SemanticListener >  handle,
fidl::InterfaceRequest< fuchsia::accessibility::semantics::SemanticTree >  semantic_tree 
)
inlineoverride

Definition at line 20 of file flutter_runner_fakes.h.

25  {
26  tree_binding_.Bind(std::move(semantic_tree));
27  has_view_ref_ = true;
28  }

◆ ResetTree()

void flutter_runner_test::MockSemanticsManager::ResetTree ( )
inline

Definition at line 37 of file flutter_runner_fakes.h.

37  {
38  update_count_ = 0;
39  delete_count_ = 0;
40  commit_count_ = 0;
41  last_updated_nodes_.clear();
42  last_deleted_node_ids_.clear();
43  delete_overflowed_ = false;
44  update_overflowed_ = false;
45  }

◆ UpdateCount()

int flutter_runner_test::MockSemanticsManager::UpdateCount ( ) const
inline

Definition at line 79 of file flutter_runner_fakes.h.

79 { return update_count_; }

◆ UpdateOverflowed()

bool flutter_runner_test::MockSemanticsManager::UpdateOverflowed ( ) const
inline

Definition at line 80 of file flutter_runner_fakes.h.

80 { return update_overflowed_; }

◆ UpdateSemanticNodes()

void flutter_runner_test::MockSemanticsManager::UpdateSemanticNodes ( std::vector< fuchsia::accessibility::semantics::Node >  nodes)
inlineoverride

Definition at line 47 of file flutter_runner_fakes.h.

References fml::size().

48  {
49  update_count_++;
50  if (!update_overflowed_) {
51  size_t size = 0;
52  for (const auto& node : nodes) {
53  size += sizeof(node);
54  size += sizeof(node.attributes().label().size());
55  }
56  update_overflowed_ = size > ZX_CHANNEL_MAX_MSG_BYTES;
57  }
58  last_updated_nodes_ = std::move(nodes);
59  }
constexpr std::size_t size(T(&array)[N])
Definition: size.h:13

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