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

Side by Side Diff: gpu/command_buffer/client/id_allocator_test.cc

Issue 367002: Added Pepper 3D render context that instantiates the GPU plugin.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years 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 | Annotate | Revision Log
« no previous file with comments | « gpu/command_buffer/client/id_allocator.h ('k') | gpu/command_buffer/common/buffer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 // This file has the unit tests for the IdAllocator class. 5 // This file has the unit tests for the IdAllocator class.
6 6
7 #include "gpu/command_buffer/client/id_allocator.h" 7 #include "gpu/command_buffer/client/id_allocator.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace gpu { 10 namespace gpu {
11 11
12 using gpu::ResourceId;
13
14 class IdAllocatorTest : public testing::Test { 12 class IdAllocatorTest : public testing::Test {
15 protected: 13 protected:
16 virtual void SetUp() {} 14 virtual void SetUp() {}
17 virtual void TearDown() {} 15 virtual void TearDown() {}
18 16
19 IdAllocator* id_allocator() { return &id_allocator_; } 17 IdAllocator* id_allocator() { return &id_allocator_; }
20 18
21 private: 19 private:
22 IdAllocator id_allocator_; 20 IdAllocator id_allocator_;
23 }; 21 };
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 // Check that a new allocation re-uses the resource we just freed. 73 // Check that a new allocation re-uses the resource we just freed.
76 ResourceId id1 = ids[kNumResources / 2]; 74 ResourceId id1 = ids[kNumResources / 2];
77 allocator->FreeID(id1); 75 allocator->FreeID(id1);
78 EXPECT_FALSE(allocator->InUse(id1)); 76 EXPECT_FALSE(allocator->InUse(id1));
79 ResourceId id2 = allocator->AllocateID(); 77 ResourceId id2 = allocator->AllocateID();
80 EXPECT_TRUE(allocator->InUse(id2)); 78 EXPECT_TRUE(allocator->InUse(id2));
81 EXPECT_EQ(id1, id2); 79 EXPECT_EQ(id1, id2);
82 } 80 }
83 81
84 } // namespace gpu 82 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/id_allocator.h ('k') | gpu/command_buffer/common/buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698