Get foreground tab on Android

This works around the fact that document.hidden doesn't work
reliably on Android, by assuming that the first tab in the tab
list is the foreground tab. This is always true at present, but is
not guaranteed in future.

BUG=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237148 0039d316-1c4b-4281-b951-d872f2087c98
SVN changes up to revision 237148
events: Move test related functions into a separate target.

Move events test-related code into a separate target so that these don't get
used in non-test code. Notable changes:

* Move nested TestApi classes out of Event, LocatedEvent and EventTarget,
  and into separate classes. The new classes become friends with their old
  parents.
* Move events_x_utils out of x/ into test/

R=sky@chromium.org, tfarina@chromium.org
TBR=jam@ for content_tests.gypi and render_view_browsertest.cc changes.
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237149 0039d316-1c4b-4281-b951-d872f2087c98
SVN changes up to revision 237149