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

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

Issue 6721010: Fix bug in shader and program managers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 9 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') | no next file » | 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 c3c084de3df478bd7731cbd0da4149db13576ae5..da82cbcc321b2ec7cd91d9d6c81190dfa0b85cce 100644
--- a/gpu/command_buffer/service/shader_manager_unittest.cc
+++ b/gpu/command_buffer/service/shader_manager_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -75,6 +75,26 @@ TEST_F(ShaderManagerTest, Destroy) {
ASSERT_TRUE(info1 == NULL);
}
+TEST_F(ShaderManagerTest, DeleteBug) {
+ const GLuint kClient1Id = 1;
+ const GLuint kClient2Id = 2;
+ const GLuint kService1Id = 11;
+ const GLuint kService2Id = 12;
+ const GLenum kShaderType = GL_VERTEX_SHADER;
+ // Check we can create shader.
+ manager_.CreateShaderInfo(kClient1Id, kService1Id, kShaderType);
+ manager_.CreateShaderInfo(kClient2Id, kService2Id, kShaderType);
+ ShaderManager::ShaderInfo::Ref info1(manager_.GetShaderInfo(kClient1Id));
+ ShaderManager::ShaderInfo::Ref info2(manager_.GetShaderInfo(kClient2Id));
+ ASSERT_TRUE(info1.get() != NULL);
+ ASSERT_TRUE(info2.get() != NULL);
+ manager_.UseShader(info1);
+ manager_.MarkAsDeleted(info1);
+ manager_.MarkAsDeleted(info2);
+ EXPECT_TRUE(manager_.IsOwned(info1));
+ EXPECT_FALSE(manager_.IsOwned(info2));
+}
+
TEST_F(ShaderManagerTest, ShaderInfo) {
const GLuint kClient1Id = 1;
const GLuint kService1Id = 11;
« no previous file with comments | « gpu/command_buffer/service/shader_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698