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

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

Issue 2469803003: Revert of Initialize buffers before allowing access to them. (Closed)
Patch Set: Created 4 years, 1 month 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/buffer_manager.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/buffer_manager_unittest.cc
diff --git a/gpu/command_buffer/service/buffer_manager_unittest.cc b/gpu/command_buffer/service/buffer_manager_unittest.cc
index 9a893f14ae15ca5a61b1d6d0d03d67401d1598df..327e679dc6e3bcaa23cdeb96be9d0ab311a8b94a 100644
--- a/gpu/command_buffer/service/buffer_manager_unittest.cc
+++ b/gpu/command_buffer/service/buffer_manager_unittest.cc
@@ -61,16 +61,20 @@
bool DoBufferSubData(
Buffer* buffer, GLenum target, GLintptr offset, GLsizeiptr size,
const GLvoid* data) {
+ bool success = true;
if (!buffer->CheckRange(offset, size)) {
- return false;
- }
- if (!buffer->IsClientSideArray()) {
+ EXPECT_CALL(*error_state_, SetGLError(_, _, GL_INVALID_VALUE, _, _))
+ .Times(1)
+ .RetiresOnSaturation();
+ success = false;
+ } else if (!buffer->IsClientSideArray()) {
EXPECT_CALL(*gl_, BufferSubData(target, offset, size, _))
.Times(1)
.RetiresOnSaturation();
}
- manager_->DoBufferSubData(buffer, target, offset, size, data);
- return true;
+ manager_->DoBufferSubData(
+ error_state_.get(), buffer, target, offset, size, data);
+ return success;
}
void RunGetMaxValueForRangeUint8Test(bool enable_primitive_restart)
@@ -585,3 +589,5 @@
} // namespace gles2
} // namespace gpu
+
+
« no previous file with comments | « gpu/command_buffer/service/buffer_manager.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698