| 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_command_buffer_stub.h" | 5 #include "content/common/gpu/gpu_command_buffer_stub.h" |
| 6 #include "content/common/gpu/gpu_memory_allocation.h" | 6 #include "content/common/gpu/gpu_memory_allocation.h" |
| 7 #include "content/common/gpu/gpu_memory_manager.h" | 7 #include "content/common/gpu/gpu_memory_manager.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 namespace content { |
| 13 |
| 12 class FakeCommandBufferStub : public GpuCommandBufferStubBase { | 14 class FakeCommandBufferStub : public GpuCommandBufferStubBase { |
| 13 public: | 15 public: |
| 14 MemoryManagerState memory_manager_state_; | 16 MemoryManagerState memory_manager_state_; |
| 15 GpuMemoryAllocation allocation_; | 17 GpuMemoryAllocation allocation_; |
| 16 gfx::Size size_; | 18 gfx::Size size_; |
| 17 | 19 |
| 18 FakeCommandBufferStub() | 20 FakeCommandBufferStub() |
| 19 : memory_manager_state_(0, false, base::TimeTicks()) { | 21 : memory_manager_state_(0, false, base::TimeTicks()) { |
| 20 memory_manager_state_.client_has_memory_allocation_changed_callback = true; | 22 memory_manager_state_.client_has_memory_allocation_changed_callback = true; |
| 21 } | 23 } |
| (...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 EXPECT_FALSE(stats[&stub1].visible); | 677 EXPECT_FALSE(stats[&stub1].visible); |
| 676 EXPECT_FALSE(stats[&stub2].visible); | 678 EXPECT_FALSE(stats[&stub2].visible); |
| 677 EXPECT_TRUE(stats[&stub3].visible); | 679 EXPECT_TRUE(stats[&stub3].visible); |
| 678 EXPECT_EQ(stub1allocation4, 0ul); | 680 EXPECT_EQ(stub1allocation4, 0ul); |
| 679 EXPECT_GE(stub2allocation4, 0ul); | 681 EXPECT_GE(stub2allocation4, 0ul); |
| 680 EXPECT_GT(stub3allocation4, 0ul); | 682 EXPECT_GT(stub3allocation4, 0ul); |
| 681 if (compositors_get_bonus_allocation && | 683 if (compositors_get_bonus_allocation && |
| 682 stub3allocation3 != GetMaximumTabAllocation()) | 684 stub3allocation3 != GetMaximumTabAllocation()) |
| 683 EXPECT_GT(stub3allocation4, stub3allocation3); | 685 EXPECT_GT(stub3allocation4, stub3allocation3); |
| 684 } | 686 } |
| 687 |
| 688 } // namespace content |
| OLD | NEW |