Commit 2e4873d6 authored by Alice Boxhall's avatar Alice Boxhall Committed by Commit Bot

Avoid calling AtkObjectToString on removed children

Fixing issue found by FindIt https://analysis.chromium.org/waterfall/culprit?key=ag9zfmZpbmRpdC1mb3ItbWVyRAsSDVdmU3VzcGVjdGVkQ0wiMWNocm9taXVtLzQ0NzBkNDFkYjA3NDIwOTBlOWYxYjQ5NmZhOTA2MDBmNDdjNTMyYTgM
... revealed by test added in https://crrev.com/c/1731634

Change-Id: Ic2f2c381a4aa714172ff3487e05dca10744213e3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1736206
Commit-Queue: Alice Boxhall <aboxhall@chromium.org>
Reviewed-by: default avatarChris Hall <chrishall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#683940}
parent 214faa52
......@@ -238,7 +238,11 @@ void AccessibilityEventRecorderAuraLinux::ProcessATKEvent(
int index = static_cast<int>(g_value_get_uint(&params[1]));
log += base::StringPrintf(" index:%d", index);
AtkObject* child = static_cast<AtkObject*>(g_value_get_pointer(&params[2]));
if (child)
// Removed children may become stale references by this point.
if (event_name.find("::remove") != std::string::npos)
log += " CHILD:(REMOVED)";
else if (child)
log += " CHILD:(" + AtkObjectToString(child, log_name) + ")";
else
log += " CHILD:(NULL)";
......
......@@ -797,7 +797,7 @@ IN_PROC_BROWSER_TEST_P(DumpAccessibilityEventsTest,
RunEventTest(FILE_PATH_LITERAL("select-selected-add-remove.html"));
}
IN_PROC_BROWSER_TEST_P(DumpAccessibilityEventsTest, DISABLED_DeleteSubtree) {
IN_PROC_BROWSER_TEST_P(DumpAccessibilityEventsTest, DeleteSubtree) {
RunEventTest(FILE_PATH_LITERAL("delete-subtree.html"));
}
......
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