Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(875)

Unified Diff: chrome/browser/accessibility_win_browsertest.cc

Issue 2720003: Relanding 49339 ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/renderer_host/render_widget_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/accessibility_win_browsertest.cc
===================================================================
--- chrome/browser/accessibility_win_browsertest.cc (revision 49343)
+++ chrome/browser/accessibility_win_browsertest.cc (working copy)
@@ -19,13 +19,6 @@
namespace {
class AccessibilityWinBrowserTest : public InProcessBrowserTest {
- public:
- void SetUpCommandLine(CommandLine* command_line) {
- // Turns on the accessibility in the renderer. Off by default until
- // http://crbug.com/25564 is fixed.
- command_line->AppendSwitch(switches::kEnableRendererAccessibility);
- }
-
protected:
IAccessible* GetRenderWidgetHostViewClientAccessible();
};
@@ -181,6 +174,20 @@
IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest,
TestRendererAccessibilityTree) {
+ // By requesting an accessible chrome will believe a screen reader has been
+ // detected.
+ ScopedComPtr<IAccessible> document_accessible(
+ GetRenderWidgetHostViewClientAccessible());
+
+ // The initial accessible returned should have state STATE_SYSTEM_BUSY while
+ // the accessibility tree is being requested from the renderer.
+ VARIANT var_state;
+ HRESULT hr = document_accessible->
+ get_accState(CreateI4Variant(CHILDID_SELF), &var_state);
+ EXPECT_EQ(hr, S_OK);
+ EXPECT_EQ(V_VT(&var_state), VT_I4);
+ EXPECT_EQ(V_I4(&var_state), STATE_SYSTEM_BUSY);
+
GURL tree_url(
"data:text/html,<html><head><title>Accessibility Win Test</title></head>"
"<body><input type='button' value='push' /><input type='checkbox' />"
@@ -189,8 +196,7 @@
ui_test_utils::WaitForNotification(
NotificationType::RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED);
- ScopedComPtr<IAccessible> document_accessible(
- GetRenderWidgetHostViewClientAccessible());
+ document_accessible = GetRenderWidgetHostViewClientAccessible();
ASSERT_NE(document_accessible.get(), reinterpret_cast<IAccessible*>(NULL));
AccessibleChecker button_checker(L"push", ROLE_SYSTEM_PUSHBUTTON);
@@ -208,7 +214,7 @@
// Check that document accessible has a parent accessible.
ScopedComPtr<IDispatch> parent_dispatch;
- HRESULT hr = document_accessible->get_accParent(parent_dispatch.Receive());
+ hr = document_accessible->get_accParent(parent_dispatch.Receive());
EXPECT_EQ(hr, S_OK);
EXPECT_NE(parent_dispatch, reinterpret_cast<IDispatch*>(NULL));
« no previous file with comments | « no previous file | chrome/browser/renderer_host/render_widget_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698