Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3215)

Unified Diff: device/gamepad/gamepad_test_helpers.cc

Issue 2808093006: [Device Service] Move Gamepad Blink headers to be part of the Gamepad client library (Closed)
Patch Set: rebase and address comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/gamepad/gamepad_test_helpers.h ('k') | device/gamepad/gamepad_user_gesture.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/gamepad/gamepad_test_helpers.cc
diff --git a/device/gamepad/gamepad_test_helpers.cc b/device/gamepad/gamepad_test_helpers.cc
index cd1f5cdae4e8a1f3ac11074a34424cb5e3f2e40b..d6e27d47e9bebb405a1cd4c4cfbc4c755b842c48 100644
--- a/device/gamepad/gamepad_test_helpers.cc
+++ b/device/gamepad/gamepad_test_helpers.cc
@@ -6,8 +6,7 @@
namespace device {
-MockGamepadDataFetcher::MockGamepadDataFetcher(
- const blink::WebGamepads& test_data)
+MockGamepadDataFetcher::MockGamepadDataFetcher(const Gamepads& test_data)
: test_data_(test_data),
read_data_(base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED) {}
@@ -22,11 +21,11 @@ void MockGamepadDataFetcher::GetGamepadData(bool devices_changed_hint) {
{
base::AutoLock lock(lock_);
- for (unsigned int i = 0; i < blink::WebGamepads::kItemsLengthCap; ++i) {
+ for (unsigned int i = 0; i < Gamepads::kItemsLengthCap; ++i) {
if (test_data_.items[i].connected) {
PadState* pad = GetPadState(i);
if (pad)
- memcpy(&pad->data, &test_data_.items[i], sizeof(blink::WebGamepad));
+ memcpy(&pad->data, &test_data_.items[i], sizeof(Gamepad));
}
}
}
@@ -46,7 +45,7 @@ void MockGamepadDataFetcher::WaitForDataReadAndCallbacksIssued() {
WaitForDataRead();
}
-void MockGamepadDataFetcher::SetTestData(const blink::WebGamepads& new_data) {
+void MockGamepadDataFetcher::SetTestData(const Gamepads& new_data) {
base::AutoLock lock(lock_);
test_data_ = new_data;
}
@@ -56,7 +55,7 @@ GamepadTestHelper::GamepadTestHelper() {}
GamepadTestHelper::~GamepadTestHelper() {}
GamepadServiceTestConstructor::GamepadServiceTestConstructor(
- const blink::WebGamepads& test_data) {
+ const Gamepads& test_data) {
data_fetcher_ = new MockGamepadDataFetcher(test_data);
gamepad_service_ =
new GamepadService(std::unique_ptr<GamepadDataFetcher>(data_fetcher_));
« no previous file with comments | « device/gamepad/gamepad_test_helpers.h ('k') | device/gamepad/gamepad_user_gesture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698