diff options
author | dmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-31 22:35:17 +0000 |
---|---|---|
committer | dmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-31 22:35:17 +0000 |
commit | 47ad77f597d9aa2e829ce3496c38fac670c27263 (patch) | |
tree | 5c8edd4d4b306da003e0271544187c9f669fb60f /chrome | |
parent | 90297920529617f5fa6d8595368ba25399adfb7f (diff) | |
download | chromium_src-47ad77f597d9aa2e829ce3496c38fac670c27263.zip chromium_src-47ad77f597d9aa2e829ce3496c38fac670c27263.tar.gz chromium_src-47ad77f597d9aa2e829ce3496c38fac670c27263.tar.bz2 |
Revert 73197 - Support Mozilla's GUID for ISimpleDOM and add a unit test for it.
BUG=48185
TEST=Adds new test.
Review URL: http://codereview.chromium.org/6409016
TBR=dmazzoni@chromium.org
Review URL: http://codereview.chromium.org/6260045
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73200 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/accessibility/accessibility_win_browsertest.cc | 90 | ||||
-rw-r--r-- | chrome/browser/accessibility/browser_accessibility_win.cc | 14 | ||||
-rw-r--r-- | chrome/chrome_tests.gypi | 1 |
3 files changed, 15 insertions, 90 deletions
diff --git a/chrome/browser/accessibility/accessibility_win_browsertest.cc b/chrome/browser/accessibility/accessibility_win_browsertest.cc index a3d906b..3c929c0 100644 --- a/chrome/browser/accessibility/accessibility_win_browsertest.cc +++ b/chrome/browser/accessibility/accessibility_win_browsertest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -16,7 +16,6 @@ #include "chrome/test/in_process_browser_test.h" #include "chrome/test/ui_test_utils.h" #include "ia2_api_all.h" // Generated NOLINT -#include "ISimpleDOMNode.h" // Generated NOLINT using std::auto_ptr; using std::vector; @@ -136,7 +135,7 @@ HRESULT QueryIAccessible2(IAccessible* accessible, IAccessible2** accessible2) { // Sets result to true if the child is located in the parent's tree. An // exhustive search is perform here because we determine equality using -// IAccessible2::get_unique_id which is only supported by the child node. +// IAccessible2::get_uniqueID which is only supported by the child node. void AccessibleContainsAccessible( IAccessible* parent, IAccessible2* child, bool* result) { vector<ScopedComPtr<IAccessible>> accessible_list; @@ -144,7 +143,7 @@ void AccessibleContainsAccessible( LONG unique_id; HRESULT hr = child->get_uniqueID(&unique_id); - ASSERT_EQ(S_OK, hr); + ASSERT_EQ(hr, S_OK); *result = false; while (accessible_list.size()) { @@ -164,7 +163,7 @@ void AccessibleContainsAccessible( LONG child_count; hr = accessible->get_accChildCount(&child_count); - ASSERT_EQ(S_OK, hr); + ASSERT_EQ(hr, S_OK); if (child_count == 0) continue; @@ -172,7 +171,7 @@ void AccessibleContainsAccessible( LONG obtained_count = 0; hr = AccessibleChildren( accessible, 0, child_count, child_array.get(), &obtained_count); - ASSERT_EQ(S_OK, hr); + ASSERT_EQ(hr, S_OK); ASSERT_EQ(child_count, obtained_count); for (int index = 0; index < obtained_count; index++) { @@ -260,7 +259,7 @@ void AccessibleChecker::CheckAccessibleName(IAccessible* accessible) { EXPECT_EQ(hr, S_FALSE); } else { // Test that the correct string was returned. - EXPECT_EQ(S_OK, hr); + EXPECT_EQ(hr, S_OK); EXPECT_STREQ(name_.c_str(), wstring(name.m_str, SysStringLen(name)).c_str()); } @@ -270,7 +269,7 @@ void AccessibleChecker::CheckAccessibleRole(IAccessible* accessible) { VARIANT var_role = {0}; HRESULT hr = accessible->get_accRole(CreateI4Variant(CHILDID_SELF), &var_role); - ASSERT_EQ(S_OK, hr); + ASSERT_EQ(hr, S_OK); EXPECT_TRUE(role_ == var_role); } @@ -292,7 +291,7 @@ void AccessibleChecker::CheckAccessibleState(IAccessible* accessible) { VARIANT var_state = {0}; HRESULT hr = accessible->get_accState(CreateI4Variant(CHILDID_SELF), &var_state); - EXPECT_EQ(S_OK, hr); + EXPECT_EQ(hr, S_OK); ASSERT_EQ(VT_I4, V_VT(&var_state)); EXPECT_EQ(state_, V_I4(&var_state)); } @@ -300,14 +299,14 @@ void AccessibleChecker::CheckAccessibleState(IAccessible* accessible) { void AccessibleChecker::CheckAccessibleChildren(IAccessible* parent) { LONG child_count = 0; HRESULT hr = parent->get_accChildCount(&child_count); - EXPECT_EQ(S_OK, hr); + EXPECT_EQ(hr, S_OK); ASSERT_EQ(child_count, children_.size()); auto_ptr<VARIANT> child_array(new VARIANT[child_count]); LONG obtained_count = 0; hr = AccessibleChildren(parent, 0, child_count, child_array.get(), &obtained_count); - ASSERT_EQ(S_OK, hr); + ASSERT_EQ(hr, S_OK); ASSERT_EQ(child_count, obtained_count); VARIANT* child = child_array.get(); @@ -362,7 +361,7 @@ IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, ASSERT_NE(document_accessible.get(), reinterpret_cast<IAccessible*>(NULL)); ScopedComPtr<IDispatch> parent_dispatch; HRESULT hr = document_accessible->get_accParent(parent_dispatch.Receive()); - EXPECT_EQ(S_OK, hr); + EXPECT_EQ(hr, S_OK); EXPECT_NE(parent_dispatch, reinterpret_cast<IDispatch*>(NULL)); // Navigate to another page. @@ -543,7 +542,7 @@ IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, ASSERT_NE(document_accessible.get(), reinterpret_cast<IAccessible*>(NULL)); HRESULT hr = document_accessible->accSelect( SELFLAG_TAKEFOCUS, CreateI4Variant(CHILDID_SELF)); - ASSERT_EQ(S_OK, hr); + ASSERT_EQ(hr, S_OK); ui_test_utils::WaitForNotification( NotificationType::RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED); @@ -638,7 +637,7 @@ IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, } // If pointer comparison fails resort to the exhuasive search that can use - // IAccessible2::get_unique_id for equality comparison. + // IAccessible2::get_uniqueID for equality comparison. if (!found) { AccessibleContainsAccessible( browser_accessible, document_accessible2, &found); @@ -646,67 +645,4 @@ IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, ASSERT_EQ(found, true); } - -IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, - SupportsISimpleDOM) { - GURL tree_url("data:text/html,<body><input type='checkbox' /></body>"); - browser()->OpenURL(tree_url, GURL(), CURRENT_TAB, PageTransition::TYPED); - GetRendererAccessible(); - ui_test_utils::WaitForNotification( - NotificationType::RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED); - - // Get the IAccessible object for the document. - ScopedComPtr<IAccessible> document_accessible(GetRendererAccessible()); - ASSERT_NE(document_accessible.get(), reinterpret_cast<IAccessible*>(NULL)); - - // Get the ISimpleDOM object for the document. - ScopedComPtr<IServiceProvider> service_provider; - HRESULT hr = static_cast<IAccessible*>(document_accessible)->QueryInterface( - service_provider.Receive()); - ASSERT_EQ(S_OK, hr); - const GUID refguid = {0x0c539790, 0x12e4, 0x11cf, - 0xb6, 0x61, 0x00, 0xaa, 0x00, 0x4c, 0xd6, 0xd8}; - ScopedComPtr<ISimpleDOMNode> document_isimpledomnode; - hr = static_cast<IServiceProvider *>(service_provider)->QueryService( - refguid, IID_ISimpleDOMNode, - static_cast<void**>(document_isimpledomnode.Receive())); - ASSERT_EQ(S_OK, hr); - - BSTR node_name; - short name_space_id; // NOLINT - BSTR node_value; - unsigned int num_children; - unsigned int unique_id; - unsigned short node_type; // NOLINT - hr = document_isimpledomnode->get_nodeInfo( - &node_name, &name_space_id, &node_value, &num_children, &unique_id, - &node_type); - ASSERT_EQ(S_OK, hr); - EXPECT_EQ(NODETYPE_DOCUMENT, node_type); - EXPECT_EQ(1, num_children); - - ScopedComPtr<ISimpleDOMNode> body_isimpledomnode; - hr = document_isimpledomnode->get_firstChild( - body_isimpledomnode.Receive()); - ASSERT_EQ(S_OK, hr); - hr = body_isimpledomnode->get_nodeInfo( - &node_name, &name_space_id, &node_value, &num_children, &unique_id, - &node_type); - ASSERT_EQ(S_OK, hr); - EXPECT_STREQ(L"body", wstring(node_name, SysStringLen(node_name)).c_str()); - EXPECT_EQ(NODETYPE_ELEMENT, node_type); - EXPECT_EQ(1, num_children); - - ScopedComPtr<ISimpleDOMNode> checkbox_isimpledomnode; - hr = body_isimpledomnode->get_firstChild( - checkbox_isimpledomnode.Receive()); - ASSERT_EQ(S_OK, hr); - hr = checkbox_isimpledomnode->get_nodeInfo( - &node_name, &name_space_id, &node_value, &num_children, &unique_id, - &node_type); - ASSERT_EQ(S_OK, hr); - EXPECT_STREQ(L"input", wstring(node_name, SysStringLen(node_name)).c_str()); - EXPECT_EQ(NODETYPE_ELEMENT, node_type); - EXPECT_EQ(0, num_children); -} } // namespace. diff --git a/chrome/browser/accessibility/browser_accessibility_win.cc b/chrome/browser/accessibility/browser_accessibility_win.cc index adb0b43..6b2b6e6 100644 --- a/chrome/browser/accessibility/browser_accessibility_win.cc +++ b/chrome/browser/accessibility/browser_accessibility_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -12,15 +12,6 @@ using webkit_glue::WebAccessibility; -// The GUID for the ISimpleDOM service is not defined in the IDL files. -// This is taken directly from the Mozilla sources -// (accessible/src/msaa/nsAccessNodeWrap.cpp) and it's also documented at: -// http://developer.mozilla.org/en/Accessibility/AT-APIs/ImplementationFeatures/MSAA - -const GUID GUID_ISimpleDOM = { - 0x0c539790, 0x12e4, 0x11cf, - 0xb6, 0x61, 0x00, 0xaa, 0x00, 0x4c, 0xd6, 0xd8}; - // static BrowserAccessibility* BrowserAccessibility::Create() { CComObject<BrowserAccessibilityWin>* instance; @@ -1079,8 +1070,7 @@ STDMETHODIMP BrowserAccessibilityWin::QueryService( guidService == IID_IAccessibleText || guidService == IID_ISimpleDOMDocument || guidService == IID_ISimpleDOMNode || - guidService == IID_ISimpleDOMText || - guidService == GUID_ISimpleDOM) { + guidService == IID_ISimpleDOMText) { return QueryInterface(riid, object); } diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index 673dcd8..2e2131a 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -421,7 +421,6 @@ 'chrome.gyp:installer_util_strings', '../sandbox/sandbox.gyp:sandbox', '../third_party/iaccessible2/iaccessible2.gyp:iaccessible2', - '../third_party/isimpledom/isimpledom.gyp:isimpledom', ], 'sources': [ '../webkit/glue/resources/aliasb.cur', |