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

Side by Side Diff: gpu/command_buffer/common/command_buffer_shared_test.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 // This file contains the tests for the CommandBufferSharedState class. 5 // This file contains the tests for the CommandBufferSharedState class.
6 6
7 #include "gpu/command_buffer/common/command_buffer_shared.h" 7 #include "gpu/command_buffer/common/command_buffer_shared.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/threading/thread.h" 10 #include "base/threading/thread.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 state.error = static_cast<gpu::error::Error>(i + 3); 48 state.error = static_cast<gpu::error::Error>(i + 3);
49 // Ensure that the producer doesn't update the buffer until after the 49 // Ensure that the producer doesn't update the buffer until after the
50 // consumer reads from it. 50 // consumer reads from it.
51 EXPECT_EQ(buffer[i], 0); 51 EXPECT_EQ(buffer[i], 0);
52 52
53 shared_state->Write(state); 53 shared_state->Write(state);
54 } 54 }
55 } 55 }
56 56
57 TEST_F(CommandBufferSharedTest, TestConsistency) { 57 TEST_F(CommandBufferSharedTest, TestConsistency) {
58 scoped_array<int32> buffer; 58 scoped_ptr<int32[]> buffer;
59 buffer.reset(new int32[kSize]); 59 buffer.reset(new int32[kSize]);
60 base::Thread consumer("Reader Thread"); 60 base::Thread consumer("Reader Thread");
61 61
62 memset(buffer.get(), 0, kSize * sizeof(int32)); 62 memset(buffer.get(), 0, kSize * sizeof(int32));
63 63
64 consumer.Start(); 64 consumer.Start();
65 consumer.message_loop()->PostTask( 65 consumer.message_loop()->PostTask(
66 FROM_HERE, base::Bind(&WriteToState, buffer.get(), 66 FROM_HERE, base::Bind(&WriteToState, buffer.get(),
67 shared_state_.get())); 67 shared_state_.get()));
68 68
(...skipping 18 matching lines...) Expand all
87 EXPECT_EQ(state.error, state.get_offset + 2); 87 EXPECT_EQ(state.error, state.get_offset + 2);
88 88
89 if (state.get_offset == kSize) 89 if (state.get_offset == kSize)
90 break; 90 break;
91 } 91 }
92 } 92 }
93 } 93 }
94 94
95 } // namespace gpu 95 } // namespace gpu
96 96
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/ring_buffer_test.cc ('k') | gpu/command_buffer/service/buffer_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698