Fix the AXPlatformNodeWinTest.IAccessibleHitTest test (flutter/engine#36490)
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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_; }
|
||||
|
||||
Reference in New Issue
Block a user