diff options
author | ctguil@chromium.org <ctguil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-12 18:47:23 +0000 |
---|---|---|
committer | ctguil@chromium.org <ctguil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-12 18:47:23 +0000 |
commit | 12a7e779988f47663578c85d29a54feea91b377a (patch) | |
tree | 0a535c97a25aab8ff1fe926875e60841ad4fcc99 | |
parent | f870252fda3d5724feeda33aeb6deaf502643a31 (diff) | |
download | chromium_src-12a7e779988f47663578c85d29a54feea91b377a.zip chromium_src-12a7e779988f47663578c85d29a54feea91b377a.tar.gz chromium_src-12a7e779988f47663578c85d29a54feea91b377a.tar.bz2 |
Fix the TestRendererAccessibilityTree browser test so that it's not flaky.
Add a new notification for when the render view host's accessibility tree is updated and verify the tree in the test after that notification is received.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/1986009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47051 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/accessibility_win_browsertest.cc | 7 | ||||
-rw-r--r-- | chrome/browser/renderer_host/render_view_host.cc | 5 | ||||
-rw-r--r-- | chrome/common/notification_type.h | 5 |
3 files changed, 15 insertions, 2 deletions
diff --git a/chrome/browser/accessibility_win_browsertest.cc b/chrome/browser/accessibility_win_browsertest.cc index 47deda5..f1c0086 100644 --- a/chrome/browser/accessibility_win_browsertest.cc +++ b/chrome/browser/accessibility_win_browsertest.cc @@ -12,6 +12,7 @@ #include "chrome/browser/renderer_host/render_widget_host_view_win.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/common/chrome_switches.h" +#include "chrome/common/notification_type.h" #include "chrome/test/in_process_browser_test.h" #include "chrome/test/ui_test_utils.h" @@ -179,12 +180,14 @@ void AccessibleChecker::CheckAccessibleChildren(IAccessible* parent) { } IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, - FLAKY_TestRendererAccessibilityTree) { + TestRendererAccessibilityTree) { GURL tree_url( "data:text/html,<html><head><title>Accessibility Win Test</title></head>" "<body><input type='button' value='push' /><input type='checkbox' />" "</body></html>"); - ui_test_utils::NavigateToURL(browser(), tree_url); + browser()->OpenURL(tree_url, GURL(), CURRENT_TAB, PageTransition::TYPED); + ui_test_utils::WaitForNotification( + NotificationType::RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED); ScopedComPtr<IAccessible> document_accessible( GetRenderWidgetHostViewClientAccessible()); diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc index a763388..b595939 100644 --- a/chrome/browser/renderer_host/render_view_host.cc +++ b/chrome/browser/renderer_host/render_view_host.cc @@ -1841,6 +1841,11 @@ void RenderViewHost::OnAccessibilityObjectStateChange(int acc_obj_id) { void RenderViewHost::OnAccessibilityTree( const webkit_glue::WebAccessibility& tree) { view()->UpdateAccessibilityTree(tree); + + NotificationService::current()->Notify( + NotificationType::RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED, + Source<RenderViewHost>(this), + NotificationService::NoDetails()); } void RenderViewHost::OnCSSInserted() { diff --git a/chrome/common/notification_type.h b/chrome/common/notification_type.h index d8b46b4..3913de1 100644 --- a/chrome/common/notification_type.h +++ b/chrome/common/notification_type.h @@ -415,6 +415,11 @@ class NotificationType { // first RenderViewHost is set). RENDER_VIEW_HOST_CHANGED, + // Indicates that the render view host has received a new accessibility tree + // from the render view. The source is the RenderViewHost, the details + // are not used. + RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED, + // This is sent when a RenderWidgetHost is being destroyed. The source is // the RenderWidgetHost, the details are not used. RENDER_WIDGET_HOST_DESTROYED, |