Flutter Engine
The Flutter Engine
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
ui::AXPlatformNodeWinTest Class Reference

#include <ax_platform_node_win_unittest.h>

Inheritance diagram for ui::AXPlatformNodeWinTest:
ui::AXPlatformNodeTest ui::TestAXTreeManager ui::AXTreeManager ui::AXFragmentRootTest ui::AXPlatformNodeTextProviderTest ui::AXPlatformNodeTextRangeProviderTest

Public Member Functions

 AXPlatformNodeWinTest ()
 
 ~AXPlatformNodeWinTest () override
 
void SetUp () override
 
void TearDown () override
 
template<typename T >
ComPtr< TQueryInterfaceFromNodeId (AXNode::AXID id)
 
template<typename T >
ComPtr< TQueryInterfaceFromNode (AXNode *node)
 
- Public Member Functions inherited from ui::AXPlatformNodeTest
 AXPlatformNodeTest ()
 
 ~AXPlatformNodeTest () override
 
 AXPlatformNodeTest (const AXPlatformNodeTest &)=delete
 
AXPlatformNodeTestoperator= (const AXPlatformNodeTest &)=delete
 
- Public Member Functions inherited from ui::TestAXTreeManager
 TestAXTreeManager ()
 
 TestAXTreeManager (std::unique_ptr< AXTree > tree)
 
virtual ~TestAXTreeManager ()
 
 TestAXTreeManager (const TestAXTreeManager &manager)=delete
 
TestAXTreeManageroperator= (const TestAXTreeManager &manager)=delete
 
void DestroyTree ()
 
AXTreeGetTree () const
 
void SetTree (std::unique_ptr< AXTree > tree)
 
AXNodeGetNodeFromTree (const AXTreeID tree_id, const AXNode::AXID node_id) const override
 
AXNodeGetNodeFromTree (const AXNode::AXID node_id) const override
 
AXTreeID GetTreeID () const override
 
AXTreeID GetParentTreeID () const override
 
AXNodeGetRootAsAXNode () const override
 
AXNodeGetParentNodeFromParentTreeAsAXNode () const override
 
- Public Member Functions inherited from ui::AXTreeManager
virtual ~AXTreeManager ()=default
 
virtual AXNodeGetNodeFromTree (const AXTreeID tree_id, const AXNode::AXID node_id) const =0
 
virtual AXNodeGetNodeFromTree (const AXNode::AXID node_id) const =0
 
virtual AXTreeID GetTreeID () const =0
 
virtual AXTreeID GetParentTreeID () const =0
 
virtual AXNodeGetRootAsAXNode () const =0
 
virtual AXNodeGetParentNodeFromParentTreeAsAXNode () const =0
 
virtual AXTreeGetTree () const =0
 

Protected Types

using PatternSet = std::unordered_set< LONG >
 

Protected Member Functions

AXPlatformNodeAXPlatformNodeFromNode (AXNode *node)
 
template<typename T >
Microsoft::WRL::ComPtr< TQueryInterfaceFromNodeId (AXNode::AXID id)
 
template<typename T >
Microsoft::WRL::ComPtr< TQueryInterfaceFromNode (AXNode *node)
 
Microsoft::WRL::ComPtr< IRawElementProviderSimple > GetRootIRawElementProviderSimple ()
 
Microsoft::WRL::ComPtr< IRawElementProviderSimple > GetIRawElementProviderSimpleFromChildIndex (int child_index)
 
Microsoft::WRL::ComPtr< IRawElementProviderSimple > GetIRawElementProviderSimpleFromTree (const ui::AXTreeID tree_id, const AXNode::AXID node_id)
 
Microsoft::WRL::ComPtr< IRawElementProviderFragment > GetRootIRawElementProviderFragment ()
 
Microsoft::WRL::ComPtr< IRawElementProviderFragment > IRawElementProviderFragmentFromNode (AXNode *node)
 
Microsoft::WRL::ComPtr< IAccessible > IAccessibleFromNode (AXNode *node)
 
Microsoft::WRL::ComPtr< IAccessible > GetRootIAccessible ()
 
void CheckVariantHasName (const base::win::ScopedVariant &variant, const wchar_t *expected_name)
 
void CheckIUnknownHasName (Microsoft::WRL::ComPtr< IUnknown > unknown, const wchar_t *expected_name)
 
Microsoft::WRL::ComPtr< IAccessibleTableCell > GetCellInTable ()
 
void InitFragmentRoot ()
 
AXFragmentRootWinInitNodeAsFragmentRoot (AXNode *node, TestFragmentRootDelegate *delegate)
 
Microsoft::WRL::ComPtr< IRawElementProviderFragmentRoot > GetFragmentRoot ()
 
PatternSet GetSupportedPatternsFromNodeId (AXNode::AXID id)
 
