0

Ensure AX notification waiter listens to inner frame trees

As part of fixing bug 1454778 and exploring how to deflake UIA tests,
we're going to start enforcing that the AX tree is clean at the end of
all dump tests. As soon as we enforce this, the fenced frame dump test
will start failing because the notification waiter never receives
notifications from fenced frames, so the test times out. This was the
core issue that CL 4503308 was trying to solve, and is likely the cause of flakiness behind issue 1459385.

To prepare for enforcing clean AX trees at the end of dump tests, we'll make sure the notification waiter can listen to inner frame trees and remove the hacky timeout in the test.

Bug: 1454778,1428967,1459385
Change-Id: I96ec0c7374a6de1e498f28a1ed8616cea96d45ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4777428
Commit-Queue: Benjamin Beaudry <benjamin.beaudry@microsoft.com>
Reviewed-by: Benjamin Beaudry <benjamin.beaudry@microsoft.com>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1184833}
This commit is contained in:
Sayan Sivakumaran
2023-08-17 19:05:18 +00:00
committed by Chromium LUCI CQ
parent 33af91cce1
commit 9d6df5c11c
4 changed files with 6 additions and 17 deletions

@ -2104,16 +2104,8 @@ INSTANTIATE_TEST_SUITE_P(
::testing::ValuesIn(DumpAccessibilityTestBase::TreeTestPasses()),
DumpAccessibilityTreeTestPassToString());
// TODO(crbug.com/1459385): Re-enable this test
#if BUILDFLAG(IS_LINUX)
#define MAYBE_AccessibilityFencedFrameScrollable \
DISABLED_AccessibilityFencedFrameScrollable
#else
#define MAYBE_AccessibilityFencedFrameScrollable \
AccessibilityFencedFrameScrollable
#endif
IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeFencedFrameTest,
MAYBE_AccessibilityFencedFrameScrollable) {
AccessibilityFencedFrameScrollable) {
RunHtmlTest(FILE_PATH_LITERAL("fencedframe-scrollable-mparch.html"));
}

@ -82,11 +82,13 @@ void AccessibilityNotificationWaiter::ListenToAllFrames(
VLOG(1) << "Waiting for AccessibilityEvent " << *event_to_wait_for_;
WebContentsImpl* web_contents_impl =
static_cast<WebContentsImpl*>(web_contents);
for (FrameTreeNode* node : web_contents_impl->GetPrimaryFrameTree().Nodes()) {
FrameTree::NodeRange nodes =
web_contents_impl->GetPrimaryFrameTree().NodesIncludingInnerTreeNodes();
for (FrameTreeNode* node : nodes) {
frame_count_++;
ListenToFrame(node->current_frame_host());
}
BrowserPluginGuestManager* guest_manager =
web_contents_impl->GetBrowserContext()->GetGuestManager();
if (guest_manager) {

@ -1,4 +1,4 @@
rootWebArea name='done' scrollable=true
rootWebArea scrollable=true
++genericContainer ignored
++++genericContainer
++++++iframe name='Scrollable iframe'

@ -1,6 +1,5 @@
<!--
@BLINK-ALLOW:scrollable=*
@WAIT-FOR:done
-->
<!DOCTYPE html>
<html style="width:100px; height:100px;">
@ -11,10 +10,6 @@
window.onload = () => {
const url = new URL("frame/visible_text.html", location.href);
document.querySelector("fencedframe").config = new FencedFrameConfig(url);
// Using @WAIT-FOR to check a value inside the fenced frame after it loads
// causes the test to flake. Instead, we wait for 500ms to give the fenced
// frame enough time to navigate.
setTimeout(() => {document.title = "done";}, 500);
}
</script>
</body>