OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "cc/proto/gpu_conversions.h" | 5 #include "cc/proto/gpu_conversions.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 |
7 #include "cc/proto/memory_allocation.pb.h" | 9 #include "cc/proto/memory_allocation.pb.h" |
8 #include "gpu/command_buffer/common/gpu_memory_allocation.h" | 10 #include "gpu/command_buffer/common/gpu_memory_allocation.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
10 | 12 |
11 namespace cc { | 13 namespace cc { |
12 namespace { | 14 namespace { |
13 | 15 |
14 TEST(GpuProtoConversionTest, | 16 TEST(GpuProtoConversionTest, |
15 SerializeDeserializeMemoryAllocationPriorityCutoff) { | 17 SerializeDeserializeMemoryAllocationPriorityCutoff) { |
16 for (size_t i = 0; i < gpu::MemoryAllocation::PriorityCutoff::CUTOFF_LAST; | 18 for (size_t i = 0; i < gpu::MemoryAllocation::PriorityCutoff::CUTOFF_LAST; |
17 ++i) { | 19 ++i) { |
18 gpu::MemoryAllocation::PriorityCutoff priority_cutoff = | 20 gpu::MemoryAllocation::PriorityCutoff priority_cutoff = |
19 static_cast<gpu::MemoryAllocation::PriorityCutoff>(i); | 21 static_cast<gpu::MemoryAllocation::PriorityCutoff>(i); |
20 EXPECT_EQ(priority_cutoff, | 22 EXPECT_EQ(priority_cutoff, |
21 MemoryAllocationPriorityCutoffFromProto( | 23 MemoryAllocationPriorityCutoffFromProto( |
22 MemoryAllocationPriorityCutoffToProto(priority_cutoff))); | 24 MemoryAllocationPriorityCutoffToProto(priority_cutoff))); |
23 } | 25 } |
24 } | 26 } |
25 | 27 |
26 } // namespace | 28 } // namespace |
27 } // namespace cc | 29 } // namespace cc |
OLD | NEW |