- Protected Member Functions inherited from ui::AXPlatformNodeTest
void Init (const AXTreeUpdate &initial_state)
 
void Init (const ui::AXNodeData &node1, const ui::AXNodeData &node2=ui::AXNodeData(), const ui::AXNodeData &node3=ui::AXNodeData(), const ui::AXNodeData &node4=ui::AXNodeData(), const ui::AXNodeData &node5=ui::AXNodeData(), const ui::AXNodeData &node6=ui::AXNodeData(), const ui::AXNodeData &node7=ui::AXNodeData(), const ui::AXNodeData &node8=ui::AXNodeData(), const ui::AXNodeData &node9=ui::AXNodeData(), const ui::AXNodeData &node10=ui::AXNodeData(), const ui::AXNodeData &node11=ui::AXNodeData(), const ui::AXNodeData &node12=ui::AXNodeData())
 
AXTreeUpdate BuildTextField ()
 
AXTreeUpdate BuildTextFieldWithSelectionRange (int32_t start, int32_t stop)
 
AXTreeUpdate BuildContentEditable ()
 
AXTreeUpdate BuildContentEditableWithSelectionRange (int32_t start, int32_t end)
 
AXTreeUpdate Build3X3Table ()
 
AXTreeUpdate BuildAriaColumnAndRowCountGrids ()
 
AXTreeUpdate BuildListBox (bool option_1_is_selected, bool option_2_is_selected, bool option_3_is_selected, const std::vector< ax::mojom::State > &additional_state)
 

Protected Attributes

std::unique_ptr< AXFragmentRootWinax_fragment_root_
 
std::unique_ptr< TestFragmentRootDelegatetest_fragment_root_delegate_
 

Static Protected Attributes

static const std::u16string kEmbeddedCharacterAsString
 

Detailed Description

Definition at line 82 of file ax_platform_node_win_unittest.h.

Member Typedef Documentation

◆ PatternSet

using ui::AXPlatformNodeWinTest::PatternSet = std::unordered_set<LONG>
protected

Definition at line 123 of file ax_platform_node_win_unittest.h.

Constructor & Destructor Documentation

◆ AXPlatformNodeWinTest()

ui::AXPlatformNodeWinTest::AXPlatformNodeWinTest ( )

Definition at line 259 of file ax_platform_node_win_unittest.cc.

259 {
260 // scoped_feature_list_.InitAndEnableFeature(features::kIChromeAccessible);
261}

◆ ~AXPlatformNodeWinTest()

ui::AXPlatformNodeWinTest::~AXPlatformNodeWinTest ( )
override

Definition at line 263 of file ax_platform_node_win_unittest.cc.

263{}

Member Function Documentation

◆ AXPlatformNodeFromNode()

AXPlatformNode * ui::AXPlatformNodeWinTest::AXPlatformNodeFromNode ( AXNode node)
protected

Definition at line 278 of file ax_platform_node_win_unittest.cc.

278 {
279 const TestAXNodeWrapper* wrapper =
281 return wrapper ? wrapper->ax_platform_node() : nullptr;
282}
static TestAXNodeWrapper * GetOrCreate(AXTree *tree, AXNode *node)

◆ CheckIUnknownHasName()

void ui::AXPlatformNodeWinTest::CheckIUnknownHasName ( Microsoft::WRL::ComPtr< IUnknown >  unknown,
const wchar_t *  expected_name 
)
protected

◆ CheckVariantHasName()

void ui::AXPlatformNodeWinTest::CheckVariantHasName ( const base::win::ScopedVariant variant,
const wchar_t *  expected_name 
)
protected

Definition at line 352 of file ax_platform_node_win_unittest.cc.

353 {
354 ASSERT_NE(nullptr, variant.ptr());
355 ComPtr<IAccessible> accessible;
356 ASSERT_HRESULT_SUCCEEDED(
357 V_DISPATCH(variant.ptr())->QueryInterface(IID_PPV_ARGS(&accessible)));
359 EXPECT_EQ(S_OK, accessible->get_accName(SELF, name.Receive()));
360 EXPECT_STREQ(expected_name, name.Get());
361}
const VARIANT * ptr() const
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32

◆ GetCellInTable()

Microsoft::WRL::ComPtr< IAccessibleTableCell > ui::AXPlatformNodeWinTest::GetCellInTable ( )
protected

◆ GetFragmentRoot()

ComPtr< IRawElementProviderFragmentRoot > ui::AXPlatformNodeWinTest::GetFragmentRoot ( )
protected

Definition at line 381 of file ax_platform_node_win_unittest.cc.

381 {
382 ComPtr<IRawElementProviderFragmentRoot> fragment_root_provider;
383 ax_fragment_root_->GetNativeViewAccessible()->QueryInterface(
384 IID_PPV_ARGS(&fragment_root_provider));
385 return fragment_root_provider;
386}
std::unique_ptr< AXFragmentRootWin > ax_fragment_root_

