Commit e0b51b89 authored by Aaron Leventhal's avatar Aaron Leventhal Committed by Commit Bot

Guard against |this| being deleted in test script

The layout bugs test runner uses an altered code path to post a11y
notifications, that allows a listener to delete the very object
that is firing the notifications. Do not attempt to further process a11y
notifications for objects that are detached.

Bug: 843960
Change-Id: I1e10ee014855c1d8f6fbf06c29c5a51c19fe1330
Reviewed-on: https://chromium-review.googlesource.com/1122714Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572097}
parent 488c85dd
......@@ -238,6 +238,11 @@ class WebFrameTestProxy : public Base, public WebFrameTestProxyBase {
void PostAccessibilityEvent(const blink::WebAXObject& object,
blink::WebAXEvent event) override {
test_client()->PostAccessibilityEvent(object, event);
// Guard against the case where |this| was deleted as a result of an
// accessibility listener detaching a frame. If that occurs, the
// WebAXObject will be detached.
if (object.IsDetached())
return; // |this| is invalid.
Base::PostAccessibilityEvent(object, event);
}
......
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