diff options
author | b.kelemen@samsung.com <b.kelemen@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-02 21:58:04 +0000 |
---|---|---|
committer | b.kelemen@samsung.com <b.kelemen@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-02 21:58:04 +0000 |
commit | aa16b184102b427f560d1c614f707b0e49e9afc4 (patch) | |
tree | 55b60a17cc5111956334ad1f9cf43933adde7a0d /content/browser/gamepad/gamepad_test_helpers.h | |
parent | 8155b50793c5e051231042c2223f7c321619f9fc (diff) | |
download | chromium_src-aa16b184102b427f560d1c614f707b0e49e9afc4.zip chromium_src-aa16b184102b427f560d1c614f707b0e49e9afc4.tar.gz chromium_src-aa16b184102b427f560d1c614f707b0e49e9afc4.tar.bz2 |
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
Diffstat (limited to 'content/browser/gamepad/gamepad_test_helpers.h')
-rw-r--r-- | content/browser/gamepad/gamepad_test_helpers.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/content/browser/gamepad/gamepad_test_helpers.h b/content/browser/gamepad/gamepad_test_helpers.h index 2aad5753..bf88258 100644 --- a/content/browser/gamepad/gamepad_test_helpers.h +++ b/content/browser/gamepad/gamepad_test_helpers.h @@ -33,6 +33,11 @@ class MockGamepadDataFetcher : public GamepadDataFetcher { // fetcher on the background thread. void WaitForDataRead(); + // Blocks the current thread until the GamepadProvider reads from this + // fetcher on the background thread and issued all callbacks related to the + // read on the client's thread. + void WaitForDataReadAndCallbacksIssued(); + // Updates the test data. void SetTestData(const blink::WebGamepads& new_data); |