Index: content/browser/gamepad/gamepad_test_helpers.cc |
diff --git a/content/browser/gamepad/gamepad_test_helpers.cc b/content/browser/gamepad/gamepad_test_helpers.cc |
index fc79dcb5ee67ebf1648ad5620122d00d9e34bc00..365baaf9e090df80a4719ecb9b4f5233cfe2d7dc 100644 |
--- a/content/browser/gamepad/gamepad_test_helpers.cc |
+++ b/content/browser/gamepad/gamepad_test_helpers.cc |
@@ -17,11 +17,17 @@ MockGamepadDataFetcher::MockGamepadDataFetcher( |
MockGamepadDataFetcher::~MockGamepadDataFetcher() { |
} |
-void MockGamepadDataFetcher::GetGamepadData(blink::WebGamepads* pads, |
- bool devices_changed_hint) { |
+void MockGamepadDataFetcher::GetGamepadData(bool devices_changed_hint) { |
{ |
base::AutoLock lock(lock_); |
- *pads = test_data_; |
+ |
+ for (unsigned int i = 0; i < blink::WebGamepads::itemsLengthCap; ++i) { |
+ if (test_data_.items[i].connected) { |
+ PadState* pad = provider()->GetPadState(GAMEPAD_SOURCE_TEST, i); |
+ if (pad) |
+ memcpy(&pad->data, &test_data_.items[i], sizeof(blink::WebGamepad)); |
+ } |
+ } |
} |
read_data_.Signal(); |
} |