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

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

Issue 551073: Call xglMakeCurrent for each command buffer to allow for multiple GL contexts... (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/service/gpu_processor.cc ('k') | gpu/command_buffer/service/x_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gpu_processor_unittest.cc
===================================================================
--- gpu/command_buffer/service/gpu_processor_unittest.cc (revision 36557)
+++ gpu/command_buffer/service/gpu_processor_unittest.cc (working copy)
@@ -8,6 +8,7 @@
#include "gpu/command_buffer/service/mocks.h"
#include "gpu/command_buffer/service/gpu_processor.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
+#include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -43,7 +44,7 @@
async_api_.reset(new StrictMock<AsyncAPIMock>);
- decoder_ = gles2::GLES2Decoder::Create();
+ decoder_ = new gles2::MockGLES2Decoder();
parser_ = new CommandParser(buffer_,
kRingBufferEntries,
@@ -70,7 +71,7 @@
scoped_ptr<::base::SharedMemory> shared_memory_;
Buffer shared_memory_buffer_;
int32* buffer_;
- gles2::GLES2Decoder* decoder_;
+ gles2::MockGLES2Decoder* decoder_;
CommandParser* parser_;
scoped_ptr<AsyncAPIMock> async_api_;
scoped_refptr<GPUProcessor> processor_;
@@ -129,6 +130,16 @@
processor_->ProcessCommands();
}
+TEST_F(GPUProcessorTest, ProcessorSetsAndResetsTheGLContext) {
+ EXPECT_CALL(*decoder_, MakeCurrent())
+ .WillOnce(Return(true));
+ EXPECT_CALL(*command_buffer_, GetPutOffset())
+ .WillOnce(Return(0));
+ EXPECT_CALL(*command_buffer_, SetGetOffset(0));
+
+ processor_->ProcessCommands();
+}
+
TEST_F(GPUProcessorTest, PostsTaskToFinishRemainingCommands) {
CommandHeader* header = reinterpret_cast<CommandHeader*>(&buffer_[0]);
header[0].command = 7;
« no previous file with comments | « gpu/command_buffer/service/gpu_processor.cc ('k') | gpu/command_buffer/service/x_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698