| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/common/gpu/gpu_memory_allocation.h" | 5 #include "content/common/gpu/gpu_memory_allocation.h" |
| 6 #include "content/common/gpu/gpu_memory_manager.h" | 6 #include "content/common/gpu/gpu_memory_manager.h" |
| 7 #include "content/common/gpu/gpu_memory_tracking.h" | 7 #include "content/common/gpu/gpu_memory_tracking.h" |
| 8 #include "ui/gfx/size_conversions.h" | 8 #include "ui/gfx/size_conversions.h" |
| 9 | 9 |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 11 |
| 12 class FakeMemoryTracker : public gpu::gles2::MemoryTracker { | 12 class FakeMemoryTracker : public gpu::gles2::MemoryTracker { |
| 13 public: | 13 public: |
| 14 void TrackMemoryAllocatedChange(size_t old_size, size_t new_size) { | 14 void TrackMemoryAllocatedChange( |
| 15 size_t old_size, |
| 16 size_t new_size, |
| 17 gpu::gles2::MemoryTracker::Pool pool) { |
| 15 } | 18 } |
| 16 private: | 19 private: |
| 17 ~FakeMemoryTracker() { | 20 ~FakeMemoryTracker() { |
| 18 } | 21 } |
| 19 }; | 22 }; |
| 20 | 23 |
| 21 namespace content { | 24 namespace content { |
| 22 | 25 |
| 23 // This class is used to collect all stub assignments during a | 26 // This class is used to collect all stub assignments during a |
| 24 // Manage() call. | 27 // Manage() call. |
| (...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 878 memmgr_.GetCurrentBackgroundedAvailableGpuMemory()); | 881 memmgr_.GetCurrentBackgroundedAvailableGpuMemory()); |
| 879 EXPECT_EQ(memmgr_.GetCurrentBackgroundedAvailableGpuMemory(), | 882 EXPECT_EQ(memmgr_.GetCurrentBackgroundedAvailableGpuMemory(), |
| 880 stub1.BytesWhenNotVisible()); | 883 stub1.BytesWhenNotVisible()); |
| 881 EXPECT_EQ(0ul, | 884 EXPECT_EQ(0ul, |
| 882 stub2.BytesWhenNotVisible()); | 885 stub2.BytesWhenNotVisible()); |
| 883 EXPECT_EQ(memmgr_.GetCurrentBackgroundedAvailableGpuMemory(), | 886 EXPECT_EQ(memmgr_.GetCurrentBackgroundedAvailableGpuMemory(), |
| 884 stub3.BytesWhenNotVisible()); | 887 stub3.BytesWhenNotVisible()); |
| 885 } | 888 } |
| 886 | 889 |
| 887 } // namespace content | 890 } // namespace content |
| OLD | NEW |