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

Unified Diff: base/memory/discardable_shared_memory_unittest.cc

Issue 851503003: Update from https://crrev.com/311076 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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/memory/discardable_shared_memory.cc ('k') | base/message_loop/message_loop_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/discardable_shared_memory_unittest.cc
diff --git a/base/memory/discardable_shared_memory_unittest.cc b/base/memory/discardable_shared_memory_unittest.cc
index 90441e1f35f47f8ab4db8eb79d5fe8998bf5e12f..896263df60927b6df3aaba8a3628f5ea5a203f81 100644
--- a/base/memory/discardable_shared_memory_unittest.cc
+++ b/base/memory/discardable_shared_memory_unittest.cc
@@ -287,5 +287,19 @@ TEST(DiscardableSharedMemoryTest, LockAndUnlockRange) {
EXPECT_TRUE(rv);
}
+TEST(DiscardableSharedMemoryTest, MappedSize) {
+ const uint32 kDataSize = 1024;
+
+ TestDiscardableSharedMemory memory;
+ bool rv = memory.CreateAndMap(kDataSize);
+ ASSERT_TRUE(rv);
+
+ EXPECT_LE(kDataSize, memory.mapped_size());
+
+ // Mapped size should be 0 after memory segment has been closed.
+ memory.Close();
+ EXPECT_EQ(0u, memory.mapped_size());
+}
+
} // namespace
} // namespace base
« no previous file with comments | « base/memory/discardable_shared_memory.cc ('k') | base/message_loop/message_loop_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698