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

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

Issue 1859703002: convert //gpu to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: undo part of clang-format Created 4 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
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 // Tests for the Command Buffer Helper. 5 // Tests for the Command Buffer Helper.
6 6
7 #include "gpu/command_buffer/client/transfer_buffer.h" 7 #include "gpu/command_buffer/client/transfer_buffer.h"
8 8
9 #include <stddef.h> 9 #include <stddef.h>
10 #include <stdint.h> 10 #include <stdint.h>
11 11
no sievers 2016/04/05 19:02:40 #include <memory>
Mostyn Bramley-Moore 2016/04/05 21:35:31 Done.
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "gpu/command_buffer/client/client_test_helper.h" 13 #include "gpu/command_buffer/client/client_test_helper.h"
14 #include "gpu/command_buffer/client/cmd_buffer_helper.h" 14 #include "gpu/command_buffer/client/cmd_buffer_helper.h"
15 #include "gpu/command_buffer/common/command_buffer.h" 15 #include "gpu/command_buffer/common/command_buffer.h"
16 #include "testing/gmock/include/gmock/gmock.h" 16 #include "testing/gmock/include/gmock/gmock.h"
17 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
18 18
19 using ::testing::_; 19 using ::testing::_;
20 using ::testing::AtMost; 20 using ::testing::AtMost;
21 using ::testing::Invoke; 21 using ::testing::Invoke;
(...skipping 27 matching lines...) Expand all
49 kTransferBufferSize, 49 kTransferBufferSize,
50 kTransferBufferSize, 50 kTransferBufferSize,
51 kAlignment, 51 kAlignment,
52 size_to_flush)); 52 size_to_flush));
53 } 53 }
54 54
55 MockClientCommandBufferMockFlush* command_buffer() const { 55 MockClientCommandBufferMockFlush* command_buffer() const {
56 return command_buffer_.get(); 56 return command_buffer_.get();
57 } 57 }
58 58
59 scoped_ptr<MockClientCommandBufferMockFlush> command_buffer_; 59 std::unique_ptr<MockClientCommandBufferMockFlush> command_buffer_;
60 scoped_ptr<CommandBufferHelper> helper_; 60 std::unique_ptr<CommandBufferHelper> helper_;
61 scoped_ptr<TransferBuffer> transfer_buffer_; 61 std::unique_ptr<TransferBuffer> transfer_buffer_;
62 int32_t transfer_buffer_id_; 62 int32_t transfer_buffer_id_;
63 }; 63 };
64 64
65 void TransferBufferTest::SetUp() { 65 void TransferBufferTest::SetUp() {
66 command_buffer_.reset(new StrictMock<MockClientCommandBufferMockFlush>()); 66 command_buffer_.reset(new StrictMock<MockClientCommandBufferMockFlush>());
67 ASSERT_TRUE(command_buffer_->Initialize()); 67 ASSERT_TRUE(command_buffer_->Initialize());
68 68
69 helper_.reset(new CommandBufferHelper(command_buffer())); 69 helper_.reset(new CommandBufferHelper(command_buffer()));
70 ASSERT_TRUE(helper_->Initialize(kCommandBufferSizeBytes)); 70 ASSERT_TRUE(helper_->Initialize(kCommandBufferSizeBytes));
71 71
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 : transfer_buffer_id_(0) { 253 : transfer_buffer_id_(0) {
254 } 254 }
255 255
256 void SetUp() override; 256 void SetUp() override;
257 void TearDown() override; 257 void TearDown() override;
258 258
259 MockClientCommandBufferCanFail* command_buffer() const { 259 MockClientCommandBufferCanFail* command_buffer() const {
260 return command_buffer_.get(); 260 return command_buffer_.get();
261 } 261 }
262 262
263 scoped_ptr<MockClientCommandBufferCanFail> command_buffer_; 263 std::unique_ptr<MockClientCommandBufferCanFail> command_buffer_;
264 scoped_ptr<CommandBufferHelper> helper_; 264 std::unique_ptr<CommandBufferHelper> helper_;
265 scoped_ptr<TransferBuffer> transfer_buffer_; 265 std::unique_ptr<TransferBuffer> transfer_buffer_;
266 int32_t transfer_buffer_id_; 266 int32_t transfer_buffer_id_;
267 }; 267 };
268 268
269 void TransferBufferExpandContractTest::SetUp() { 269 void TransferBufferExpandContractTest::SetUp() {
270 command_buffer_.reset(new StrictMock<MockClientCommandBufferCanFail>()); 270 command_buffer_.reset(new StrictMock<MockClientCommandBufferCanFail>());
271 ASSERT_TRUE(command_buffer_->Initialize()); 271 ASSERT_TRUE(command_buffer_->Initialize());
272 272
273 EXPECT_CALL(*command_buffer(), 273 EXPECT_CALL(*command_buffer(),
274 CreateTransferBuffer(kCommandBufferSizeBytes, _)) 274 CreateTransferBuffer(kCommandBufferSizeBytes, _))
275 .WillOnce(Invoke( 275 .WillOnce(Invoke(
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 481
482 // Check it's the default size. 482 // Check it's the default size.
483 EXPECT_EQ( 483 EXPECT_EQ(
484 kStartTransferBufferSize - kStartingOffset, 484 kStartTransferBufferSize - kStartingOffset,
485 transfer_buffer_->GetCurrentMaxAllocationWithoutRealloc()); 485 transfer_buffer_->GetCurrentMaxAllocationWithoutRealloc());
486 } 486 }
487 487
488 } // namespace gpu 488 } // namespace gpu
489 489
490 490
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698