Fix crash when accessing automation node from stale AX tree
commitace50646dcd95261ef8e6aca2096458828532fbc
authordmazzoni <dmazzoni@chromium.org>
Mon, 31 Aug 2015 16:15:27 +0000 (31 09:15 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 31 Aug 2015 16:16:01 +0000 (31 16:16 +0000)
tree8840246f472c5c59bac5e928c9b36c3a59f0f976
parent2eccc8354d41e0da85d88af97f85d1ad21179d9b
Fix crash when accessing automation node from stale AX tree

The problem is that the root node of a stale AX tree computes its id
dynamically, but if that AX tree doesn't exist anymore it was returning
undefined, and then passing undefined to any of the native bindinds was a
fatal error.

The solution is just to return -1 instead of undefined as the id.

BUG=526255

Review URL: https://codereview.chromium.org/1308813008

Cr-Commit-Position: refs/heads/master@{#346394}
chrome/renderer/resources/extensions/automation/automation_node.js
chrome/test/data/extensions/api_test/automation/tests/tabs/close_tab.js