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

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

Issue 558513003: command_buffer: Batch command processing to reduce handler overheads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 6 years, 3 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
« no previous file with comments | « no previous file | gpu/command_buffer/client/fenced_allocator_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 the Command Buffer Helper. 5 // Tests for the Command Buffer Helper.
6 6
7 #include <list> 7 #include <list>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 int flush_count_; 78 int flush_count_;
79 DISALLOW_COPY_AND_ASSIGN(CommandBufferServiceLocked); 79 DISALLOW_COPY_AND_ASSIGN(CommandBufferServiceLocked);
80 }; 80 };
81 81
82 // Test fixture for CommandBufferHelper test - Creates a CommandBufferHelper, 82 // Test fixture for CommandBufferHelper test - Creates a CommandBufferHelper,
83 // using a CommandBufferEngine with a mock AsyncAPIInterface for its interface 83 // using a CommandBufferEngine with a mock AsyncAPIInterface for its interface
84 // (calling it directly, not through the RPC mechanism). 84 // (calling it directly, not through the RPC mechanism).
85 class CommandBufferHelperTest : public testing::Test { 85 class CommandBufferHelperTest : public testing::Test {
86 protected: 86 protected:
87 virtual void SetUp() { 87 virtual void SetUp() {
88 api_mock_.reset(new AsyncAPIMock); 88 api_mock_.reset(new AsyncAPIMock(true));
89
89 // ignore noops in the mock - we don't want to inspect the internals of the 90 // ignore noops in the mock - we don't want to inspect the internals of the
90 // helper. 91 // helper.
91 EXPECT_CALL(*api_mock_, DoCommand(cmd::kNoop, _, _)) 92 EXPECT_CALL(*api_mock_, DoCommand(cmd::kNoop, _, _))
92 .WillRepeatedly(Return(error::kNoError)); 93 .WillRepeatedly(Return(error::kNoError));
93 94
94 { 95 {
95 TransferBufferManager* manager = new TransferBufferManager(); 96 TransferBufferManager* manager = new TransferBufferManager();
96 transfer_buffer_manager_.reset(manager); 97 transfer_buffer_manager_.reset(manager);
97 EXPECT_TRUE(manager->Initialize()); 98 EXPECT_TRUE(manager->Initialize());
98 } 99 }
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 helper_->Finish(); 703 helper_->Finish();
703 704
704 // Check that the commands did happen. 705 // Check that the commands did happen.
705 Mock::VerifyAndClearExpectations(api_mock_.get()); 706 Mock::VerifyAndClearExpectations(api_mock_.get());
706 707
707 // Check the error status. 708 // Check the error status.
708 EXPECT_EQ(error::kNoError, GetError()); 709 EXPECT_EQ(error::kNoError, GetError());
709 } 710 }
710 711
711 } // namespace gpu 712 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/client/fenced_allocator_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698