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/client/gpu_memory_buffer_impl.h" | 5 #include "content/common/gpu/client/gpu_memory_buffer_impl.h" |
6 | 6 |
7 #if defined(OS_ANDROID) | 7 #if defined(OS_ANDROID) |
8 #include <android/native_window_jni.h> | 8 #include <android/native_window_jni.h> |
9 #include <map> | 9 #include <map> |
10 #endif | 10 #endif |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 factory_->DestroyGpuMemoryBuffer(type, id, client_id); | 90 factory_->DestroyGpuMemoryBuffer(type, id, client_id); |
91 } | 91 } |
92 | 92 |
93 private: | 93 private: |
94 scoped_ptr<GpuMemoryBufferFactory> factory_; | 94 scoped_ptr<GpuMemoryBufferFactory> factory_; |
95 #if defined(OS_ANDROID) | 95 #if defined(OS_ANDROID) |
96 SurfaceTextureManagerImpl surface_texture_manager_; | 96 SurfaceTextureManagerImpl surface_texture_manager_; |
97 #endif | 97 #endif |
98 }; | 98 }; |
99 | 99 |
| 100 TEST_P(GpuMemoryBufferImplTest, IsNamed) { |
| 101 std::string type_name(GpuMemoryBufferImpl::GetTypeName(GetParam())); |
| 102 EXPECT_NE("unknown", type_name); |
| 103 EXPECT_EQ(GetParam(), GpuMemoryBufferImpl::GetNamedType(type_name)); |
| 104 } |
| 105 |
100 struct CreateRequest { | 106 struct CreateRequest { |
101 scoped_ptr<GpuMemoryBufferImpl> result; | 107 scoped_ptr<GpuMemoryBufferImpl> result; |
102 }; | 108 }; |
103 | 109 |
104 void GpuMemoryBufferCreated(CreateRequest* request, | 110 void GpuMemoryBufferCreated(CreateRequest* request, |
105 scoped_ptr<GpuMemoryBufferImpl> buffer) { | 111 scoped_ptr<GpuMemoryBufferImpl> buffer) { |
106 request->result = buffer.Pass(); | 112 request->result = buffer.Pass(); |
107 } | 113 } |
108 | 114 |
109 TEST_P(GpuMemoryBufferImplTest, Create) { | 115 TEST_P(GpuMemoryBufferImplTest, Create) { |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 return supported_types; | 284 return supported_types; |
279 } | 285 } |
280 | 286 |
281 INSTANTIATE_TEST_CASE_P( | 287 INSTANTIATE_TEST_CASE_P( |
282 GpuMemoryBufferImplTests, | 288 GpuMemoryBufferImplTests, |
283 GpuMemoryBufferImplTest, | 289 GpuMemoryBufferImplTest, |
284 ::testing::ValuesIn(GetSupportedGpuMemoryBufferTypes())); | 290 ::testing::ValuesIn(GetSupportedGpuMemoryBufferTypes())); |
285 | 291 |
286 } // namespace | 292 } // namespace |
287 } // namespace content | 293 } // namespace content |
OLD | NEW |