Commit a639634b authored by ctguil@chromium.org's avatar ctguil@chromium.org

Broke BrowserAccessibilityTest.HitTestTest

Revert 97076 - Add DCHECK to BrowserAccessibilityManager::Remove to detect undefined behavoir that may lead to a crash.
- Remove logic BrowserAccessibilityManagerTest.TestCreateEmptyDocument that attempts to change an accessibility object's role.

BUG=92716
Test=none
Review URL: http://codereview.chromium.org/7648055

TBR=ctguil@chromium.org
Review URL: http://codereview.chromium.org/7669012

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97080 0039d316-1c4b-4281-b951-d872f2087c98
parent a0e4b079
...@@ -604,7 +604,7 @@ TEST(BrowserAccessibilityManagerTest, TestCreateEmptyDocument) { ...@@ -604,7 +604,7 @@ TEST(BrowserAccessibilityManagerTest, TestCreateEmptyDocument) {
tree2_1.role = WebAccessibility::ROLE_WEB_AREA; tree2_1.role = WebAccessibility::ROLE_WEB_AREA;
WebAccessibility tree2_2; WebAccessibility tree2_2;
tree2_2.id = 1002; tree2_2.id = 1001;
tree2_2.role = WebAccessibility::ROLE_BUTTON; tree2_2.role = WebAccessibility::ROLE_BUTTON;
tree2_1.children.push_back(tree2_2); tree2_1.children.push_back(tree2_2);
...@@ -614,14 +614,17 @@ TEST(BrowserAccessibilityManagerTest, TestCreateEmptyDocument) { ...@@ -614,14 +614,17 @@ TEST(BrowserAccessibilityManagerTest, TestCreateEmptyDocument) {
// Fire another load complete. // Fire another load complete.
manager->OnAccessibilityNotifications(params); manager->OnAccessibilityNotifications(params);
BrowserAccessibility* acc2_2 = manager->GetFromRendererID(1002); BrowserAccessibility* acc2_2 = manager->GetFromRendererID(1001);
// Verify the root has not changed. // Verify the root has not changed.
EXPECT_EQ(root, manager->GetRoot()); EXPECT_EQ(root, manager->GetRoot());
// And the new child exists. // And the proper child remains.
EXPECT_EQ(WebAccessibility::ROLE_BUTTON, acc2_2->role()); EXPECT_EQ(WebAccessibility::ROLE_BUTTON, acc2_2->role());
EXPECT_EQ(1002, acc2_2->renderer_id()); EXPECT_EQ(1001, acc2_2->renderer_id());
// Verify we don't reuse objects that have changed roles.
EXPECT_NE(acc1_2, acc2_2);
// Ensure we properly cleaned up. // Ensure we properly cleaned up.
manager.reset(); manager.reset();
......
...@@ -116,9 +116,6 @@ BrowserAccessibility* BrowserAccessibilityManager::GetFromRendererID( ...@@ -116,9 +116,6 @@ BrowserAccessibility* BrowserAccessibilityManager::GetFromRendererID(
void BrowserAccessibilityManager::Remove(int32 child_id, int32 renderer_id) { void BrowserAccessibilityManager::Remove(int32 child_id, int32 renderer_id) {
child_id_map_.erase(child_id); child_id_map_.erase(child_id);
// TODO(ctguil): Investigate if hit. We should never have a newer entry.
DCHECK(renderer_id_to_child_id_map_[renderer_id] == child_id);
// Make sure we don't overwrite a newer entry (see UpdateNode for a possible // Make sure we don't overwrite a newer entry (see UpdateNode for a possible
// corner case). // corner case).
if (renderer_id_to_child_id_map_[renderer_id] == child_id) if (renderer_id_to_child_id_map_[renderer_id] == child_id)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment