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

Unified Diff: device/gamepad/gamepad_provider_unittest.cc

Issue 2852803002: Remove base::SharedMemory::ShareToProcess. (Closed)
Patch Set: Compile error. 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_provider.cc ('k') | device/gamepad/gamepad_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/gamepad/gamepad_provider_unittest.cc
diff --git a/device/gamepad/gamepad_provider_unittest.cc b/device/gamepad/gamepad_provider_unittest.cc
index d3d581bc9f7b9cf277a736f5f7978b68dd499e3f..f2e1ae05e096865b9b5fa510069034f66fabbaba 100644
--- a/device/gamepad/gamepad_provider_unittest.cc
+++ b/device/gamepad/gamepad_provider_unittest.cc
@@ -110,8 +110,7 @@ TEST_F(GamepadProviderTest, PollingAccess) {
base::RunLoop().RunUntilIdle();
// Renderer-side, pull data out of poll buffer.
- base::SharedMemoryHandle handle = provider->GetSharedMemoryHandleForProcess(
- base::GetCurrentProcessHandle());
+ base::SharedMemoryHandle handle = provider->DuplicateSharedMemoryHandle();
std::unique_ptr<base::SharedMemory> shared_memory(
new base::SharedMemory(handle, true));
EXPECT_TRUE(shared_memory->Map(sizeof(GamepadHardwareBuffer)));
@@ -161,8 +160,7 @@ TEST_F(GamepadProviderTest, ConnectDisconnectMultiple) {
base::RunLoop().RunUntilIdle();
// Renderer-side, pull data out of poll buffer.
- base::SharedMemoryHandle handle = provider->GetSharedMemoryHandleForProcess(
- base::GetCurrentProcessHandle());
+ base::SharedMemoryHandle handle = provider->DuplicateSharedMemoryHandle();
std::unique_ptr<base::SharedMemory> shared_memory(
new base::SharedMemory(handle, true));
EXPECT_TRUE(shared_memory->Map(sizeof(GamepadHardwareBuffer)));
@@ -221,8 +219,7 @@ TEST_F(GamepadProviderTest, UserGesture) {
base::RunLoop().RunUntilIdle();
// Renderer-side, pull data out of poll buffer.
- base::SharedMemoryHandle handle = provider->GetSharedMemoryHandleForProcess(
- base::GetCurrentProcessHandle());
+ base::SharedMemoryHandle handle = provider->DuplicateSharedMemoryHandle();
std::unique_ptr<base::SharedMemory> shared_memory(
new base::SharedMemory(handle, true));
EXPECT_TRUE(shared_memory->Map(sizeof(GamepadHardwareBuffer)));
@@ -276,8 +273,7 @@ TEST_F(GamepadProviderTest, Sanitization) {
base::RunLoop().RunUntilIdle();
// Renderer-side, pull data out of poll buffer.
- base::SharedMemoryHandle handle = provider->GetSharedMemoryHandleForProcess(
- base::GetCurrentProcessHandle());
+ base::SharedMemoryHandle handle = provider->DuplicateSharedMemoryHandle();
std::unique_ptr<base::SharedMemory> shared_memory(
new base::SharedMemory(handle, true));
EXPECT_TRUE(shared_memory->Map(sizeof(GamepadHardwareBuffer)));
« no previous file with comments | « device/gamepad/gamepad_provider.cc ('k') | device/gamepad/gamepad_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698