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

Unified Diff: gpu/command_buffer/client/cmd_buffer_helper_test.cc

Issue 555020: Redesigned CommandBuffer and NPDevice3D interfaces (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/client/cmd_buffer_helper.cc ('k') | gpu/command_buffer/client/fenced_allocator_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/cmd_buffer_helper_test.cc
===================================================================
--- gpu/command_buffer/client/cmd_buffer_helper_test.cc (revision 37414)
+++ gpu/command_buffer/client/cmd_buffer_helper_test.cc (working copy)
@@ -102,6 +102,18 @@
}
}
+ int32 GetGetOffset() {
+ return command_buffer_->GetState().get_offset;
+ }
+
+ int32 GetPutOffset() {
+ return command_buffer_->GetState().put_offset;
+ }
+
+ parse_error::ParseError GetError() {
+ return command_buffer_->GetState().error;
+ }
+
CommandBufferOffset get_helper_put() { return helper_->put_; }
base::AtExitManager at_exit_manager_;
@@ -119,9 +131,8 @@
// Check initial state of the engine - it should have been configured by the
// helper.
EXPECT_TRUE(parser_ != NULL);
- EXPECT_FALSE(command_buffer_->GetErrorStatus());
- EXPECT_EQ(parse_error::kParseNoError, command_buffer_->ResetParseError());
- EXPECT_EQ(0, command_buffer_->GetGetOffset());
+ EXPECT_EQ(parse_error::kParseNoError, GetError());
+ EXPECT_EQ(0, GetGetOffset());
// Add 3 commands through the helper
AddCommandWithExpect(parse_error::kParseNoError, 1, 0, NULL);
@@ -149,8 +160,7 @@
Mock::VerifyAndClearExpectations(api_mock_.get());
// Check the error status.
- EXPECT_FALSE(command_buffer_->GetErrorStatus());
- EXPECT_EQ(parse_error::kParseNoError, command_buffer_->ResetParseError());
+ EXPECT_EQ(parse_error::kParseNoError, GetError());
}
// Checks that commands in the buffer are properly executed when wrapping the
@@ -170,36 +180,9 @@
Mock::VerifyAndClearExpectations(api_mock_.get());
// Check the error status.
- EXPECT_FALSE(command_buffer_->GetErrorStatus());
- EXPECT_EQ(parse_error::kParseNoError, command_buffer_->ResetParseError());
+ EXPECT_EQ(parse_error::kParseNoError, GetError());
}
-
-// Checks that commands in the buffer are properly executed, even if they
-// generate a recoverable error. Check that the error status is properly set,
-// and reset when queried.
-TEST_F(CommandBufferHelperTest, TestRecoverableError) {
- CommandBufferEntry args[2];
- args[0].value_uint32 = 3;
- args[1].value_float = 4.f;
-
- // Create a command buffer with 3 commands, 2 of them generating errors
- AddCommandWithExpect(parse_error::kParseNoError, 1, 2, args);
- AddCommandWithExpect(parse_error::kParseUnknownCommand, 2, 2, args);
- AddCommandWithExpect(parse_error::kParseInvalidArguments, 3, 2,
- args);
-
- helper_->Finish();
- // Check that the commands did happen.
- Mock::VerifyAndClearExpectations(api_mock_.get());
-
- // Check that the error status was set to the first error.
- EXPECT_EQ(parse_error::kParseUnknownCommand,
- command_buffer_->ResetParseError());
- // Check that the error status was reset after the query.
- EXPECT_EQ(parse_error::kParseNoError, command_buffer_->ResetParseError());
-}
-
// Checks that asking for available entries work, and that the parser
// effectively won't use that space.
TEST_F(CommandBufferHelperTest, TestAvailableEntries) {
@@ -229,8 +212,7 @@
Mock::VerifyAndClearExpectations(api_mock_.get());
// Check the error status.
- EXPECT_FALSE(command_buffer_->GetErrorStatus());
- EXPECT_EQ(parse_error::kParseNoError, command_buffer_->ResetParseError());
+ EXPECT_EQ(parse_error::kParseNoError, GetError());
}
// Checks that the InsertToken/WaitForToken work.
@@ -252,15 +234,14 @@
AddCommandWithExpect(parse_error::kParseNoError, 4, 2, args);
helper_->WaitForToken(token);
// check that the get pointer is beyond the first command.
- EXPECT_LE(command1_put, command_buffer_->GetGetOffset());
+ EXPECT_LE(command1_put, GetGetOffset());
helper_->Finish();
// Check that the commands did happen.
Mock::VerifyAndClearExpectations(api_mock_.get());
// Check the error status.
- EXPECT_FALSE(command_buffer_->GetErrorStatus());
- EXPECT_EQ(parse_error::kParseNoError, command_buffer_->ResetParseError());
+ EXPECT_EQ(parse_error::kParseNoError, GetError());
}
} // namespace gpu
« no previous file with comments | « gpu/command_buffer/client/cmd_buffer_helper.cc ('k') | gpu/command_buffer/client/fenced_allocator_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698