Chromium Code Reviews| Index: gpu/command_buffer/service/cmd_parser_test.cc |
| diff --git a/gpu/command_buffer/service/cmd_parser_test.cc b/gpu/command_buffer/service/cmd_parser_test.cc |
| index 7df519d71431e6e8222864731da7158409d0fc9d..d9bb24b47ff822966757896de0855cbb1dfcb74d 100644 |
| --- a/gpu/command_buffer/service/cmd_parser_test.cc |
| +++ b/gpu/command_buffer/service/cmd_parser_test.cc |
| @@ -4,11 +4,13 @@ |
| // Tests for the command parser. |
| +#include "gpu/command_buffer/service/cmd_parser.h" |
|
no sievers
2016/04/05 19:02:40
nit: This can stay where it was
Mostyn Bramley-Moore
2016/04/05 21:35:31
Done.
|
| + |
| #include <stddef.h> |
| +#include <memory> |
| + |
| #include "base/logging.h" |
| -#include "base/memory/scoped_ptr.h" |
| -#include "gpu/command_buffer/service/cmd_parser.h" |
| #include "gpu/command_buffer/service/mocks.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| @@ -61,14 +63,14 @@ class CommandParserTest : public testing::Test { |
| CommandBufferEntry *buffer() { return buffer_.get(); } |
| private: |
| unsigned int buffer_entry_count_; |
| - scoped_ptr<AsyncAPIMock> api_mock_; |
| - scoped_ptr<CommandBufferEntry[]> buffer_; |
| + std::unique_ptr<AsyncAPIMock> api_mock_; |
| + std::unique_ptr<CommandBufferEntry[]> buffer_; |
| Sequence sequence_; |
| }; |
| // Tests initialization conditions. |
| TEST_F(CommandParserTest, TestInit) { |
| - scoped_ptr<CommandParser> parser(MakeParser(10)); |
| + std::unique_ptr<CommandParser> parser(MakeParser(10)); |
| EXPECT_EQ(0, parser->get()); |
| EXPECT_EQ(0, parser->put()); |
| EXPECT_TRUE(parser->IsEmpty()); |
| @@ -76,7 +78,7 @@ TEST_F(CommandParserTest, TestInit) { |
| // Tests simple commands. |
| TEST_F(CommandParserTest, TestSimple) { |
| - scoped_ptr<CommandParser> parser(MakeParser(10)); |
| + std::unique_ptr<CommandParser> parser(MakeParser(10)); |
| CommandBufferOffset put = parser->put(); |
| CommandHeader header; |
| @@ -109,7 +111,7 @@ TEST_F(CommandParserTest, TestSimple) { |
| // Tests having multiple commands in the buffer. |
| TEST_F(CommandParserTest, TestMultipleCommands) { |
| - scoped_ptr<CommandParser> parser(MakeParser(10)); |
| + std::unique_ptr<CommandParser> parser(MakeParser(10)); |
| CommandBufferOffset put = parser->put(); |
| CommandHeader header; |
| @@ -161,7 +163,7 @@ TEST_F(CommandParserTest, TestMultipleCommands) { |
| // Tests that the parser will wrap correctly at the end of the buffer. |
| TEST_F(CommandParserTest, TestWrap) { |
| - scoped_ptr<CommandParser> parser(MakeParser(5)); |
| + std::unique_ptr<CommandParser> parser(MakeParser(5)); |
| CommandBufferOffset put = parser->put(); |
| CommandHeader header; |
| @@ -213,7 +215,7 @@ TEST_F(CommandParserTest, TestWrap) { |
| // Tests error conditions. |
| TEST_F(CommandParserTest, TestError) { |
| const unsigned int kNumEntries = 5; |
| - scoped_ptr<CommandParser> parser(MakeParser(kNumEntries)); |
| + std::unique_ptr<CommandParser> parser(MakeParser(kNumEntries)); |
| CommandBufferOffset put = parser->put(); |
| CommandHeader header; |
| @@ -285,7 +287,7 @@ TEST_F(CommandParserTest, TestError) { |
| } |
| TEST_F(CommandParserTest, SetBuffer) { |
| - scoped_ptr<CommandParser> parser(MakeParser(3)); |
| + std::unique_ptr<CommandParser> parser(MakeParser(3)); |
| CommandBufferOffset put = parser->put(); |
| CommandHeader header; |
| @@ -303,7 +305,7 @@ TEST_F(CommandParserTest, SetBuffer) { |
| EXPECT_EQ(2, parser->get()); |
| Mock::VerifyAndClearExpectations(api_mock()); |
| - scoped_ptr<CommandBufferEntry[]> buffer2(new CommandBufferEntry[2]); |
| + std::unique_ptr<CommandBufferEntry[]> buffer2(new CommandBufferEntry[2]); |
| parser->SetBuffer( |
| buffer2.get(), sizeof(CommandBufferEntry) * 2, 0, |
| sizeof(CommandBufferEntry) * 2); |