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

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

Issue 6733045: Merge 79130 - Fix bug in shader and program managers. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/696/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/program_manager.cc ('k') | gpu/command_buffer/service/shader_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/program_manager_unittest.cc
===================================================================
--- gpu/command_buffer/service/program_manager_unittest.cc (revision 79346)
+++ gpu/command_buffer/service/program_manager_unittest.cc (working copy)
@@ -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.
@@ -86,6 +86,27 @@
ASSERT_TRUE(info1 == NULL);
}
+TEST_F(ProgramManagerTest, DeleteBug) {
+ ShaderManager shader_manager;
+ const GLuint kClient1Id = 1;
+ const GLuint kClient2Id = 2;
+ const GLuint kService1Id = 11;
+ const GLuint kService2Id = 12;
+ // Check we can create program.
+ manager_.CreateProgramInfo(kClient1Id, kService1Id);
+ manager_.CreateProgramInfo(kClient2Id, kService2Id);
+ // Check program got created.
+ ProgramManager::ProgramInfo::Ref info1(manager_.GetProgramInfo(kClient1Id));
+ ProgramManager::ProgramInfo::Ref info2(manager_.GetProgramInfo(kClient2Id));
+ ASSERT_TRUE(info1.get() != NULL);
+ ASSERT_TRUE(info2.get() != NULL);
+ manager_.UseProgram(info1);
+ manager_.MarkAsDeleted(&shader_manager, info1);
+ manager_.MarkAsDeleted(&shader_manager, info2);
+ EXPECT_TRUE(manager_.IsOwned(info1));
+ EXPECT_FALSE(manager_.IsOwned(info2));
+}
+
TEST_F(ProgramManagerTest, ProgramInfo) {
const GLuint kClient1Id = 1;
const GLuint kService1Id = 11;
« no previous file with comments | « gpu/command_buffer/service/program_manager.cc ('k') | gpu/command_buffer/service/shader_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698