content/common/gpu/gpu_memory_manager_unittest.cc
// Test GpuMemoryManager::Manage basic functionality.
// Expect memory allocation to set suggest_have_frontbuffer/backbuffer
// according to visibility and last used time for stubs with surface.
// Expect memory allocation to be shared according to share groups for stubs
// without a surface.
Test GpuMemoryManager::Manage basic functionality.
Expect memory allocation to set suggest_have_frontbuffer/backbuffer
according to visibility and last used time for stubs with surface.
Expect memory allocation to be shared according to share groups for stubs
without a surface.
Test GpuMemoryManager :: Manage basic functionality . Expect memory allocation to set suggest_have_frontbuffer / backbuffer according to visibility and last used time for stubs with surface . Expect memory allocation to be shared according to share groups for stubs without a surface .
TEST_F(GpuMemoryManagerTest, TestManageBasicFunctionality) {
  FakeClient stub1(memmgr_, GenerateUniqueSurfaceId(), true, older_),
             stub2(memmgr_, GenerateUniqueSurfaceId(), false, older_);
  Manage();
  EXPECT_TRUE(IsAllocationForegroundForSurfaceYes(stub1.allocation_));
  EXPECT_TRUE(IsAllocationBackgroundForSurfaceYes(stub2.allocation_));
  FakeClient stub3(memmgr_), stub4(memmgr_);
  stub3.SetInSameShareGroup(&stub1);
  stub4.SetInSameShareGroup(&stub2);
  Manage();
  EXPECT_TRUE(IsAllocationForegroundForSurfaceYes(stub1.allocation_));
  EXPECT_TRUE(IsAllocationBackgroundForSurfaceYes(stub2.allocation_));
  EXPECT_TRUE(IsAllocationForegroundForSurfaceNo(stub3.allocation_));
  EXPECT_TRUE(IsAllocationBackgroundForSurfaceNo(stub4.allocation_));
  FakeClient stub5(memmgr_);
  stub5.SetInSameShareGroup(&stub2);
  Manage();
  EXPECT_TRUE(IsAllocationForegroundForSurfaceNo(stub4.allocation_));
}
TEST_F ( GpuMemoryManagerTest , TestManageBasicFunctionality ) { FakeClient stub1 ( memmgr_ , GenerateUniqueSurfaceId ( ) , true , older_ ) , stub2 ( memmgr_ , GenerateUniqueSurfaceId ( ) , false , older_ ) ; Manage ( ) ; EXPECT_TRUE ( IsAllocationForegroundForSurfaceYes ( stub1 . allocation_ ) ) ; EXPECT_TRUE ( IsAllocationBackgroundForSurfaceYes ( stub2 . allocation_ ) ) ; FakeClient stub3 ( memmgr_ ) , stub4 ( memmgr_ ) ; stub3 . SetInSameShareGroup ( & stub1 ) ; stub4 . SetInSameShareGroup ( & stub2 ) ; Manage ( ) ; EXPECT_TRUE ( IsAllocationForegroundForSurfaceYes ( stub1 . allocation_ ) ) ; EXPECT_TRUE ( IsAllocationBackgroundForSurfaceYes ( stub2 . allocation_ ) ) ; EXPECT_TRUE ( IsAllocationForegroundForSurfaceNo ( stub3 . allocation_ ) ) ; EXPECT_TRUE ( IsAllocationBackgroundForSurfaceNo ( stub4 . allocation_ ) ) ; FakeClient stub5 ( memmgr_ ) ; stub5 . SetInSameShareGroup ( & stub2 ) ; Manage ( ) ; EXPECT_TRUE ( IsAllocationForegroundForSurfaceNo ( stub4 . allocation_ ) ) ; }
Test GpuMemoryManager::Manage basic functionality.
Test GpuMemoryManager :: Manage basic functionality .
// Test stubs with surface. // Test stubs without surface, with share group of 1 stub. // Test stub without surface, with share group of multiple stubs.