Commit 280411c8 authored by dmazzoni's avatar dmazzoni Committed by Commit bot

Enable SitePerProcessAccessibilityBrowserTest on more platforms.

BUG=399775,368298

Review URL: https://codereview.chromium.org/864963003

Cr-Commit-Position: refs/heads/master@{#314372}
parent 3c6b0696
...@@ -47,13 +47,11 @@ bool AccessibilityTreeIsLoaded(BrowserAccessibilityManager* manager) { ...@@ -47,13 +47,11 @@ bool AccessibilityTreeIsLoaded(BrowserAccessibilityManager* manager) {
root->GetStringAttribute(ui::AX_ATTR_DOC_URL) != url::kAboutBlankURL); root->GetStringAttribute(ui::AX_ATTR_DOC_URL) != url::kAboutBlankURL);
} }
// TODO(nasko): try enabling this test on more platforms once // Times out on Android, not clear if it's an actual bug or just slow.
// SitePerProcessBrowserTest.CrossSiteIframe is enabled everywhere. #if defined(OS_ANDROID)
// http://crbug.com/399775
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
#define MAYBE_CrossSiteIframeAccessibility CrossSiteIframeAccessibility
#else
#define MAYBE_CrossSiteIframeAccessibility DISABLED_CrossSiteIframeAccessibility #define MAYBE_CrossSiteIframeAccessibility DISABLED_CrossSiteIframeAccessibility
#else
#define MAYBE_CrossSiteIframeAccessibility CrossSiteIframeAccessibility
#endif #endif
IN_PROC_BROWSER_TEST_F(SitePerProcessAccessibilityBrowserTest, IN_PROC_BROWSER_TEST_F(SitePerProcessAccessibilityBrowserTest,
MAYBE_CrossSiteIframeAccessibility) { MAYBE_CrossSiteIframeAccessibility) {
......
...@@ -161,9 +161,15 @@ bool FrameAccessibility::GetParent( ...@@ -161,9 +161,15 @@ bool FrameAccessibility::GetParent(
FrameTree::GloballyFindByID(iter->child_frame_tree_node_id); FrameTree::GloballyFindByID(iter->child_frame_tree_node_id);
if (child_node && if (child_node &&
child_node->current_frame_host() == child_frame_host) { child_node->current_frame_host() == child_frame_host) {
// We should have gotten a *direct* child of the parent frame. // Assert that the child node is a descendant of the parent frame in
if (child_node->parent() != // the frame tree. It may not be a direct descendant because the
iter->parent_frame_host->frame_tree_node()) { // parent frame's accessibility tree may span multiple frames from the
// same origin.
FrameTreeNode* parent_node = iter->parent_frame_host->frame_tree_node();
FrameTreeNode* child_node_ancestor = child_node->parent();
while (child_node_ancestor && child_node_ancestor != parent_node)
child_node_ancestor = child_node_ancestor->parent();
if (child_node_ancestor != parent_node) {
NOTREACHED(); NOTREACHED();
return false; return false;
} }
...@@ -201,8 +207,15 @@ RenderFrameHostImpl* FrameAccessibility::GetRFHIFromFrameTreeNodeId( ...@@ -201,8 +207,15 @@ RenderFrameHostImpl* FrameAccessibility::GetRFHIFromFrameTreeNodeId(
if (!child_node) if (!child_node)
return nullptr; return nullptr;
// We should have gotten a *direct* child of the parent frame. // Assert that the child node is a descendant of the parent frame in
if (child_node->parent() != parent_frame_host->frame_tree_node()) { // the frame tree. It may not be a direct descendant because the
// parent frame's accessibility tree may span multiple frames from the
// same origin.
FrameTreeNode* parent_node = parent_frame_host->frame_tree_node();
FrameTreeNode* child_node_ancestor = child_node->parent();
while (child_node_ancestor && child_node_ancestor != parent_node)
child_node_ancestor = child_node_ancestor->parent();
if (child_node_ancestor != parent_node) {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
......
...@@ -1610,7 +1610,8 @@ void RenderFrameHostImpl::UpdateCrossProcessIframeAccessibility( ...@@ -1610,7 +1610,8 @@ void RenderFrameHostImpl::UpdateCrossProcessIframeAccessibility(
FrameTree* frame_tree = frame_tree_node()->frame_tree(); FrameTree* frame_tree = frame_tree_node()->frame_tree();
FrameTreeNode* child_frame_tree_node = frame_tree->FindByRoutingID( FrameTreeNode* child_frame_tree_node = frame_tree->FindByRoutingID(
GetProcess()->GetID(), frame_routing_id); frame_routing_id, GetProcess()->GetID());
if (child_frame_tree_node) { if (child_frame_tree_node) {
FrameAccessibility::GetInstance()->AddChildFrame( FrameAccessibility::GetInstance()->AddChildFrame(
this, node_id, child_frame_tree_node->frame_tree_node_id()); this, node_id, child_frame_tree_node->frame_tree_node_id());
......
...@@ -438,8 +438,7 @@ void BlinkAXTreeSource::SerializeNode(blink::WebAXObject src, ...@@ -438,8 +438,7 @@ void BlinkAXTreeSource::SerializeNode(blink::WebAXObject src,
src.minValueForRange()); src.minValueForRange());
} }
if (dst->role == ui::AX_ROLE_DOCUMENT || if (dst->role == ui::AX_ROLE_WEB_AREA) {
dst->role == ui::AX_ROLE_WEB_AREA) {
dst->AddStringAttribute(ui::AX_ATTR_HTML_TAG, "#document"); dst->AddStringAttribute(ui::AX_ATTR_HTML_TAG, "#document");
const WebDocument& document = src.document(); const WebDocument& document = src.document();
if (name.empty()) if (name.empty())
......
android.webkit.WebView focusable focused scrollable android.webkit.WebView focusable focused scrollable
android.view.View clickable scrollable name='aria role document' android.view.View clickable name='aria role document'
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment