Commit 35600f9f authored by dtseng@chromium.org's avatar dtseng@chromium.org

Fixes and reenables RendererAccessibilityBrowserTest.*

Revert "Disable RendererAccessibilityBrowserTest.CrossPlatform* tests"

This reverts commit 2a31da98908e3e42b323f4d67b957fc8b85941e3.

and

ensures that we replace the test tree when receiving layout complete notifications.
Only pass on the test tree when the tree actually has a non-empty subtree. This indicates a non-blank test page.

BUG=106934
TEST=try bots.
TBR=jam,sergyu

Review URL: http://codereview.chromium.org/8895018

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114046 0039d316-1c4b-4281-b951-d872f2087c98
parent a7eff083
......@@ -2724,8 +2724,7 @@
# is safe to run there. See http://crbug.com/78722 for details.
'../base/files/file_path_watcher_browsertest.cc',
'../content/app/startup_helper_win.cc',
# TODO(sergeyu): Disabled due to crbug.com/106934.
# '../content/browser/accessibility/renderer_accessibility_browsertest.cc',
'../content/browser/accessibility/renderer_accessibility_browsertest.cc',
'../content/browser/child_process_security_policy_browsertest.cc',
'../content/browser/device_orientation/device_orientation_browsertest.cc',
'../content/browser/download/mhtml_generation_browsertest.cc',
......
......@@ -42,10 +42,7 @@ class RendererAccessibilityBrowserTest : public InProcessBrowserTest {
RenderViewHost* view_host = static_cast<RenderViewHost*>(host);
view_host->set_save_accessibility_tree_for_testing(true);
view_host->EnableRendererAccessibility();
while (view_host->accessibility_tree_for_testing().state &
(1 << WebAccessibility::STATE_BUSY)) {
tree_updated_observer.Wait();
}
tree_updated_observer.Wait();
return view_host->accessibility_tree_for_testing();
}
......
......@@ -1395,13 +1395,17 @@ void RenderViewHost::OnAccessibilityNotifications(
for (unsigned i = 0; i < params.size(); i++) {
const ViewHostMsg_AccessibilityNotification_Params& param = params[i];
if (param.notification_type == ViewHostMsg_AccEvent::LOAD_COMPLETE &&
if ((param.notification_type == ViewHostMsg_AccEvent::LAYOUT_COMPLETE ||
param.notification_type == ViewHostMsg_AccEvent::LOAD_COMPLETE) &&
save_accessibility_tree_for_testing_) {
accessibility_tree_ = param.acc_tree;
content::NotificationService::current()->Notify(
content::NOTIFICATION_RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED,
content::Source<RenderViewHost>(this),
content::NotificationService::NoDetails());
// Only notify for non-blank pages.
if (accessibility_tree_.children.size() > 0)
content::NotificationService::current()->Notify(
content::NOTIFICATION_RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED,
content::Source<RenderViewHost>(this),
content::NotificationService::NoDetails());
}
}
}
......
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