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

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

Issue 8586048: base::Bind() conversion for remaining GPU files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 the Command Buffer Helper. 5 // Tests for the Command Buffer Helper.
6 6
7 #include "base/callback.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h"
8 #include "base/message_loop.h" 9 #include "base/message_loop.h"
9 #include "gpu/command_buffer/client/cmd_buffer_helper.h" 10 #include "gpu/command_buffer/client/cmd_buffer_helper.h"
10 #include "gpu/command_buffer/service/mocks.h" 11 #include "gpu/command_buffer/service/mocks.h"
11 #include "gpu/command_buffer/service/command_buffer_service.h" 12 #include "gpu/command_buffer/service/command_buffer_service.h"
12 #include "gpu/command_buffer/service/gpu_scheduler.h" 13 #include "gpu/command_buffer/service/gpu_scheduler.h"
13 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
14 15
15 #if defined(OS_MACOSX) 16 #if defined(OS_MACOSX)
16 #include "base/mac/scoped_nsautorelease_pool.h" 17 #include "base/mac/scoped_nsautorelease_pool.h"
17 #endif 18 #endif
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 0, 76 0,
76 api_mock_.get()); 77 api_mock_.get());
77 78
78 do_jump_command_.reset(new DoJumpCommand(parser_)); 79 do_jump_command_.reset(new DoJumpCommand(parser_));
79 EXPECT_CALL(*api_mock_, DoCommand(cmd::kJump, _, _)) 80 EXPECT_CALL(*api_mock_, DoCommand(cmd::kJump, _, _))
80 .WillRepeatedly( 81 .WillRepeatedly(
81 Invoke(do_jump_command_.get(), &DoJumpCommand::DoCommand)); 82 Invoke(do_jump_command_.get(), &DoJumpCommand::DoCommand));
82 83
83 gpu_scheduler_.reset(new GpuScheduler( 84 gpu_scheduler_.reset(new GpuScheduler(
84 command_buffer_.get(), NULL, parser_)); 85 command_buffer_.get(), NULL, parser_));
85 command_buffer_->SetPutOffsetChangeCallback(NewCallback( 86 command_buffer_->SetPutOffsetChangeCallback(base::Bind(
86 gpu_scheduler_.get(), &GpuScheduler::PutChanged)); 87 &GpuScheduler::PutChanged, base::Unretained(gpu_scheduler_.get())));
87 88
88 api_mock_->set_engine(gpu_scheduler_.get()); 89 api_mock_->set_engine(gpu_scheduler_.get());
89 90
90 helper_.reset(new CommandBufferHelper(command_buffer_.get())); 91 helper_.reset(new CommandBufferHelper(command_buffer_.get()));
91 helper_->Initialize(kCommandBufferSizeBytes); 92 helper_->Initialize(kCommandBufferSizeBytes);
92 } 93 }
93 94
94 virtual void TearDown() { 95 virtual void TearDown() {
95 // If the GpuScheduler posts any tasks, this forces them to run. 96 // If the GpuScheduler posts any tasks, this forces them to run.
96 MessageLoop::current()->RunAllPending(); 97 MessageLoop::current()->RunAllPending();
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 helper_->Finish(); 303 helper_->Finish();
303 304
304 // Check that the commands did happen. 305 // Check that the commands did happen.
305 Mock::VerifyAndClearExpectations(api_mock_.get()); 306 Mock::VerifyAndClearExpectations(api_mock_.get());
306 307
307 // Check the error status. 308 // Check the error status.
308 EXPECT_EQ(error::kNoError, GetError()); 309 EXPECT_EQ(error::kNoError, GetError());
309 } 310 }
310 311
311 } // namespace gpu 312 } // namespace gpu
OLDNEW
« no previous file with comments | « content/common/gpu/image_transport_surface.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