◆ GetIRawElementProviderSimpleFromChildIndex()

ComPtr< IRawElementProviderSimple > ui::AXPlatformNodeWinTest::GetIRawElementProviderSimpleFromChildIndex ( int  child_index)
protected

Definition at line 307 of file ax_platform_node_win_unittest.cc.

308 {
309 if (!GetRootAsAXNode() || child_index < 0 ||
310 static_cast<size_t>(child_index) >=
311 GetRootAsAXNode()->children().size()) {
312 return ComPtr<IRawElementProviderSimple>();
313 }
314
315 return QueryInterfaceFromNode<IRawElementProviderSimple>(
316 GetRootAsAXNode()->children()[static_cast<size_t>(child_index)]);
317}
AXNode * GetRootAsAXNode() const override
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259

◆ GetIRawElementProviderSimpleFromTree()

Microsoft::WRL::ComPtr< IRawElementProviderSimple > ui::AXPlatformNodeWinTest::GetIRawElementProviderSimpleFromTree ( const ui::AXTreeID  tree_id,
const AXNode::AXID  node_id 
)
protected

Definition at line 320 of file ax_platform_node_win_unittest.cc.

322 {
323 return QueryInterfaceFromNode<IRawElementProviderSimple>(
324 GetNodeFromTree(tree_id, node_id));
325}
AXNode * GetNodeFromTree(const AXTreeID tree_id, const AXNode::AXID node_id) const override

◆ GetRootIAccessible()

ComPtr< IAccessible > ui::AXPlatformNodeWinTest::GetRootIAccessible ( )
protected

Definition at line 348 of file ax_platform_node_win_unittest.cc.

348 {
350}
Microsoft::WRL::ComPtr< IAccessible > IAccessibleFromNode(AXNode *node)

◆ GetRootIRawElementProviderFragment()

ComPtr< IRawElementProviderFragment > ui::AXPlatformNodeWinTest::GetRootIRawElementProviderFragment ( )
protected

Definition at line 328 of file ax_platform_node_win_unittest.cc.

328 {
329 return QueryInterfaceFromNode<IRawElementProviderFragment>(GetRootAsAXNode());
330}

◆ GetRootIRawElementProviderSimple()

ComPtr< IRawElementProviderSimple > ui::AXPlatformNodeWinTest::GetRootIRawElementProviderSimple ( )
protected

Definition at line 302 of file ax_platform_node_win_unittest.cc.

302 {
303 return QueryInterfaceFromNode<IRawElementProviderSimple>(GetRootAsAXNode());
304}

◆ GetSupportedPatternsFromNodeId()

AXPlatformNodeWinTest::PatternSet ui::AXPlatformNodeWinTest::GetSupportedPatternsFromNodeId ( AXNode::AXID  id)
protected

Definition at line 389 of file ax_platform_node_win_unittest.cc.

389 {
390 ComPtr<IRawElementProviderSimple> raw_element_provider_simple =
391 QueryInterfaceFromNodeId<IRawElementProviderSimple>(id);
392 PatternSet supported_patterns;
393 static const std::vector<LONG> all_supported_patterns_ = {
394 UIA_TextChildPatternId, UIA_TextEditPatternId,
395 UIA_TextPatternId, UIA_WindowPatternId,
396 UIA_InvokePatternId, UIA_ExpandCollapsePatternId,
397 UIA_GridPatternId, UIA_GridItemPatternId,
398 UIA_RangeValuePatternId, UIA_ScrollPatternId,
399 UIA_ScrollItemPatternId, UIA_TablePatternId,
400 UIA_TableItemPatternId, UIA_SelectionItemPatternId,
401 UIA_SelectionPatternId, UIA_TogglePatternId,
402 UIA_ValuePatternId,
403 };
404 for (LONG property_id : all_supported_patterns_) {
405 ComPtr<IUnknown> provider;
406 if (SUCCEEDED(raw_element_provider_simple->GetPatternProvider(property_id,
407 &provider)) &&
408 provider) {
409 supported_patterns.insert(property_id);
410 }
411 }
412 return supported_patterns;
413}
std::unordered_set< LONG > PatternSet
#define SUCCEEDED(hr)
long LONG
Definition: windows_types.h:23

◆ IAccessibleFromNode()

ComPtr< IAccessible > ui::AXPlatformNodeWinTest::IAccessibleFromNode ( AXNode node)
protected

Definition at line 344 of file ax_platform_node_win_unittest.cc.

344 {
345 return QueryInterfaceFromNode<IAccessible>(node);
346}

◆ InitFragmentRoot()

void ui::AXPlatformNodeWinTest::InitFragmentRoot ( )
protected

Definition at line 363 of file ax_platform_node_win_unittest.cc.

