OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 CommandBufferEntry args[2]; | 275 CommandBufferEntry args[2]; |
276 args[0].value_uint32 = 3; | 276 args[0].value_uint32 = 3; |
277 args[1].value_float = 4.f; | 277 args[1].value_float = 4.f; |
278 | 278 |
279 // Add a first command. | 279 // Add a first command. |
280 AddCommandWithExpect(parse_error::kParseNoError, 3, 2, args); | 280 AddCommandWithExpect(parse_error::kParseNoError, 3, 2, args); |
281 // keep track of the buffer position. | 281 // keep track of the buffer position. |
282 CommandBufferOffset command1_put = get_helper_put(); | 282 CommandBufferOffset command1_put = get_helper_put(); |
283 int32 token = helper_->InsertToken(); | 283 int32 token = helper_->InsertToken(); |
284 | 284 |
285 EXPECT_CALL(*api_mock_.get(), DoCommand(kSetToken, 1, _)) | 285 EXPECT_CALL(*api_mock_.get(), DoCommand(cmd::kSetToken, 1, _)) |
286 .WillOnce(DoAll(Invoke(api_mock_.get(), &AsyncAPIMock::SetToken), | 286 .WillOnce(DoAll(Invoke(api_mock_.get(), &AsyncAPIMock::SetToken), |
287 Return(parse_error::kParseNoError))); | 287 Return(parse_error::kParseNoError))); |
288 // Add another command. | 288 // Add another command. |
289 AddCommandWithExpect(parse_error::kParseNoError, 4, 2, args); | 289 AddCommandWithExpect(parse_error::kParseNoError, 4, 2, args); |
290 helper_->WaitForToken(token); | 290 helper_->WaitForToken(token); |
291 // check that the get pointer is beyond the first command. | 291 // check that the get pointer is beyond the first command. |
292 EXPECT_LE(command1_put, command_buffer_->GetGetOffset()); | 292 EXPECT_LE(command1_put, command_buffer_->GetGetOffset()); |
293 helper_->Finish(); | 293 helper_->Finish(); |
294 | 294 |
295 // Check that the commands did happen. | 295 // Check that the commands did happen. |
296 Mock::VerifyAndClearExpectations(api_mock_.get()); | 296 Mock::VerifyAndClearExpectations(api_mock_.get()); |
297 | 297 |
298 // Check the error status. | 298 // Check the error status. |
299 EXPECT_FALSE(command_buffer_->GetErrorStatus()); | 299 EXPECT_FALSE(command_buffer_->GetErrorStatus()); |
300 EXPECT_EQ(parse_error::kParseNoError, command_buffer_->ResetParseError()); | 300 EXPECT_EQ(parse_error::kParseNoError, command_buffer_->ResetParseError()); |
301 } | 301 } |
302 | 302 |
303 } // namespace command_buffer | 303 } // namespace command_buffer |
304 } // namespace o3d | 304 } // namespace o3d |
OLD | NEW |