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

Unified Diff: base/metrics/persistent_memory_allocator_unittest.cc

Issue 2102923002: Change MessagePumpForGpu and SharedMemory to ScopedHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed spacing and added Bug ID Created 4 years, 6 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 | « base/message_loop/message_pump_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/persistent_memory_allocator_unittest.cc
diff --git a/base/metrics/persistent_memory_allocator_unittest.cc b/base/metrics/persistent_memory_allocator_unittest.cc
index b8f37078db9269b973e7110c7331b9f80df04fa0..64333389a16ca2e6d2d8f5f03f569e92c4cfbcbd 100644
--- a/base/metrics/persistent_memory_allocator_unittest.cc
+++ b/base/metrics/persistent_memory_allocator_unittest.cc
@@ -497,7 +497,8 @@ TEST(LocalPersistentMemoryAllocatorTest, CreationTest) {
//----- SharedPersistentMemoryAllocator ----------------------------------------
TEST(SharedPersistentMemoryAllocatorTest, CreationTest) {
- SharedMemoryHandle shared_handle;
+ SharedMemoryHandle shared_handle_1;
+ SharedMemoryHandle shared_handle_2;
PersistentMemoryAllocator::MemoryInfo meminfo1;
Reference r123, r456, r789;
@@ -517,13 +518,14 @@ TEST(SharedPersistentMemoryAllocatorTest, CreationTest) {
EXPECT_FALSE(local.IsFull());
EXPECT_FALSE(local.IsCorrupt());
- ASSERT_TRUE(local.shared_memory()->ShareToProcess(
- GetCurrentProcessHandle(),
- &shared_handle));
+ ASSERT_TRUE(local.shared_memory()->ShareToProcess(GetCurrentProcessHandle(),
+ &shared_handle_1));
+ ASSERT_TRUE(local.shared_memory()->ShareToProcess(GetCurrentProcessHandle(),
+ &shared_handle_2));
}
// Read-only test.
- std::unique_ptr<SharedMemory> shmem2(new SharedMemory(shared_handle,
+ std::unique_ptr<SharedMemory> shmem2(new SharedMemory(shared_handle_1,
/*readonly=*/true));
ASSERT_TRUE(shmem2->Map(TEST_MEMORY_SIZE));
@@ -549,7 +551,7 @@ TEST(SharedPersistentMemoryAllocatorTest, CreationTest) {
EXPECT_EQ(meminfo1.free, meminfo2.free);
// Read/write test.
- std::unique_ptr<SharedMemory> shmem3(new SharedMemory(shared_handle,
+ std::unique_ptr<SharedMemory> shmem3(new SharedMemory(shared_handle_2,
/*readonly=*/false));
ASSERT_TRUE(shmem3->Map(TEST_MEMORY_SIZE));
« no previous file with comments | « base/message_loop/message_pump_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698