diff options
author | ctguil@chromium.org <ctguil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-28 19:38:57 +0000 |
---|---|---|
committer | ctguil@chromium.org <ctguil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-28 19:38:57 +0000 |
commit | 1388f567ce007e1cd8da596bd6ff7ab4a5d42c36 (patch) | |
tree | 5a126571be7998162b88f665249d04f1ff8d9857 /chrome/browser | |
parent | 9ba6130bdb562494380dcc45c5d08777c652a830 (diff) | |
download | chromium_src-1388f567ce007e1cd8da596bd6ff7ab4a5d42c36.zip chromium_src-1388f567ce007e1cd8da596bd6ff7ab4a5d42c36.tar.gz chromium_src-1388f567ce007e1cd8da596bd6ff7ab4a5d42c36.tar.bz2 |
Ensure browser cache of the renderer tree contains an accessibility object before sending an accessibility notification.
BUG=46209
TEST=interative_ui_tests:AccessibilityWinBrowserTest.TestNotificationChildrenChanged2
Review URL: http://codereview.chromium.org/3506004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60832 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/accessibility_win_browsertest.cc | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/chrome/browser/accessibility_win_browsertest.cc b/chrome/browser/accessibility_win_browsertest.cc index 68abd21..4baf66f 100644 --- a/chrome/browser/accessibility_win_browsertest.cc +++ b/chrome/browser/accessibility_win_browsertest.cc @@ -479,31 +479,30 @@ IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, } IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, - TestNotificationFocusChanged) { + TestNotificationChildrenChanged2) { // The role attribute causes the node to be in the accessibility tree. GURL tree_url( - "data:text/html,<div role=group tabindex='-1'></div>"); + "data:text/html,<div role=group style='visibility: hidden'>text" + "</div>"); browser()->OpenURL(tree_url, GURL(), CURRENT_TAB, PageTransition::TYPED); GetRendererAccessible(); ui_test_utils::WaitForNotification( NotificationType::RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED); - // Check the browser's copy of the renderer accessibility tree. - AccessibleChecker div_checker(L"", L"div", L""); - div_checker.SetExpectedState( - STATE_SYSTEM_FOCUSABLE | STATE_SYSTEM_OFFSCREEN | STATE_SYSTEM_READONLY); + // Check the accessible tree of the browser. AccessibleChecker document_checker(L"", ROLE_SYSTEM_DOCUMENT, L""); - document_checker.AppendExpectedChild(&div_checker); document_checker.CheckAccessible(GetRendererAccessible()); - // Focus the div in the document - ExecuteScript(L"document.body.children[0].focus()"); + // Change the children of the document body. + ExecuteScript(L"document.body.children[0].style.visibility='visible'"); ui_test_utils::WaitForNotification( NotificationType::RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED); // Check that the accessibility tree of the browser has been updated. - div_checker.SetExpectedState( - STATE_SYSTEM_FOCUSABLE | STATE_SYSTEM_READONLY | STATE_SYSTEM_FOCUSED); + AccessibleChecker static_text_checker(L"", ROLE_SYSTEM_TEXT, L"text"); + AccessibleChecker div_checker(L"", L"div", L""); + document_checker.AppendExpectedChild(&div_checker); + div_checker.AppendExpectedChild(&static_text_checker); document_checker.CheckAccessible(GetRendererAccessible()); // TODO(ctguil): The renderer should notify the browser when focus is cleared. @@ -524,24 +523,26 @@ IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, // document_checker.CheckAccessible(GetRendererAccessible()); } -// http://crbug.com/46209 IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, - DISABLED_TestNotificationChildrenChanged2) { + TestNotificationFocusChanged) { // The role attribute causes the node to be in the accessibility tree. GURL tree_url( - "data:text/html,<div role=group style='visibility: hidden'>text" - "</div>"); + "data:text/html,<div role=group tabindex='-1'></div>"); browser()->OpenURL(tree_url, GURL(), CURRENT_TAB, PageTransition::TYPED); GetRendererAccessible(); ui_test_utils::WaitForNotification( NotificationType::RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED); - // Check the accessible tree of the browser. + // Check the browser's copy of the renderer accessibility tree. + AccessibleChecker div_checker(L"", L"div", L""); + div_checker.SetExpectedState( + STATE_SYSTEM_FOCUSABLE | STATE_SYSTEM_OFFSCREEN | STATE_SYSTEM_READONLY); AccessibleChecker document_checker(L"", ROLE_SYSTEM_DOCUMENT, L""); + document_checker.AppendExpectedChild(&div_checker); document_checker.CheckAccessible(GetRendererAccessible()); - // Change the children of the document body. - ExecuteScript(L"document.body.children[0].style.visibility='visible'"); + // Focus the div in the document + ExecuteScript(L"document.body.children[0].focus()"); ui_test_utils::WaitForNotification( NotificationType::RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED); |