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

Unified Diff: content/common/gpu/gpu_memory_manager_unittest.cc

Issue 10827342: Reduce per-tab memory to 128M maximum, reduce default maximum across all tabs to 256M (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Actually drop the limit to 256MB Created 8 years, 4 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/common/gpu/gpu_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/gpu/gpu_memory_manager_unittest.cc
diff --git a/content/common/gpu/gpu_memory_manager_unittest.cc b/content/common/gpu/gpu_memory_manager_unittest.cc
index 3336cc2a264ea9f9c6d52c5def159952cdea38b7..d06aa6900ecf2cf977e1a674ce6446374483726f 100644
--- a/content/common/gpu/gpu_memory_manager_unittest.cc
+++ b/content/common/gpu/gpu_memory_manager_unittest.cc
@@ -159,6 +159,10 @@ class GpuMemoryManagerTest : public testing::Test {
return memory_manager_.GetAvailableGpuMemory();
}
+ size_t GetMaximumTabAllocation() {
+ return memory_manager_.GetMaximumTabAllocation();
+ }
+
size_t GetMinimumTabAllocation() {
return memory_manager_.GetMinimumTabAllocation();
}
@@ -639,7 +643,8 @@ TEST_F(GpuMemoryManagerTest, StubMemoryStatsForLastManageTests) {
EXPECT_TRUE(stats[&stub2].visible);
EXPECT_GT(stub1allocation2, 0ul);
EXPECT_GT(stub2allocation2, 0ul);
- if (compositors_get_bonus_allocation)
+ if (compositors_get_bonus_allocation &&
+ stub1allocation2 != GetMaximumTabAllocation())
EXPECT_LT(stub1allocation2, stub1allocation1);
FakeCommandBufferStub stub3(GenerateUniqueSurfaceId(), true, older_);
@@ -647,7 +652,7 @@ TEST_F(GpuMemoryManagerTest, StubMemoryStatsForLastManageTests) {
Manage();
stats = memory_manager_.stub_memory_stats_for_last_manage();
size_t stub1allocation3 = stats[&stub1].allocation.gpu_resource_size_in_bytes;
- size_t stub2allocation3 = stats[&stub1].allocation.gpu_resource_size_in_bytes;
+ size_t stub2allocation3 = stats[&stub2].allocation.gpu_resource_size_in_bytes;
size_t stub3allocation3 = stats[&stub3].allocation.gpu_resource_size_in_bytes;
EXPECT_EQ(stats.size(), 3ul);
@@ -657,7 +662,8 @@ TEST_F(GpuMemoryManagerTest, StubMemoryStatsForLastManageTests) {
EXPECT_GT(stub1allocation3, 0ul);
EXPECT_GT(stub2allocation3, 0ul);
EXPECT_GT(stub3allocation3, 0ul);
- if (compositors_get_bonus_allocation)
+ if (compositors_get_bonus_allocation &&
+ stub1allocation3 != GetMaximumTabAllocation())
EXPECT_LT(stub1allocation3, stub1allocation2);
stub1.surface_state_.visible = false;
@@ -674,6 +680,7 @@ TEST_F(GpuMemoryManagerTest, StubMemoryStatsForLastManageTests) {
EXPECT_EQ(stub1allocation4, 0ul);
EXPECT_GE(stub2allocation4, 0ul);
EXPECT_GT(stub3allocation4, 0ul);
- if (compositors_get_bonus_allocation)
+ if (compositors_get_bonus_allocation &&
+ stub3allocation3 != GetMaximumTabAllocation())
EXPECT_GT(stub3allocation4, stub3allocation3);
}
« no previous file with comments | « content/common/gpu/gpu_memory_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698