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

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

Issue 12223064: base: Fix parsing and add dalvik-heap-limit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests. Created 7 years, 10 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
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 b9c3727f39eaa5489359e3ab4170bfc7e351c22a..8e422f0c6176b9909a23378d402708fbae4c76e8 100644
--- a/content/common/gpu/gpu_memory_manager_unittest.cc
+++ b/content/common/gpu/gpu_memory_manager_unittest.cc
@@ -226,10 +226,6 @@ class GpuMemoryManagerTest : public testing::Test {
return GpuMemoryManager::CalcAvailableFromGpuTotal(bytes);
}
- uint64 CalcAvailableFromViewportArea(int viewport_area) {
- return GpuMemoryManager::CalcAvailableFromViewportArea(viewport_area);
- }
-
uint64 CalcAvailableClamped(uint64 bytes) {
bytes = std::max(bytes, memmgr_.GetDefaultAvailableGpuMemory());
bytes = std::min(bytes, memmgr_.GetMaximumTotalGpuMemory());
@@ -518,17 +514,10 @@ TEST_F(GpuMemoryManagerTest, TestUpdateAvailableGpuMemory) {
stub2(&memmgr_, GenerateUniqueSurfaceId(), false),
stub3(&memmgr_, GenerateUniqueSurfaceId(), true),
stub4(&memmgr_, GenerateUniqueSurfaceId(), false);
-
-#if defined(OS_ANDROID)
- // We use the largest visible surface size to calculate the limit
- stub1.SetSurfaceSize(gfx::Size(1024, 512)); // Surface size
- stub2.SetSurfaceSize(gfx::Size(2048, 512)); // Larger but not visible.
- stub3.SetSurfaceSize(gfx::Size(512, 512)); // Visible but smaller.
- stub4.SetSurfaceSize(gfx::Size(512, 512)); // Not visible and smaller.
- Manage();
- uint64 bytes_expected = CalcAvailableFromViewportArea(1024*512);
-#else
- // We take the lowest GPU's total memory as the limit
+// On Android the dalvik heap size is used instead.
+// TODO(epenner): We should avoid #ifdefs in this test and use
+// a setting instead, so we can test all platform behavior.
+#if !defined(OS_ANDROID)
uint64 expected = 400 * 1024 * 1024;
stub1.SetTotalGpuMemory(expected); // GPU Memory
stub2.SetTotalGpuMemory(expected - 1024 * 1024); // Smaller but not visible.
@@ -536,8 +525,8 @@ TEST_F(GpuMemoryManagerTest, TestUpdateAvailableGpuMemory) {
stub4.SetTotalGpuMemory(expected + 1024 * 1024); // Not visible and larger.
Manage();
uint64 bytes_expected = CalcAvailableFromGpuTotal(expected);
-#endif
EXPECT_EQ(GetAvailableGpuMemory(), CalcAvailableClamped(bytes_expected));
+#endif
}
« content/common/gpu/gpu_memory_manager.cc ('K') | « 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