| Index: content/browser/accessibility/browser_accessibility_win_unittest.cc
|
| diff --git a/content/browser/accessibility/browser_accessibility_win_unittest.cc b/content/browser/accessibility/browser_accessibility_win_unittest.cc
|
| index a043878e5c7d95011be20c93b47e2119ca42e2aa..c3b96724cdbaf81ea17991968f5f2fa8b4578ff7 100644
|
| --- a/content/browser/accessibility/browser_accessibility_win_unittest.cc
|
| +++ b/content/browser/accessibility/browser_accessibility_win_unittest.cc
|
| @@ -22,7 +22,6 @@
|
| #include "content/common/accessibility_messages.h"
|
| #include "content/public/test/test_browser_thread_bundle.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| -#include "ui/accessibility/platform/ax_platform_node_win.h"
|
| #include "ui/base/win/atl_module.h"
|
|
|
| namespace content {
|
| @@ -705,11 +704,6 @@
|
| manager.reset();
|
| }
|
|
|
| -int32_t GetUniqueId(BrowserAccessibility* accessibility) {
|
| - BrowserAccessibilityWin* win_root = ToBrowserAccessibilityWin(accessibility);
|
| - return win_root->GetCOM()->unique_id();
|
| -}
|
| -
|
| // This is a regression test for a bug where the initial empty document
|
| // loaded by a BrowserAccessibilityManagerWin couldn't be looked up by
|
| // its UniqueIDWin, because the AX Tree was loaded in
|
| @@ -727,14 +721,8 @@
|
| EXPECT_EQ(ui::AX_ROLE_ROOT_WEB_AREA, root->GetRole());
|
| EXPECT_EQ(1 << ui::AX_STATE_BUSY, root->GetState());
|
|
|
| - BrowserAccessibilityWin* win_root = ToBrowserAccessibilityWin(root);
|
| -
|
| - ui::AXPlatformNode* node = static_cast<ui::AXPlatformNode*>(
|
| - ui::AXPlatformNodeWin::GetFromUniqueId(GetUniqueId(win_root)));
|
| -
|
| - ui::AXPlatformNode* other_node =
|
| - static_cast<ui::AXPlatformNode*>(win_root->GetCOM());
|
| - ASSERT_EQ(node, other_node);
|
| + int32_t unique_id = ToBrowserAccessibilityWin(root)->unique_id();
|
| + ASSERT_EQ(root, BrowserAccessibility::GetFromUniqueID(unique_id));
|
| }
|
|
|
| TEST_F(BrowserAccessibilityTest, TestIA2Attributes) {
|
| @@ -2189,18 +2177,18 @@
|
| new BrowserAccessibilityFactory()));
|
|
|
| BrowserAccessibility* root = manager->GetRoot();
|
| - int32_t root_unique_id = GetUniqueId(root);
|
| + int32_t root_unique_id = root->unique_id();
|
| BrowserAccessibility* child = root->PlatformGetChild(0);
|
| - int32_t child_unique_id = GetUniqueId(child);
|
| + int32_t child_unique_id = child->unique_id();
|
|
|
| // Now destroy that original tree and create a new tree.
|
| manager.reset(new BrowserAccessibilityManagerWin(
|
| MakeAXTreeUpdate(root_node, child_node), nullptr,
|
| new BrowserAccessibilityFactory()));
|
| root = manager->GetRoot();
|
| - int32_t root_unique_id_2 = GetUniqueId(root);
|
| + int32_t root_unique_id_2 = root->unique_id();
|
| child = root->PlatformGetChild(0);
|
| - int32_t child_unique_id_2 = GetUniqueId(child);
|
| + int32_t child_unique_id_2 = child->unique_id();
|
|
|
| // The nodes in the new tree should not have the same ids.
|
| EXPECT_NE(root_unique_id, root_unique_id_2);
|
| @@ -2250,13 +2238,13 @@
|
| BrowserAccessibility* root = manager->GetRoot();
|
| BrowserAccessibility* child = root->PlatformGetChild(0);
|
|
|
| - base::win::ScopedVariant root_unique_id_variant(-GetUniqueId(root));
|
| + base::win::ScopedVariant root_unique_id_variant(-root->unique_id());
|
| base::win::ScopedComPtr<IDispatch> result;
|
| EXPECT_EQ(E_INVALIDARG,
|
| ToBrowserAccessibilityWin(child)->GetCOM()->get_accChild(
|
| root_unique_id_variant, result.GetAddressOf()));
|
|
|
| - base::win::ScopedVariant child_unique_id_variant(-GetUniqueId(child));
|
| + base::win::ScopedVariant child_unique_id_variant(-child->unique_id());
|
| EXPECT_EQ(S_OK, ToBrowserAccessibilityWin(root)->GetCOM()->get_accChild(
|
| child_unique_id_variant, result.GetAddressOf()));
|
| }
|
| @@ -2320,7 +2308,7 @@
|
| describedby_relation->get_target(0, target.GetAddressOf()));
|
| target.CopyTo(ax_target.GetAddressOf());
|
| EXPECT_HRESULT_SUCCEEDED(ax_target->get_uniqueID(&unique_id));
|
| - EXPECT_EQ(-GetUniqueId(ax_child1), unique_id);
|
| + EXPECT_EQ(-ax_child1->unique_id(), unique_id);
|
| ax_target.Reset();
|
| target.Reset();
|
|
|
| @@ -2328,7 +2316,7 @@
|
| describedby_relation->get_target(1, target.GetAddressOf()));
|
| target.CopyTo(ax_target.GetAddressOf());
|
| EXPECT_HRESULT_SUCCEEDED(ax_target->get_uniqueID(&unique_id));
|
| - EXPECT_EQ(-GetUniqueId(ax_child2), unique_id);
|
| + EXPECT_EQ(-ax_child2->unique_id(), unique_id);
|
| ax_target.Reset();
|
| target.Reset();
|
| describedby_relation.Reset();
|
| @@ -2351,7 +2339,7 @@
|
| description_for_relation->get_target(0, target.GetAddressOf()));
|
| target.CopyTo(ax_target.GetAddressOf());
|
| EXPECT_HRESULT_SUCCEEDED(ax_target->get_uniqueID(&unique_id));
|
| - EXPECT_EQ(-GetUniqueId(ax_root), unique_id);
|
| + EXPECT_EQ(-ax_root->unique_id(), unique_id);
|
| ax_target.Reset();
|
| target.Reset();
|
| description_for_relation.Reset();
|
| @@ -2373,7 +2361,7 @@
|
| description_for_relation->get_target(0, target.GetAddressOf()));
|
| target.CopyTo(ax_target.GetAddressOf());
|
| EXPECT_HRESULT_SUCCEEDED(ax_target->get_uniqueID(&unique_id));
|
| - EXPECT_EQ(-GetUniqueId(ax_root), unique_id);
|
| + EXPECT_EQ(-ax_root->unique_id(), unique_id);
|
| ax_target.Reset();
|
| target.Reset();
|
|
|
|
|