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

Unified Diff: content/common/host_discardable_shared_memory_manager_unittest.cc

Issue 871043003: base: Improve DiscardableSharedMemory support for ashmem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add missing return statement 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 | « content/child/child_discardable_shared_memory_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/host_discardable_shared_memory_manager_unittest.cc
diff --git a/content/common/host_discardable_shared_memory_manager_unittest.cc b/content/common/host_discardable_shared_memory_manager_unittest.cc
index 699fdd523b415d9393347f411d448d46a61754e3..fc47e13eaa17b7ada961b6feafb8c278c3f05692 100644
--- a/content/common/host_discardable_shared_memory_manager_unittest.cc
+++ b/content/common/host_discardable_shared_memory_manager_unittest.cc
@@ -78,7 +78,7 @@ TEST_F(HostDiscardableSharedMemoryManagerTest, AllocateForChild) {
memory.SetNow(base::Time::FromDoubleT(1));
memory.Unlock(0, 0);
- ASSERT_TRUE(memory.Lock(0, 0));
+ ASSERT_EQ(base::DiscardableSharedMemory::SUCCESS, memory.Lock(0, 0));
EXPECT_EQ(memcmp(data, memory.memory(), kDataSize), 0);
memory.Unlock(0, 0);
}
@@ -122,10 +122,10 @@ TEST_F(HostDiscardableSharedMemoryManagerTest, Purge) {
EXPECT_TRUE(memory1.IsMemoryResident());
EXPECT_TRUE(memory2.IsMemoryResident());
- rv = memory1.Lock(0, 0);
- EXPECT_TRUE(rv);
- rv = memory2.Lock(0, 0);
- EXPECT_TRUE(rv);
+ auto lock_rv = memory1.Lock(0, 0);
+ EXPECT_EQ(base::DiscardableSharedMemory::SUCCESS, lock_rv);
+ lock_rv = memory2.Lock(0, 0);
+ EXPECT_EQ(base::DiscardableSharedMemory::SUCCESS, lock_rv);
memory1.SetNow(base::Time::FromDoubleT(4));
memory1.Unlock(0, 0);
@@ -141,10 +141,10 @@ TEST_F(HostDiscardableSharedMemoryManagerTest, Purge) {
EXPECT_FALSE(memory1.IsMemoryResident());
EXPECT_TRUE(memory2.IsMemoryResident());
- rv = memory1.Lock(0, 0);
- EXPECT_FALSE(rv);
- rv = memory2.Lock(0, 0);
- EXPECT_TRUE(rv);
+ lock_rv = memory1.Lock(0, 0);
+ EXPECT_EQ(base::DiscardableSharedMemory::FAILED, lock_rv);
+ lock_rv = memory2.Lock(0, 0);
+ EXPECT_EQ(base::DiscardableSharedMemory::SUCCESS, lock_rv);
}
TEST_F(HostDiscardableSharedMemoryManagerTest, EnforceMemoryPolicy) {
@@ -181,7 +181,7 @@ TEST_F(HostDiscardableSharedMemoryManagerTest, EnforceMemoryPolicy) {
// Memory policy should have successfully been enforced.
EXPECT_FALSE(manager_->enforce_memory_policy_pending());
- EXPECT_FALSE(memory.Lock(0, 0));
+ EXPECT_EQ(base::DiscardableSharedMemory::FAILED, memory.Lock(0, 0));
}
} // namespace
« no previous file with comments | « content/child/child_discardable_shared_memory_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698