Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Side by Side Diff: content/common/gpu/client/gpu_memory_buffer_impl_unittest.cc

Issue 699073004: content: Add command line flag for native GPU memory buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gpu-memory-buffer-impl-unittests
Patch Set: rebase and use correct texture target Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698