Gamepad: don't notify about connected pads twice

Currently the first time we observe user gesture we call
GamepadConsumer::OnGamepadConnected once because of the gesture and once because of the
state change of the pad. This CL fixes that by reordering the gesture check and the
state tests in GamepadProvider the state change will be ignored by GamepadService
because did_observe_user_gesture is still false for the consumer.
Also it seems like I forget to set gesture_callback_pending_ to true when appropriate
in my former CL's, fixed it.
Added unit test for connections and made some refactoring related to unittests.

BUG=344556
R=bajones@chromium.org,scottmg@chromium.org
TBR=dmichael@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281098 0039d316-1c4b-4281-b951-d872f2087c98
9 files changed