363 {
364 test_fragment_root_delegate_ = std::make_unique<TestFragmentRootDelegate>();
367}
AXFragmentRootWin * InitNodeAsFragmentRoot(AXNode *node, TestFragmentRootDelegate *delegate)
std::unique_ptr< TestFragmentRootDelegate > test_fragment_root_delegate_

◆ InitNodeAsFragmentRoot()

AXFragmentRootWin * ui::AXPlatformNodeWinTest::InitNodeAsFragmentRoot ( AXNode node,
TestFragmentRootDelegate delegate 
)
protected

Definition at line 369 of file ax_platform_node_win_unittest.cc.

371 {
372 delegate->child_ = AXPlatformNodeFromNode(node)->GetNativeViewAccessible();
373 if (node->parent())
374 delegate->parent_ =
376
377 return new AXFragmentRootWin(gfx::kMockAcceleratedWidget, delegate);
378}
AXPlatformNode * AXPlatformNodeFromNode(AXNode *node)
virtual gfx::NativeViewAccessible GetNativeViewAccessible()=0

◆ IRawElementProviderFragmentFromNode()

Microsoft::WRL::ComPtr< IRawElementProviderFragment > ui::AXPlatformNodeWinTest::IRawElementProviderFragmentFromNode ( AXNode node)
protected

Definition at line 333 of file ax_platform_node_win_unittest.cc.

333 {
334 AXPlatformNode* platform_node = AXPlatformNodeFromNode(node);
335 gfx::NativeViewAccessible native_view =
336 platform_node->GetNativeViewAccessible();
337 ComPtr<IUnknown> unknown_node = native_view;
338 ComPtr<IRawElementProviderFragment> fragment_node;
339 unknown_node.As(&fragment_node);
340
341 return fragment_node;
342}
UnimplementedNativeViewAccessible * NativeViewAccessible

◆ QueryInterfaceFromNode() [1/2]

template<typename T >
ComPtr< T > ui::AXPlatformNodeWinTest::QueryInterfaceFromNode ( AXNode node)

Definition at line 290 of file ax_platform_node_win_unittest.cc.

290 {
291 AXPlatformNode* ax_platform_node = AXPlatformNodeFromNode(node);
292 if (!ax_platform_node)
293 return ComPtr<T>();
294 ComPtr<T> result;
295 EXPECT_HRESULT_SUCCEEDED(
296 ax_platform_node->GetNativeViewAccessible()->QueryInterface(__uuidof(T),
297 &result));
298 return result;
299}
GAsyncResult * result
#define T
Definition: precompiler.cc:65

◆ QueryInterfaceFromNode() [2/2]

template<typename T >
Microsoft::WRL::ComPtr< T > ui::AXPlatformNodeWinTest::QueryInterfaceFromNode ( AXNode node)
protected

◆ QueryInterfaceFromNodeId() [1/2]

template<typename T >
ComPtr< T > ui::AXPlatformNodeWinTest::QueryInterfaceFromNodeId ( AXNode::AXID  id)

Definition at line 285 of file ax_platform_node_win_unittest.cc.

285 {
286 return QueryInterfaceFromNode<T>(GetNodeFromTree(id));
287}

◆ QueryInterfaceFromNodeId() [2/2]

template<typename T >
Microsoft::WRL::ComPtr< T > ui::AXPlatformNodeWinTest::QueryInterfaceFromNodeId ( AXNode::AXID  id)
protected

◆ SetUp()

void ui::AXPlatformNodeWinTest::SetUp ( )
override

Definition at line 265 of file ax_platform_node_win_unittest.cc.

265 {
267}
void CreateATLModuleIfNeeded()
Definition: atl_module.h:22

◆ TearDown()

void ui::AXPlatformNodeWinTest::TearDown ( )
override

Definition at line 269 of file ax_platform_node_win_unittest.cc.

269 {
270 // Destroy the tree and make sure we're not leaking any objects.
271 ax_fragment_root_.reset(nullptr);
272 DestroyTree();
276}
static size_t GetInstanceCountForTesting()
static void SetGlobalIsWebContent(bool is_web_content)

Member Data Documentation

◆ ax_fragment_root_

std::unique_ptr<AXFragmentRootWin> ui::AXPlatformNodeWinTest::ax_fragment_root_
protected

Definition at line 126 of file ax_platform_node_win_unittest.h.

◆ kEmbeddedCharacterAsString

const std::u16string ui::AXPlatformNodeWinTest::kEmbeddedCharacterAsString
staticprotected
Initial value:

Definition at line 92 of file ax_platform_node_win_unittest.h.

◆ test_fragment_root_delegate_

std::unique_ptr<TestFragmentRootDelegate> ui::AXPlatformNodeWinTest::test_fragment_root_delegate_
protected

Definition at line 128 of file ax_platform_node_win_unittest.h.


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