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

Unified Diff: gpu/command_buffer/service/cmd_parser_test.cc

Issue 8865008: Revert 113479 - Revert "Revert 113250 - Add CommandBuffer::SetGetBuffer" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/cmd_parser.cc ('k') | gpu/command_buffer/service/command_buffer_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/cmd_parser_test.cc
===================================================================
--- gpu/command_buffer/service/cmd_parser_test.cc (revision 113511)
+++ gpu/command_buffer/service/cmd_parser_test.cc (working copy)
@@ -48,10 +48,12 @@
size_t command_buffer_size = entry_count *
sizeof(CommandBufferEntry); // NOLINT
DCHECK_LE(command_buffer_size, shm_size);
- CommandParser* parser = new CommandParser(api_mock());
-
- parser->SetBuffer(buffer(), shm_size, 0, command_buffer_size);
- return parser;
+ return new CommandParser(buffer(),
+ shm_size,
+ 0,
+ command_buffer_size,
+ 0,
+ api_mock());
}
unsigned int buffer_entry_count() { return 20; }
@@ -286,34 +288,4 @@
Mock::VerifyAndClearExpectations(api_mock());
}
-TEST_F(CommandParserTest, SetBuffer) {
- scoped_ptr<CommandParser> parser(MakeParser(3));
- CommandBufferOffset put = parser->put();
- CommandHeader header;
-
- // add a single command, no args
- header.size = 2;
- header.command = 123;
- buffer()[put++].value_header = header;
- buffer()[put++].value_int32 = 456;
-
- CommandBufferEntry param_array[1];
- param_array[0].value_int32 = 456;
-
- parser->set_put(put);
- AddDoCommandExpect(error::kNoError, 123, 1, param_array);
- EXPECT_EQ(error::kNoError, parser->ProcessAllCommands());
- // We should have advanced 2 entries
- EXPECT_EQ(2, parser->get());
- Mock::VerifyAndClearExpectations(api_mock());
-
- scoped_array<CommandBufferEntry> buffer2(new CommandBufferEntry[2]);
- parser->SetBuffer(
- buffer2.get(), sizeof(CommandBufferEntry) * 2, 0,
- sizeof(CommandBufferEntry) * 2);
- // The put and get should have reset to 0.
- EXPECT_EQ(0, parser->get());
- EXPECT_EQ(0, parser->put());
-}
-
} // namespace gpu
« no previous file with comments | « gpu/command_buffer/service/cmd_parser.cc ('k') | gpu/command_buffer/service/command_buffer_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698