content/common/gpu/gpu_memory_manager_unittest.cc
// Test GpuMemoryManager::Manage functionality: Test more than threshold number
// of visible stubs.
// Expect all allocations to continue to have frontbuffer.
Test GpuMemoryManager::Manage functionality: Test more than threshold number
of visible stubs.
Expect all allocations to continue to have frontbuffer.
Test GpuMemoryManager :: Manage functionality : Test more than threshold number of visible stubs . Expect all allocations to continue to have frontbuffer .
TEST_F(GpuMemoryManagerTest, TestManageManyVisibleStubs) {
  FakeClient stub1(memmgr_, GenerateUniqueSurfaceId(), true, older_),
             stub2(memmgr_, GenerateUniqueSurfaceId(), true, older_),
             stub3(memmgr_, GenerateUniqueSurfaceId(), true, older_),
             stub4(memmgr_, GenerateUniqueSurfaceId(), true, older_);
  FakeClient stub5(memmgr_), stub6(memmgr_);
  stub5.SetInSameShareGroup(&stub1);
  stub6.SetInSameShareGroup(&stub2);
  FakeClient stub7(memmgr_);
  stub7.SetInSameShareGroup(&stub2);
  Manage();
  EXPECT_TRUE(IsAllocationForegroundForSurfaceYes(stub1.allocation_));
  EXPECT_TRUE(IsAllocationForegroundForSurfaceYes(stub2.allocation_));
  EXPECT_TRUE(IsAllocationForegroundForSurfaceYes(stub3.allocation_));
  EXPECT_TRUE(IsAllocationForegroundForSurfaceYes(stub4.allocation_));
  EXPECT_TRUE(IsAllocationForegroundForSurfaceNo(stub5.allocation_));
  EXPECT_TRUE(IsAllocationForegroundForSurfaceNo(stub6.allocation_));
  EXPECT_TRUE(IsAllocationForegroundForSurfaceNo(stub7.allocation_));
}
TEST_F ( GpuMemoryManagerTest , TestManageManyVisibleStubs ) { FakeClient stub1 ( memmgr_ , GenerateUniqueSurfaceId ( ) , true , older_ ) , stub2 ( memmgr_ , GenerateUniqueSurfaceId ( ) , true , older_ ) , stub3 ( memmgr_ , GenerateUniqueSurfaceId ( ) , true , older_ ) , stub4 ( memmgr_ , GenerateUniqueSurfaceId ( ) , true , older_ ) ; FakeClient stub5 ( memmgr_ ) , stub6 ( memmgr_ ) ; stub5 . SetInSameShareGroup ( & stub1 ) ; stub6 . SetInSameShareGroup ( & stub2 ) ; FakeClient stub7 ( memmgr_ ) ; stub7 . SetInSameShareGroup ( & stub2 ) ; Manage ( ) ; EXPECT_TRUE ( IsAllocationForegroundForSurfaceYes ( stub1 . allocation_ ) ) ; EXPECT_TRUE ( IsAllocationForegroundForSurfaceYes ( stub2 . allocation_ ) ) ; EXPECT_TRUE ( IsAllocationForegroundForSurfaceYes ( stub3 . allocation_ ) ) ; EXPECT_TRUE ( IsAllocationForegroundForSurfaceYes ( stub4 . allocation_ ) ) ; EXPECT_TRUE ( IsAllocationForegroundForSurfaceNo ( stub5 . allocation_ ) ) ; EXPECT_TRUE ( IsAllocationForegroundForSurfaceNo ( stub6 . allocation_ ) ) ; EXPECT_TRUE ( IsAllocationForegroundForSurfaceNo ( stub7 . allocation_ ) ) ; }
Test GpuMemoryManager::Manage functionality: Test more than threshold number
of visible stubs.
Test GpuMemoryManager :: Manage functionality : Test more than threshold number of visible stubs .