Fix the AXPlatformNodeWinTest.IAccessibleHitTest test (flutter/engine#36490)

This commit is contained in:
Loïc Sharma
2022-09-29 09:41:13 -07:00
committed by GitHub
parent 8d47b777e7
commit ed86837855
3 changed files with 10 additions and 2 deletions

View File

@@ -271,6 +271,7 @@ void AXPlatformNodeWinTest::TearDown() {
ax_fragment_root_.reset(nullptr);
DestroyTree();
TestAXNodeWrapper::SetGlobalIsWebContent(false);
TestAXNodeWrapper::ClearHitTestResults();
ASSERT_EQ(0U, AXPlatformNodeBase::GetInstanceCountForTesting());
}
@@ -446,8 +447,7 @@ TEST_F(AXPlatformNodeWinTest, IAccessibleDetachedObject) {
EXPECT_EQ(E_FAIL, root_obj->get_accName(SELF, name2.Receive()));
}
// TODO(cbracken): Flaky https://github.com/flutter/flutter/issues/98302
TEST_F(AXPlatformNodeWinTest, DISABLED_IAccessibleHitTest) {
TEST_F(AXPlatformNodeWinTest, IAccessibleHitTest) {
AXNodeData root;
root.id = 1;
root.relative_bounds.bounds = gfx::RectF(0, 0, 40, 40);

View File

@@ -119,6 +119,11 @@ void TestAXNodeWrapper::SetHitTestResult(AXNode::AXID src_node_id,
g_hit_test_result[src_node_id] = dst_node_id;
}
// static
void TestAXNodeWrapper::ClearHitTestResults() {
g_hit_test_result.clear();
}
TestAXNodeWrapper::~TestAXNodeWrapper() {
platform_node_->Destroy();
}

View File

@@ -56,6 +56,9 @@ class TestAXNodeWrapper : public AXPlatformNodeDelegateBase {
static void SetHitTestResult(AXNode::AXID src_node_id,
AXNode::AXID dst_node_id);
// Remove all hit test overrides added by SetHitTestResult.
static void ClearHitTestResults();
~TestAXNodeWrapper() override;
AXPlatformNode* ax_platform_node() const { return platform_node_; }