Index: chrome/browser/accessibility/browser_accessibility_manager_unittest.cc |
=================================================================== |
--- chrome/browser/accessibility/browser_accessibility_manager_unittest.cc (revision 97079) |
+++ chrome/browser/accessibility/browser_accessibility_manager_unittest.cc (working copy) |
@@ -604,7 +604,7 @@ |
tree2_1.role = WebAccessibility::ROLE_WEB_AREA; |
WebAccessibility tree2_2; |
- tree2_2.id = 1002; |
+ tree2_2.id = 1001; |
tree2_2.role = WebAccessibility::ROLE_BUTTON; |
tree2_1.children.push_back(tree2_2); |
@@ -614,15 +614,18 @@ |
// Fire another load complete. |
manager->OnAccessibilityNotifications(params); |
- BrowserAccessibility* acc2_2 = manager->GetFromRendererID(1002); |
+ BrowserAccessibility* acc2_2 = manager->GetFromRendererID(1001); |
// Verify the root has not changed. |
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(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. |
manager.reset(); |
ASSERT_EQ(0, CountedBrowserAccessibility::global_obj_count_); |