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

Unified Diff: gpu/command_buffer/service/shader_manager_unittest.cc

Issue 10797055: gpu in-memory program cache implementation with a memory limit + lru eviction. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: nit fixes Created 8 years, 5 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/shader_manager.cc ('k') | gpu/command_buffer/service/shader_translator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/shader_manager_unittest.cc
diff --git a/gpu/command_buffer/service/shader_manager_unittest.cc b/gpu/command_buffer/service/shader_manager_unittest.cc
index f927e269790382c6dbda7a21bd66f3572f036c65..3dfd624a881b03aacfd6f507d63b09307b80de48 100644
--- a/gpu/command_buffer/service/shader_manager_unittest.cc
+++ b/gpu/command_buffer/service/shader_manager_unittest.cc
@@ -245,7 +245,39 @@ TEST_F(ShaderManagerTest, ShaderInfoUseCount) {
EXPECT_TRUE(info2 == NULL);
}
-} // namespace gles2
-} // namespace gpu
+TEST_F(ShaderManagerTest, ShaderInfoStoreCompilationStatus) {
+ const GLuint kClientId = 1;
+ const GLuint kServiceId = 11;
+ const GLenum kShaderType = GL_VERTEX_SHADER;
+ ShaderManager::ShaderInfo* info = manager_.CreateShaderInfo(
+ kClientId, kServiceId, kShaderType);
+ ASSERT_TRUE(info != NULL);
+
+ info->UpdateSource("original source");
+ info->FlagSourceAsCompiled(false);
+ EXPECT_FALSE(info->source_compiled());
+ info->FlagSourceAsCompiled(true);
+ EXPECT_TRUE(info->source_compiled());
+}
+
+TEST_F(ShaderManagerTest, ShaderInfoStoreDeferredSource) {
+ const GLuint kClientId = 1;
+ const GLuint kServiceId = 11;
+ const GLenum kShaderType = GL_VERTEX_SHADER;
+ ShaderManager::ShaderInfo* info = manager_.CreateShaderInfo(
+ kClientId, kServiceId, kShaderType);
+ ASSERT_TRUE(info != NULL);
+
+ info->UpdateSource("original source");
+ info->FlagSourceAsCompiled(false);
+
+ EXPECT_EQ("original source", *info->deferred_compilation_source());
+ info->UpdateSource("different!");
+ EXPECT_EQ("original source", *info->deferred_compilation_source());
+ info->FlagSourceAsCompiled(true);
+ EXPECT_EQ("different!", *info->deferred_compilation_source());
+}
+} // namespace gles2
+} // namespace gpu
« no previous file with comments | « gpu/command_buffer/service/shader_manager.cc ('k') | gpu/command_buffer/service/shader_translator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698