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

Side by Side Diff: gpu/command_buffer/client/gles2_implementation_unittest.cc

Issue 1864723003: Make lost context and error message callbacks on GpuControl go to client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: errorcallback: . Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Tests for GLES2Implementation. 5 // Tests for GLES2Implementation.
6 6
7 #include "gpu/command_buffer/client/gles2_implementation.h" 7 #include "gpu/command_buffer/client/gles2_implementation.h"
8 8
9 #include <GLES2/gl2.h> 9 #include <GLES2/gl2.h>
10 #include <GLES2/gl2ext.h> 10 #include <GLES2/gl2ext.h>
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 InSequence sequence; 484 InSequence sequence;
485 485
486 const bool support_client_side_arrays = true; 486 const bool support_client_side_arrays = true;
487 gl_.reset(new GLES2Implementation(helper_.get(), 487 gl_.reset(new GLES2Implementation(helper_.get(),
488 share_group, 488 share_group,
489 transfer_buffer_.get(), 489 transfer_buffer_.get(),
490 bind_generates_resource_client, 490 bind_generates_resource_client,
491 lose_context_when_out_of_memory, 491 lose_context_when_out_of_memory,
492 support_client_side_arrays, 492 support_client_side_arrays,
493 gpu_control_.get())); 493 gpu_control_.get()));
494 }
494 495
495 if (!gl_->Initialize(kTransferBufferSize, 496 // The client should be set to something non-null.
496 kTransferBufferSize, 497 EXPECT_CALL(*gpu_control_, SetGpuControlClient(gl_.get())).Times(1);
497 kTransferBufferSize, 498
498 GLES2Implementation::kNoLimit)) 499 if (!gl_->Initialize(kTransferBufferSize, kTransferBufferSize,
499 return false; 500 kTransferBufferSize, GLES2Implementation::kNoLimit))
500 } 501 return false;
501 502
502 helper_->CommandBufferHelper::Finish(); 503 helper_->CommandBufferHelper::Finish();
503 ::testing::Mock::VerifyAndClearExpectations(gl_.get()); 504 ::testing::Mock::VerifyAndClearExpectations(gl_.get());
504 505
505 scoped_refptr<Buffer> ring_buffer = helper_->get_ring_buffer(); 506 scoped_refptr<Buffer> ring_buffer = helper_->get_ring_buffer();
506 commands_ = static_cast<CommandBufferEntry*>(ring_buffer->memory()) + 507 commands_ = static_cast<CommandBufferEntry*>(ring_buffer->memory()) +
507 command_buffer()->GetPutOffset(); 508 command_buffer()->GetPutOffset();
508 ClearCommands(); 509 ClearCommands();
509 EXPECT_TRUE(transfer_buffer_->InSync()); 510 EXPECT_TRUE(transfer_buffer_->InSync());
510 511
(...skipping 3988 matching lines...) Expand 10 before | Expand all | Expand 10 after
4499 ContextInitOptions init_options; 4500 ContextInitOptions init_options;
4500 init_options.transfer_buffer_initialize_fail = true; 4501 init_options.transfer_buffer_initialize_fail = true;
4501 EXPECT_FALSE(Initialize(init_options)); 4502 EXPECT_FALSE(Initialize(init_options));
4502 } 4503 }
4503 4504
4504 #include "base/macros.h" 4505 #include "base/macros.h"
4505 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" 4506 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h"
4506 4507
4507 } // namespace gles2 4508 } // namespace gles2
4508 } // namespace gpu 4509 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698