content/common/gpu/gpu_memory_manager_unittest.cc
// Test GpuMemoryManager::Manage functionality: Test more than threshold number
// of not visible stubs.
// Expect the stubs surpassing the threshold to not have a backbuffer.
Test GpuMemoryManager::Manage functionality: Test more than threshold number
of not visible stubs.
Expect the stubs surpassing the threshold to not have a backbuffer.
Test GpuMemoryManager :: Manage functionality : Test more than threshold number of not visible stubs . Expect the stubs surpassing the threshold to not have a backbuffer .
TEST_F(GpuMemoryManagerTest, TestManageManyNotVisibleStubs) {
  FakeClient stub1(memmgr_, GenerateUniqueSurfaceId(), false, newer_),
             stub2(memmgr_, GenerateUniqueSurfaceId(), false, newer_),
             stub3(memmgr_, GenerateUniqueSurfaceId(), false, newer_),
             stub4(memmgr_, GenerateUniqueSurfaceId(), false, older_);
  FakeClient stub5(memmgr_), stub6(memmgr_);
  stub5.SetInSameShareGroup(&stub1);
  stub6.SetInSameShareGroup(&stub4);
  FakeClient stub7(memmgr_);
  stub7.SetInSameShareGroup(&stub1);
  Manage();
  EXPECT_TRUE(IsAllocationBackgroundForSurfaceYes(stub1.allocation_));
  EXPECT_TRUE(IsAllocationBackgroundForSurfaceYes(stub2.allocation_));
  EXPECT_TRUE(IsAllocationBackgroundForSurfaceYes(stub3.allocation_));
  EXPECT_TRUE(IsAllocationHibernatedForSurfaceYes(stub4.allocation_));
  EXPECT_TRUE(IsAllocationBackgroundForSurfaceNo(stub5.allocation_));
  EXPECT_TRUE(IsAllocationHibernatedForSurfaceNo(stub6.allocation_));
  EXPECT_TRUE(IsAllocationBackgroundForSurfaceNo(stub7.allocation_));
}
TEST_F ( GpuMemoryManagerTest , TestManageManyNotVisibleStubs ) { FakeClient stub1 ( memmgr_ , GenerateUniqueSurfaceId ( ) , false , newer_ ) , stub2 ( memmgr_ , GenerateUniqueSurfaceId ( ) , false , newer_ ) , stub3 ( memmgr_ , GenerateUniqueSurfaceId ( ) , false , newer_ ) , stub4 ( memmgr_ , GenerateUniqueSurfaceId ( ) , false , older_ ) ; FakeClient stub5 ( memmgr_ ) , stub6 ( memmgr_ ) ; stub5 . SetInSameShareGroup ( & stub1 ) ; stub6 . SetInSameShareGroup ( & stub4 ) ; FakeClient stub7 ( memmgr_ ) ; stub7 . SetInSameShareGroup ( & stub1 ) ; Manage ( ) ; EXPECT_TRUE ( IsAllocationBackgroundForSurfaceYes ( stub1 . allocation_ ) ) ; EXPECT_TRUE ( IsAllocationBackgroundForSurfaceYes ( stub2 . allocation_ ) ) ; EXPECT_TRUE ( IsAllocationBackgroundForSurfaceYes ( stub3 . allocation_ ) ) ; EXPECT_TRUE ( IsAllocationHibernatedForSurfaceYes ( stub4 . allocation_ ) ) ; EXPECT_TRUE ( IsAllocationBackgroundForSurfaceNo ( stub5 . allocation_ ) ) ; EXPECT_TRUE ( IsAllocationHibernatedForSurfaceNo ( stub6 . allocation_ ) ) ; EXPECT_TRUE ( IsAllocationBackgroundForSurfaceNo ( stub7 . allocation_ ) ) ; }
Test GpuMemoryManager::Manage functionality: Test more than threshold number
of not visible stubs.
Test GpuMemoryManager :: Manage functionality : Test more than threshold number of not visible stubs .