| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_buffer_factory.h" | 5 #include "content/common/gpu/gpu_memory_buffer_factory.h" |
| 6 | 6 |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 8 |
| 9 namespace content { | 9 namespace content { |
| 10 namespace { | 10 namespace { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 kBufferId, buffer_size, configuration.format, configuration.usage, | 38 kBufferId, buffer_size, configuration.format, configuration.usage, |
| 39 kClientId, gfx::kNullPluginWindow); | 39 kClientId, gfx::kNullPluginWindow); |
| 40 EXPECT_EQ(handle.type, GetParam()); | 40 EXPECT_EQ(handle.type, GetParam()); |
| 41 factory_->DestroyGpuMemoryBuffer(kBufferId, kClientId); | 41 factory_->DestroyGpuMemoryBuffer(kBufferId, kClientId); |
| 42 } | 42 } |
| 43 } | 43 } |
| 44 | 44 |
| 45 std::vector<gfx::GpuMemoryBufferType> | 45 std::vector<gfx::GpuMemoryBufferType> |
| 46 GetSupportedGpuMemoryBufferFactoryTypes() { | 46 GetSupportedGpuMemoryBufferFactoryTypes() { |
| 47 std::vector<gfx::GpuMemoryBufferType> supported_types; | 47 std::vector<gfx::GpuMemoryBufferType> supported_types; |
| 48 GpuMemoryBufferFactory::GetSupportedTypes(&supported_types); | 48 GpuMemoryBufferFactory::GetSupportedTypes(gfx::GpuMemoryBuffer::MAP, |
| 49 &supported_types); |
| 50 |
| 51 std::vector<gfx::GpuMemoryBufferType> persistent_supported_types; |
| 52 GpuMemoryBufferFactory::GetSupportedTypes( |
| 53 gfx::GpuMemoryBuffer::PERSISTENT_MAP, &persistent_supported_types); |
| 54 supported_types.insert(supported_types.end(), |
| 55 persistent_supported_types.begin(), |
| 56 persistent_supported_types.end()); |
| 57 |
| 49 return supported_types; | 58 return supported_types; |
| 50 } | 59 } |
| 51 | 60 |
| 52 INSTANTIATE_TEST_CASE_P( | 61 INSTANTIATE_TEST_CASE_P( |
| 53 GpuMemoryBufferFactoryTests, | 62 GpuMemoryBufferFactoryTests, |
| 54 GpuMemoryBufferFactoryTest, | 63 GpuMemoryBufferFactoryTest, |
| 55 ::testing::ValuesIn(GetSupportedGpuMemoryBufferFactoryTypes())); | 64 ::testing::ValuesIn(GetSupportedGpuMemoryBufferFactoryTypes())); |
| 56 | 65 |
| 57 } // namespace | 66 } // namespace |
| 58 } // namespace content | 67 } // namespace content |
| OLD | NEW |