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

Side by Side Diff: gpu/command_buffer/client/mapped_memory_unittest.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
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 #include "gpu/command_buffer/client/mapped_memory.h" 5 #include "gpu/command_buffer/client/mapped_memory.h"
6 6
7 #include <list> 7 #include <list>
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 16 matching lines...) Expand all
27 using testing::Sequence; 27 using testing::Sequence;
28 using testing::DoAll; 28 using testing::DoAll;
29 using testing::Invoke; 29 using testing::Invoke;
30 using testing::_; 30 using testing::_;
31 31
32 class MappedMemoryTestBase : public testing::Test { 32 class MappedMemoryTestBase : public testing::Test {
33 protected: 33 protected:
34 static const unsigned int kBufferSize = 1024; 34 static const unsigned int kBufferSize = 1024;
35 35
36 virtual void SetUp() { 36 virtual void SetUp() {
37 api_mock_.reset(new AsyncAPIMock); 37 api_mock_.reset(new AsyncAPIMock(true));
38 // ignore noops in the mock - we don't want to inspect the internals of the 38 // ignore noops in the mock - we don't want to inspect the internals of the
39 // helper. 39 // helper.
40 EXPECT_CALL(*api_mock_, DoCommand(cmd::kNoop, 0, _)) 40 EXPECT_CALL(*api_mock_, DoCommand(cmd::kNoop, 0, _))
41 .WillRepeatedly(Return(error::kNoError)); 41 .WillRepeatedly(Return(error::kNoError));
42 // Forward the SetToken calls to the engine 42 // Forward the SetToken calls to the engine
43 EXPECT_CALL(*api_mock_.get(), DoCommand(cmd::kSetToken, 1, _)) 43 EXPECT_CALL(*api_mock_.get(), DoCommand(cmd::kSetToken, 1, _))
44 .WillRepeatedly(DoAll(Invoke(api_mock_.get(), &AsyncAPIMock::SetToken), 44 .WillRepeatedly(DoAll(Invoke(api_mock_.get(), &AsyncAPIMock::SetToken),
45 Return(error::kNoError))); 45 Return(error::kNoError)));
46 46
47 { 47 {
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 unsigned int offset3; 447 unsigned int offset3;
448 void* mem3 = manager_->Alloc(kSize, &id3, &offset3); 448 void* mem3 = manager_->Alloc(kSize, &id3, &offset3);
449 EXPECT_EQ(manager_->bytes_in_use(), kSize * 2); 449 EXPECT_EQ(manager_->bytes_in_use(), kSize * 2);
450 450
451 manager_->Free(mem2); 451 manager_->Free(mem2);
452 manager_->Free(mem3); 452 manager_->Free(mem3);
453 EXPECT_EQ(manager_->bytes_in_use(), static_cast<size_t>(0)); 453 EXPECT_EQ(manager_->bytes_in_use(), static_cast<size_t>(0));
454 } 454 }
455 455
456 } // namespace gpu 456 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/fenced_allocator_test.cc ('k') | gpu/command_buffer/client/ring_buffer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698