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

Unified Diff: device/gamepad/gamepad_test_helpers.cc

Issue 2563483006: Move gamepad_service out of content/ and into device/ (Closed)
Patch Set: addressed Blundell's review comments Created 4 years 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/public/interfaces/gamepad.mojom » ('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 b0aa221571af1a14a41a10870e65b90c1da3abc2..e343b8a4a77aa4c02a36b2ef75dd5ec2be643a4c 100644
--- a/device/gamepad/gamepad_test_helpers.cc
+++ b/device/gamepad/gamepad_test_helpers.cc
@@ -51,30 +51,19 @@ void MockGamepadDataFetcher::SetTestData(const blink::WebGamepads& new_data) {
test_data_ = new_data;
}
-MockGamepadSharedBuffer::MockGamepadSharedBuffer() {
- size_t data_size = sizeof(blink::WebGamepads);
- bool res = shared_memory_.CreateAndMapAnonymous(data_size);
- CHECK(res);
- blink::WebGamepads* buf = buffer();
- memset(buf, 0, sizeof(blink::WebGamepads));
-}
+GamepadTestHelper::GamepadTestHelper() {}
-base::SharedMemory* MockGamepadSharedBuffer::shared_memory() {
- return &shared_memory_;
-}
+GamepadTestHelper::~GamepadTestHelper() {}
-blink::WebGamepads* MockGamepadSharedBuffer::buffer() {
- void* mem = shared_memory_.memory();
- CHECK(mem);
- return static_cast<blink::WebGamepads*>(mem);
+GamepadServiceTestConstructor::GamepadServiceTestConstructor(
+ const blink::WebGamepads& test_data) {
+ data_fetcher_ = new MockGamepadDataFetcher(test_data);
+ gamepad_service_ =
+ new GamepadService(std::unique_ptr<GamepadDataFetcher>(data_fetcher_));
}
-void MockGamepadSharedBuffer::WriteBegin() {}
-
-void MockGamepadSharedBuffer::WriteEnd() {}
-
-GamepadTestHelper::GamepadTestHelper() {}
-
-GamepadTestHelper::~GamepadTestHelper() {}
+GamepadServiceTestConstructor::~GamepadServiceTestConstructor() {
+ delete gamepad_service_;
+}
} // namespace device
« no previous file with comments | « device/gamepad/gamepad_test_helpers.h ('k') | device/gamepad/public/interfaces/gamepad.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698