Port automation api js focus computations to C++

This change migrates focus/blur eventing from javascript to C++. This moves the
source focus state, and logic entirely to AutomationInternalCustomBindings.

There are also some misc fixes:
- audited and corrected AutomationAXTreeWrapper::OnAccessibilityEvents.
All early returns need to clear generated events, but weren't.
- ax::mojom::Event::kFocusContext is inapplicable on Chrome OS.
- AutomationAXTreeWrapper::IsInFocusChain did not account correctly for a
  detached tree (one that does not eventually have a desktop tree as
  ancestor). In these cases, we need to always consider it focused, given all
  other conditions apply. This can happen if we only have one tree in automation
  tabs only mode.
- fix some automation api tests. This suite runs all tests without restarting
  the browser, so all state is kept including focus states. We no longer re-fire
  focus events, if the node is already focused, so tests need to set focus to
  different nodes to get an event.

Test: comprehensive coverage exists in browser_tests
--gtest_filter=Automation*.* and --gtest_filter=ChromeVox*.*.

Change-Id: I61435807bdb0044dd6344d7fbe6484ff7cfac223
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1617379
Reviewed-by: Nektarios Paisios <nektar@chromium.org>
Reviewed-by: Katie Dektar <katie@chromium.org>
Commit-Queue: David Tseng <dtseng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#661408}
11 files changed