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

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

Issue 13454036: Rewrite scoped_array<T> to scoped_ptr<T[]> in gpu/, Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Yikes Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "gpu/command_buffer/client/mapped_memory.h" 5 #include "gpu/command_buffer/client/mapped_memory.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "gpu/command_buffer/client/cmd_buffer_helper.h" 9 #include "gpu/command_buffer/client/cmd_buffer_helper.h"
10 #include "gpu/command_buffer/service/mocks.h" 10 #include "gpu/command_buffer/service/mocks.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 } 101 }
102 102
103 virtual void TearDown() { 103 virtual void TearDown() {
104 // If the GpuScheduler posts any tasks, this forces them to run. 104 // If the GpuScheduler posts any tasks, this forces them to run.
105 MessageLoop::current()->RunUntilIdle(); 105 MessageLoop::current()->RunUntilIdle();
106 106
107 MappedMemoryTestBase::TearDown(); 107 MappedMemoryTestBase::TearDown();
108 } 108 }
109 109
110 scoped_ptr<MemoryChunk> chunk_; 110 scoped_ptr<MemoryChunk> chunk_;
111 scoped_array<uint8> buffer_; 111 scoped_ptr<uint8[]> buffer_;
112 }; 112 };
113 113
114 #ifndef _MSC_VER 114 #ifndef _MSC_VER
115 const int32 MemoryChunkTest::kShmId; 115 const int32 MemoryChunkTest::kShmId;
116 #endif 116 #endif
117 117
118 TEST_F(MemoryChunkTest, Basic) { 118 TEST_F(MemoryChunkTest, Basic) {
119 const unsigned int kSize = 16; 119 const unsigned int kSize = 16;
120 EXPECT_EQ(kShmId, chunk_->shm_id()); 120 EXPECT_EQ(kShmId, chunk_->shm_id());
121 EXPECT_EQ(kBufferSize, chunk_->GetLargestFreeSizeWithoutWaiting()); 121 EXPECT_EQ(kBufferSize, chunk_->GetLargestFreeSizeWithoutWaiting());
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 ASSERT_TRUE(mem3); 299 ASSERT_TRUE(mem3);
300 EXPECT_NE(-1, id1); 300 EXPECT_NE(-1, id1);
301 EXPECT_EQ(id1, id2); 301 EXPECT_EQ(id1, id2);
302 EXPECT_NE(id2, id3); 302 EXPECT_NE(id2, id3);
303 EXPECT_EQ(0u, offset1); 303 EXPECT_EQ(0u, offset1);
304 EXPECT_EQ(kSize, offset2); 304 EXPECT_EQ(kSize, offset2);
305 EXPECT_EQ(0u, offset3); 305 EXPECT_EQ(0u, offset3);
306 } 306 }
307 307
308 } // namespace gpu 308 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/fenced_allocator_test.cc ('k') | gpu/command_buffer/client/ring_buffer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698